This project contains a suite of automated tests designed for end-to-end testing of a web application. The framework is built with Java, utilizes Maven for dependency management, Selenium for browser automation, and JUnit 5 for test execution. Additionally, the project is fully Dockerized, enabling easy and consistent test execution across environments.
- Project Overview
- Tech Stack
- Prerequisites
- Installation
- Running the Tests
- Test Structure
- Test Reports
- Troubleshooting
This project automates the testing of core functionalities for a web application, such as:
- User Authentication: Login/logout with valid and invalid credentials.
- Navigation: Validation of menus, navigation bars, and page transitions.
- Form Interactions: Filling out and submitting forms.
- Feature Verification: Ensuring key functionalities work as intended.
System Under Test (SUT): The application under test is hosted at https://www.saucedemo.com/
.
Before running the tests, ensure the following are installed:
- Java Development Kit (JDK) (version 11 or later)
- Maven (version 3.6.0 or later)
- WebDriver (e.g., ChromeDriver) – Ensure the WebDriver version matches your browser version.
Optional:
- Docker: Required if running tests in a containerized environment.
- Integrated Development Environment (IDE): IntelliJ IDEA or Eclipse for viewing or modifying test code.
- Clone the Repository
git clone https://github.com/CodecoolGlobal/test-automation-webshop-in-beta-general-qutasi.git cd test-automation-webshop-in-beta-general-qutasi
- Build and run the tests using Docker Compose
docker-compose up --build
To execute all tests:
mvn clean test
To run specific test classes or methods:
mvn -Dtest=TestClassName#methodName test
docker-compose up
The Docker container will automatically set up the environment, execute the tests, and save reports to /target
inside the container.
The project follows the Page Object Model (POM) design pattern:
- Pages: Located in
src/test/java/com/codecool/models
- Contains reusable components representing application pages.
- Tests: Located in
src/test/java/com/codecool/test
- Includes test cases for verifying application functionality.
After executing the tests, reports will be available in the following directory:
/target/surefire-reports/
These reports provide detailed information about passed, failed, or skipped tests.
- Ensure the WebDriver version matches your browser version.
- If using Docker, verify that Docker is installed and running.
- Check for missing dependencies or errors in the Maven build logs.
- Update WebDriver or browser versions if compatibility issues arise.