Python + Selenium + requests automation for the Sports Betting QA Assessment App.
- Python 3
- Selenium WebDriver (latest Chrome)
requestsfor API checks- pytest + Allure
SportsBetting/
├── api/
│ └── sports_betting_api.py # API client
├── locators/ # Page locators
├── pages/ # Base page helpers
├── upcoming_football_match_page_tests/
│ └── test_priority.py # Two high-value tests
├── conftest.py # Chrome + login fixtures
├── main.py # Page object + test journeys
├── config.py # Loads .env (BASE_URL, user_id)
├── requirements.txt
└── .env
- Install Python 3.10+.
- Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Create
.envin the project root:
BASE_URL=url-here
user_id=your-user-id-hereBoth values are required. config.py reads them from .env.
- Install Google Chrome (desktop) and Allure Commandline if you want HTML reports.
UI login URL:
{BASE_URL}/?user-id={user_id}
API auth header:
x-user-id: {user_id}
The user_login fixture:
- Calls
GET /api/balanceto verify API auth - Opens Chrome on the authenticated UI URL
source .venv/bin/activate
pytest -v --alluredir=allure-resultsRun a single test:
pytest upcoming_football_match_page_tests/test_priority.py::test_place_single_bet_successfully
pytest upcoming_football_match_page_tests/test_priority.py::test_api_rejects_stake_below_minimumpytest -v --alluredir=allure-results
allure serve allure-results- E2E UI — place a single pre-match bet (selection → stake → payout → receipt → API balance).
- API — reject stake below the €1.00 minimum (
422 invalid_stake_min) and keep balance unchanged.