the-internet-tests

Python Playwright stack

Pytest + Playwright coverage for the shared scenario catalog. This stack covers the Python P0 UI suite, selected P1 data-modeling coverage, and Chromium-only HTTP/resource checks.

Prerequisites

Install

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m playwright install --with-deps chromium

Run locally

Start the demo app from the repository root:

docker compose -f docker/compose.yml up -d website

Run the smoke scenario:

THE_INTERNET_BASE_URL=http://localhost:7080 pytest -m smoke --browser chromium

Run the HTTP/resource slice:

THE_INTERNET_BASE_URL=http://localhost:7080 pytest -m http --browser chromium

Run static checks:

ruff check .
ruff format --check .
mypy src tests

Stop the demo app when finished:

docker compose -f docker/compose.yml down

Browser projects

The pytest-playwright plugin supplies Chromium, Firefox, WebKit, branded browser channels, and device emulation through CLI flags. CI keeps the Python gate definition aligned with the TypeScript Playwright stack: Chromium smoke in the fast PR gate, Chromium/Firefox/WebKit plus mobile-emulation slices in the path-filtered full gate, and branded Chrome/Edge plus full mobile slices nightly.

Current selected P1 coverage

Reports

Local runs write Playwright failure artifacts to test-results/. CI stages the same outputs under artifacts/py/<run-id>/<slice>/test-results/ and writes pytest JUnit XML beside them.