A robust end-to-end testing setup that exercises Chrome, Firefox, and Microsoft Edge using headless browsers and Selenium Grid in Docker Compose.
Includes rich test reporting powered by Allure.
For detailed implementation insights, check out my blog post.
This framework generates comprehensive Allure reports:
Reports are automatically published to GitHub Pages: Latest test results.
Launch the Allure server and Selenium Grid:
docker compose up -d
The Allure reports will be available at http://localhost:8800
, and the Selenium Grid console at http://localhost:4444/ui/
.
The Selenium Grid is started automatically by the tests (see setup_selenium_grid()
in conftest.py
), but manually launching it in the background with docker compose
makes tests faster since they don't need to start and stop the Grid for each test run.
When using Selenium Grid across multiple projects, you may encounter port conflicts:
Bind for 0.0.0.0:4442 failed: port is already allocated
This happens if the Selenium Grid is already running.
In such cases, start Docker Compose without Selenium Grid:
docker compose up -d --scale hub=0
-
Install dependencies:
. ./activate.sh
-
Run tests and generate reports:
scripts/test.sh
Tests store results in the allure-results
folder, which is mounted to the Allure reporter Docker container.
Tests run in parallel across Chrome, Firefox, and Microsoft Edge via the session-scoped pytest fixture browser
.
The framework supports testing any web application via the --host
parameter. For example:
scripts/test.sh --host=https://google.com
The --host
parameter is implemented using pytest's hook pytest_addoption in conftest.py
.
Note: The Google example above will fail because it expects to find the word "Python" on the main page.