Skip to content

QA-PW-115 — Shared page object across tests ​

← Back to the rule catalog

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

FieldValue
Severitywarning
Confidencemedium
Tierquarantine
Measured FP rate56% (n=16)
Evidence levelE1
QA impactFlaky-test risk (FLAKY-RISK)
False-positive risk (author estimate)medium
Autofix availableno
Languagestypescript, javascript
Frameworksplaywright
Detection strategyLEXICAL
Introduced inv0.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):

RepoOccurrences
appsmithorg-appsmith1
grafana-grafana1
negative-fixtures1
nocodb-nocodb2
positive-fixtures6
vercel-next-js2
vitest-dev-vitest1
withastro-astro3

Released under the MIT License.