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
- A page that renders a login wall or consent banner instead of content, while returning HTTP 200
- Title or key text changed in a deploy, with no check catching it
- A form removed or renamed, found by a customer first
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
- 2026-11-19: test suite run from a clean shell, 4 passed
- Tests cover the pass case with no screenshot written, the failure case with a non-empty screenshot file created, a title mismatch, and CLI exit codes both ways, all against the local fixture
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.