Giter Site home page Giter Site logo

webtest-freindresrc's Introduction

WebTest

KEEN Template to automate Web Application Test with Selenium, Cucumber, TestNG, Junit Test and Apache Maven.

It handles almost all the headache in starting new automated testing project with java as the client library. You just have to start coding, then run your test framework from either Intellij IDEA or command prompt or terminal.

By the help of maven-cucumber-reporting, result of the tests will be generated automatically with the awesome bootstrap-based html.

Documentation

Prerequisite

This WebTest template use Cucumber framework with Gherkin to get the advantages of .feature files.

  • If you are not familiar with Gherkin, please refer https://cucumber.io/docs/reference for language concepts and its syntax.
  • Check your Java JDK, by run java -version in command prompt(Windows) or terminal(macOS). If you could see the version of java, then it has been installed, otherwise, please install it based on your operating system.**Make Sure you have set JAVA_HOME to jdk folder and jdk\bin to PATH (refer here).
  • Make sure that you have maven installed by run mvn -v in command prompt(Windows) or terminal(macOS). If you could see the version of maven, then it has been installed, otherwise, please install it based on your operating system. (refer here)
  • IDE requirement is Intellij Idea; either the Ultimate or the Community one would be fine.

Getting Started

Let's get our hand dirty.

  • If you are new to Intellij IDEA and you haven't got Git installed on your machine, please kindly download it from the official git website here. After git installation, you are good to go.
  • Launch Intellij IDEA,
    • if you are on Welcome Screen, choose check out from version control and in the dropdown, choose Git.
    • if you are not, on Intellij Menu Bar, choose File then New and click Project On Version Control and finally choose Git from the dropdown.
  • On Clone Repository Window,

Template Exploration

There should be four packages under src\test\java directory. Each of them play a vital role.

  • BaseUtil class under Base package is written to declare WebDriver
  • Features package is to wrap all feature files which are used to describe Behavorial Driven Developement concepts
  • POM package is created to wrap all POM's classes that define the elements and the methods performing in a webpage.
  • TestRunner is written to specify test type (junit or testng) and to specify the output directory
  • Steps packages can have only one Hook class to initialize and terminate WebDriver but it has endless number of step classes based on the steps specifying in .feature files

The target directory which contains test result will be created once you have run the tests.

Configuration

Most of the configurations are specified in the template itself via comments. But Do not to forget to

  • Configure the variables in src\test\java\Steps\Hook.java (See examples and suggestios in the Hook.java itself)
  • In src\test\java\Steps\Hook.java on Line 49 and 50, comment or delete one of the driver because you can run a test with only one driver at a time.

After this configuration, you now can define your .feature files as many as desired, and define the steps in src\test\java\Steps in many classes as prefered.

Automate TestCases

In src\test\java\Runner\TestRunner.java, the default set up is good to go already. Right Click and choose Run TestRunner. By doing this, the test result will be generated automatically by cucumber-testng.

To get maven-cucumber-reporting, you have to run the test from command line(on Windows) or from terminal(on macOS).

  • if you do not have maven on your system, please kindly install it.
  • Launch window command prompt or macOS terminal, navigate to the project you are working on.
  • Run mvn clean to clean the previous test target folder
  • Run mvn verify to automate the test

The result will be generated in target/kit-keen-webTest-html/cucumber-html-reports.Nota Bene: the kit-keen-webTest-html might be changed if you changed the folder name in the configuartion.

webtest-freindresrc's People

Contributors

chhatrachhorm avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.