Skip to content

QA-JV-104 — Browser state shared across tests ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-JV-104.

FieldValue
Severitywarning
Confidencemedium
Tierextended
Measured FP rate20% (n=10)
Evidence levelE1
QA impactFlaky-test risk (FLAKY-RISK)
False-positive risk (author estimate)medium
Autofix availableno
Languagesjava
Frameworksjunit, testng
Detection strategyLEXICAL
Introduced inv0.4.0

Why this fails in production ​

A shared Page/Browser leaks cookies, localStorage, and navigation state between tests — failures become order-dependent and impossible to reproduce in isolation.

What gets flagged (real detector output) ​

Static `
    private static Page` — browser state shared across tests.

Example from this rule's own must-fire fixture: tests/fixtures/QA-JV-104/must-fire/SearchTest.java

The fix ​

Create the Page per test (@BeforeEach) or use Playwright's JUnit extension @InjectPage.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-JV-104/must-not-fire/SearchTest.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
microsoft-playwright-java2
positive-fixtures8

Released under the MIT License.