Skip to content

QA-CS-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-CS-104.

FieldValue
Severitywarning
Confidencemedium
Tierextended
Measured FP rate0% (n=10)
Evidence levelE1
QA impactFlaky-test risk (FLAKY-RISK)
False-positive risk (author estimate)medium
Autofix availableno
Languagescsharp
Frameworksnunit, xunit, mstest, playwright
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 IPage` — browser state shared across tests.

Example from this rule's own must-fire fixture: tests/fixtures/QA-CS-104/must-fire/SearchTests.cs

The fix ​

Create the page per test in setup, or use Playwright.NET's per-test fixtures.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-CS-104/must-not-fire/SearchTests.cs — 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-fixtures4

Released under the MIT License.