Python Template QE Pipeline
Minimal pytest + Playwright template for Python QE pipelines. Use this repo as a starting point for browser-based tests with Playwright and pytest.
-
Create and activate a virtual environment:
- Windows (cmd.exe):
python -m venv .venv .venv\Scripts\activate
- Windows (cmd.exe):
-
Install dependencies:
pip install -r requirements.txtIf
requirements.txtis not present, add one containing at leastplaywrightandpytest. -
Install Playwright browser binaries:
playwright install -
Run tests:
pytest -q
- README.md
- LICENSE
- requirements.txt (or pyproject.toml)
- conftest.py
- tests/
- test_*.py
Put shared fixtures in conftest.py and test files under tests/ named test_*.py.
Create tests/test_example.py with a small, focused test that uses Playwright fixtures. Keep examples minimal and explicit about required setup (e.g., playwright browsers installed).
- If tests show no browser or fail to launch, run
playwright install. - Ensure your venv is active and dependencies are installed.
- Use environment variables for secrets; never hardcode keys in tests or CI.
This repository is intended as a lightweight template. If you'd like, I can add a minimal tests/test_example.py and a requirements.txt that includes pytest and playwright. If you want CI integration (GitHub Actions), I can propose a small workflow that installs dependencies and runs playwright install before pytest.