Chris Butcher, Python automation

Playwright smoke-test harness

The problem

A web app needs a fast check before release: the page loads, the title is right, the key text is present, and the form exists. When something is off, a screenshot of the page as found settles the argument.

The artefact

A reusable harness that opens a page and checks three things from a JSON config file: the title contains expected text, key texts are present, and a form exists. When any check fails it saves a screenshot and exits 1, so a deploy script or cron run can gate on it. The artefact README, config example, and source are copied under files on this page.

Input and output sample

Input config:

{
  "url": "fixture.html",
  "title_contains": "Fixture Landing",
  "texts": ["Welcome to the fixture", "Sign up for updates"],
  "require_form": true,
  "screenshot_dir": "screenshots"
}

Output, passing run:

PASS title_contains: expected 'Fixture Landing', got 'Fixture Landing Page'
PASS text_present: expected 'Welcome to the fixture', got 'found'
PASS text_present: expected 'Sign up for updates', got 'found'
PASS form_present: expected '>= 1 form', got '1 form(s)'
smoke test passed

A failing run prints FAIL lines, saves screenshots/failure-<time>.png, and exits 1.

What can break

The fix or design choice

Checks come from a config file, so the same harness runs against any page by changing the URL, expected title text, key texts, and the form flag. Screenshot on failure is verified by file existence and non-zero size in the tests, so the failure evidence is real, not assumed.

Verification log

Verified 2026-11-19

Files

Price shape

Docs and QA from $400 fixed. The first deliverable is the harness pointed at your pages with the checks named in writing.

Start here

Email the page URL and the three things that must be true on it. I reply with the fixed quote and the check list.