QA-PW-115 — Shared page object across tests
Generated from the rule registry. Get the same detail from the CLI with
mjolnir explain QA-PW-115.
| Field | Value |
|---|---|
| Severity | warning |
| Confidence | medium |
| Tier | quarantine |
| Measured FP rate | 56% (n=16) |
| Evidence level | E1 |
| QA impact | Flaky-test risk (FLAKY-RISK) |
| False-positive risk (author estimate) | medium |
| Autofix available | no |
| Languages | typescript, javascript |
| Frameworks | playwright |
| Detection strategy | LEXICAL |
| Introduced in | v0.3.0 |
Why this fails in production
Parallel workers share module scope: one test navigating or closing the page corrupts every other test's session, producing order-dependent flakes.
What gets flagged (real detector output)
Module-level `let page` — browser state shared across tests.Example from this rule's own must-fire fixture: tests/fixtures/QA-PW-115/must-fire/shared-page.spec.ts
The fix
Take page as a test function parameter (Playwright creates an isolated one per test), or use fixtures.
Confirmed NOT to fire on the corresponding clean pattern
Verified against tests/fixtures/QA-PW-115/must-not-fire/isolated-page.spec.ts — 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):
| Repo | Occurrences |
|---|---|
| appsmithorg-appsmith | 1 |
| grafana-grafana | 1 |
| negative-fixtures | 1 |
| nocodb-nocodb | 2 |
| positive-fixtures | 6 |
| vercel-next-js | 2 |
| vitest-dev-vitest | 1 |
| withastro-astro | 3 |