SeleniumPythonFunctional/
│── tests/
│ ├── test_checkout.py # Selenium checkout test
│ ├── test_login.py # Selenium login test
│── conftest.py # Selenium browser setup
│── pytest.ini # pytest configuration
│── requirements.txt # Dependencies
│── allure-results/ # Allure test results
│── README.md # Project documentationBefore running the tests, ensure you have the following installed:
- Python (>=3.7)
- Google Chrome, Firefox, Edge, or Safari (Selenium 4 includes a built-in browser, so no additional setup is needed)
- Selenium & Allure dependencies, refer to https://allurereport.org/docs/install-for-windows
pip install pytest selenium allure-pytestor
pip install -r requirements.txtpytest .\tests\test_login.py --alluredir=allure-resultsRun tests that match a keyword:
pytest -k "login" --alluredir=allure-results👉 This runs tests like test_checkout_process.
pytest --browser-type=firefox --alluredir=allure-results👉 Supports chromium, firefox, edge, and safari.
pytest --headless --alluredir=allure-resultsAfter running tests, generate and open the report:
allure serve allure-resultsThis launches a web-based report.
| Command | Description |
|---|---|
--headed |
Run in visible mode |
--headless |
Run in headless mode |
Example running in visible mode:
pytest --headed --browser-type=edge --alluredir=allure-resultsSelenium.Python.Functional.UI.mp4
This guide helps you quickly set up, run, and analyze Selenium UI tests with Allure reports. 🚀