Documentation based on: Installation | Playwright Python
# Create a virtual environment
python -m venv .venv
# Activate the virtual environment
source .venv/bin/activate[.csh|.fish]
# Install the required libraries
pip install -r requirements.txt
# Install the required browsers
playwright installCreate a .env file and fill in the following content:
E2E_USER1_EMAIL=...
E2E_USER1_PASSWORD=...
E2E_USER2_EMAIL=...
E2E_USER2_PASSWORD=...
Documentation based on: Running and debugging tests | Playwright Python
Run tests with the following command:
pytestTip
Each failing test has a trace, screenshots and videos located in the test-results/ directory.
The trace can be analyzed by running playwright show-trace test-results/<...>/trace.zip
Tests can also be executed with a step by step debugger with the following command:
PWDEBUG=1 pytest -sDocumentation based on: Generating tests | Playwright Python
To get help writing tests, try the interactive test generation:
playwright codegen --viewport-size "1600, 1000" inveniordm.web.cern.ch