This repository contains automated test suites designed and implemented by Filipe Preto Alves for the DemoQA website using Selenium WebDriver with Java, TestNG, and Log4j2.
This repository showcases comprehensive automation tests for the DemoQA website, covering various functionalities to ensure stability and reliability.
├── main
│ ├── java
│ │ ├── BaseTest.java
│ │ ├── Browser.java
│ │ └── TestUtilities.java
│ └── resources
│ ├── chromedriver # WebDriver executable
│ ├── geckodriver # WebDriver executable
│ ├── log4j2.xml # Log4j2 configuration
│ └── testng.xml # TestNG suite configuration
├── test
│ ├── java
│ │ └── demoqa
│ │ ├── HomePageTest.java
│ │ └── ElementsTest.java
│ └── TestSuites
│ └── AllTests.xml
└── pom.xml # Maven project configuration
This layout maintains simplicity by categorizing directories into main functional areas. It includes minimal details to provide a quick overview of the project structure.
Ensure the following are installed on your machine:
- Java Development Kit (JDK): Required for Java development.
- Maven: Dependency management and build tool.
- Chrome, Firefox and Safari browsers: Needed for testing.
-
Download WebDriver Executables:
- Download compatible versions of chromedriver, geckodriver, and safaridriver for Chrome, Firefox, and Safari browsers, respectively.
-
Place Executables:
- Place these WebDriver executables in the
src/main/resources
directory of your project.
- Place these WebDriver executables in the
- Customize Log4j2 Configuration:
- Locate and customize the
log4j2.xml
file located insrc/main/resources
according to your logging preferences.
- Locate and customize the
TestNG Suite Configuration
The testng.xml file defines the test suite configuration for executing tests of the DemoQA website using different parameters.
The suite configuration specifies different test classes for the differents elements of the DemoQA website.
The resources folder contains WebDriver executables (chromedriver, geckodriver), Log4j2 configuration (log4j2.xml), and the TestNG suite configuration (testng.xml) for seamless test execution.
Execute the tests using the following command:
mvn clean test
This command triggers Maven to compile the code, execute the tests, and generate comprehensive test reports.
Contributions are welcome! Please feel free to create pull requests for enhancements, bug fixes, or additional test cases to further improve the test coverage.
This project is licensed under the MIT License - see the LICENSE file for details.