Skip to content

QA-PY-105 — Playwright test without assertions ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-PY-105.

FieldValue
Severityerror
Confidencehigh
Tierquarantine
Measured FP rate0% (n=12)
Evidence levelE2
QA impactFalse-green risk (FALSE-GREEN)
False-positive risk (author estimate)low
Autofix availableno
Languagespython
Frameworkspytest-playwright, playwright
Detection strategyLEXICAL (regex heuristic)
Introduced inv0.3.8

Why this fails in production ​

A Playwright-Python test with no assertion behaves identically to QA-TEST-003/QA-PY-003 in the underlying failure mode — the test can drive a real browser through every step of a user flow and still verify nothing, because nothing in the test ever calls expect(). It is tracked as its own rule because Playwright-Python specs commonly LOOK thorough (multiple page interactions, network waits, screenshots) while containing zero verification — the activity is real, the checking is not.

What gets flagged (real detector output) ​

Playwright test `test_checkout_flow` drives the UI but asserts nothing.

Example from this rule's own must-fire fixture: tests/fixtures/QA-PY-105/must-fire/test_checkout.py

The fix ​

Add outcome assertions: expect(page).to_have_url(...), expect(page.get_by_role('heading')).to_be_visible().

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-PY-105/must-not-fire/helper-verification.py — a legitimate, similar-looking pattern this rule correctly leaves alone.

Corpus-measured false-positive risk ​

Real occurrence counts from npm run corpus:audit against actively-maintained OSS repos — reproduce yourself, don't just trust this table (see the false-positive audit):

RepoOccurrences
positive-fixtures12

Released under the MIT License.