Local Browser QA Kit - Playwright Tests for Digital Products
Plainwork Studio, version 1.0.0

A reusable pytest + Playwright test suite that checks web pages on your own computer: navigation, links,
forms, mobile layouts, screenshots, console errors, downloads, accessibility basics and page weight.
It runs against local pages and local dev servers only and refuses every other address.

QUICK START (copy and paste into a terminal opened in this folder)

  python -m venv .venv
  source .venv/bin/activate            (Windows: .venv\Scripts\activate)
  python -m pip install -r requirements.txt
  python -m playwright install chromium
  python -m pytest

That serves the bundled sample_site/ and runs all 307 tests. A report is written to reports/qa-report.json
and reports/qa-report.md. The first run also creates screenshot baselines in baselines/.

TEST YOUR OWN SITE

  python -m pytest --qa-site ../my-site                      (a folder of HTML files)
  python -m pytest --qa-url http://localhost:5173            (a dev server that is already running)
  python -m pytest --qa-config qa.config.json                (your pages, viewports and budgets)

Copy qa.config.example.json to qa.config.json and edit it.

WHAT IS INSIDE

  conftest.py            pytest options, fixtures and the report writer
  helpers/               8 reusable modules: config, server, browser, crawl, a11y, layout, downloads, report
  tests/                 16 test modules (navigation, links, forms, keyboard, mobile layout, images, screenshots,
                         console and network, downloads, accessibility labels and contrast, page weight, page
                         structure, interactions, detector self-checks, helper unit tests)
  sample_site/           a small clean website to test and learn from (4 pages, 404 page, images, downloads)
  sample_site_defects/   a page with planted defects; the kit proves that every detector finds them
  testdata/              form inputs and expected downloads used by the tests
  schema/                qa-report.schema.json, the format of the JSON report
  docs/GUIDE.md          full guide: options, settings, every test module, writing your own tests
  qa.config.example.json every setting with its default value
  requirements.txt       pinned playwright and pytest; Pillow and pypdf are optional
  LICENSE.txt            what you may do with this kit

That is 25 Python files: conftest.py, 8 helper modules and 16 test modules.

REQUIREMENTS
  Python 3.10 or newer. Playwright downloads its own Chromium (python -m playwright install chromium).
  Nothing is sent over the network; the tests only visit pages on this computer.

LIMITS
  The accessibility checks cover common basics, not a full audit. Contrast is computed from CSS colours and skips
  text on images. Screenshot baselines depend on the fonts of the computer that created them.
