Skip to content

tuliobluz/java-selenium-factory-cucumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-selenium-factory-cucumber

Technologies used

I used the technologies below:

  • Selenium: It is for automating web applications for testing purposes, but is certainly not limited to just that;
  • Java: Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers. Java offers the rich user interface, performance, versatility, portability, and security that today's applications require;
  • Page Objects: Page Objects help you write cleaner tests by encapsulating information about the elements on your application page. A Page Object can be reused across multiple tests, and if the template of your application changes, you only need to update the Page Object;
  • Page Factory: age Factory in Selenium is an inbuilt Page Object Model framework concept for Selenium WebDriver but it is very optimized. It is used for initialization of Page objects or to instantiate the Page object itself. It is also used to initialize Page class elements without using "FindElement/s."
  • Cucumber: Cucumber is a tool that supports Behaviour-Driven Development (BDD) - a software development process that aims to enhance software quality and reduce maintenance costs.

Folders Structures

  • test/java
    • features Where feature files should be created
      • Account.feature
    • Pages Where the page object of tests should be created
      • AccountPage
    • StepDefinitions Where the specification of tests should be created
      • Hooks Run before or after each scenario
      • AccountStep
    • Utils Where the helpers can be created and classes methods to reuse.
      • Helpers This class is responsible to create methods to reuse, waits and etc.
      • ConfigFileReader This class is responsible to read the config.properties.
      • TestRunner
  • test/resources It is responsible to keep the drivers and properties files.

Requirement

To set up

  • Run mvn clean clean the project
  • Run mvn compile compile the source code of the project

Download the driver

  • Donwload the driver to your OS

  • Unpack the driver in this folder src/test/resources

  • If you are using Windows, you should change the line 19 on the filesrc/test/java/StepDefinitions/Hooks.java

System.setProperty("webdriver.chrome.driver","src/test/resources/chromedriver.exe");

Running tests

  • Run mvn test test the compiled source code using a suitable unit testing framework. It will be generated a report that can access by the link on the terminal after run all tests. e.g.: https://reports.cucumber.io/reports/{key}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published