This project contains UI and API tests for the DemoQA QA training platform. Tests are written with Pytest and use Playwright for browser automation and API requests.
- Clone this repository.
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate
- Install dependencies and Playwright browsers:
pip install -r requirements.txt playwright install --with-deps
- Copy
.env.example
to.env
and adjust theDOMAIN
variable if needed.
To run all tests use pytest
:
pytest
You can run specific test types using markers:
pytest -m ui # run UI tests only
pytest -m api # run API tests only
The provided Makefile
offers shortcuts:
make install # install dependencies
make test # run tests and generate reports
After running make test
reports are stored in the reports
directory (HTML under reports/html
and JUnit XML under reports/xml
).
A Dockerfile
is available to execute the tests inside a container:
docker build -t playwright-tests .
docker run --rm playwright-tests