Skip to content

QA-PW-102 — Load-event wait instead of web-first assertion ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-PW-102.

FieldValue
Severitywarning
Confidencehigh
Tierquarantine
Measured FP rate10% (n=10)
Evidence levelE2
QA impactTest hygiene debt (HYGIENE)
False-positive risk (author estimate)medium
Autofix availableno
Languagestypescript, javascript
Frameworksplaywright
Detection strategyLEXICAL
Introduced inv0.3.0

Why this fails in production ​

'load' fires when the page loads, not when YOUR element is ready — the test can still race the app and fail intermittently.

What gets flagged (real detector output) ​

`waitForLoadState("load"` instead of a web-first assertion.

Example from this rule's own must-fire fixture: tests/fixtures/QA-PW-102/must-fire/load-waits.spec.ts

The fix ​

Assert on the element you actually care about: await expect(page.getByRole('heading')).toBeVisible().

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-PW-102/must-not-fire/LoadStateTest.java — 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
playwright-community-eslint-plugin-playwright1
positive-fixtures3

Released under the MIT License.