This project is a UI test automation suite for the sample e-commerce website Demoblaze.com using Selenium Grid, Docker and Python. The suite includes tests for navigating categories, selecting products, adding products to the cart, placing orders, and verifying cart contents.
The main feature of this project is to set up a Selenium Grid infrastructure using Docker, which includes installing Chromium on Selenium Grid nodes. This setup allows for scalable, distributed, and automated browser testing with Chromium, leveraging Docker's containerization to ensure consistency, easy management, and deployment of the testing environment.
- Category Navigation: Automates the process of navigating through different product categories.
- Product Selection: Verifies the ability to select various products from the listings.
- Add to Cart: Ensures that products can be added to the shopping cart.
- Order Placement: Tests the complete checkout process, including form submissions.
- Cart Verification: Checks that the cart contents are correctly displayed and updated.
- Selenium Grid: For distributed test execution across multiple machines.
- Python: The primary programming language for the test scripts.
- Pytest: The testing framework used to write and run the tests.
- ChromeDriver: Used for running tests in a headless Chrome browser.
- Docker: For containerizing and managing the Selenium Grid and other dependencies.
To get started with running the tests locally, ensure you have the necessary dependencies installed and a Selenium Grid or local WebDriver set up.
- Clone the repository:
git clone https://github.com/yourusername/dummy-online-store.git
cd dummy-online-store
-
Install Poetry if it is not already installed.
-
Install the dependencies:
poetry install
- Set up ChromeDriver and ensure it is available in your system PATH.
To run the tests, use the following command:
poetry run pytest tests/
To run tests locally using Selenium, you can use the provided docker-compose.yml
file, which configures a container with selenium/standalone-chromium
.
Start the container:
docker-compose up -d
Usage is provided under the MIT License.