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.
test/java
features
Where feature files should be createdAccount.feature
Pages
Where the page object of tests should be createdAccountPage
StepDefinitions
Where the specification of tests should be createdHooks
Run before or after each scenarioAccountStep
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.
- Install Java Development Kit (JDK);
- Set up the variable JAVA to MAC, Windows, and Linux;
- Install Maven
- Run
mvn clean
clean the project - Run
mvn compile
compile the source code of the project
-
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");
- 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}