QA-PW-123 — Hardcoded environment URL in spec
Generated from the rule registry. Get the same detail from the CLI with
mjolnir explain QA-PW-123.
| Field | Value |
|---|---|
| Severity | warning |
| Confidence | high |
| Tier | quarantine |
| Measured FP rate | 46% (n=11) |
| Evidence level | E2 |
| QA impact | Test hygiene debt (HYGIENE) |
| False-positive risk (author estimate) | low |
| Autofix available | no |
| Languages | typescript, javascript |
| Frameworks | playwright |
| Detection strategy | LEXICAL |
| Introduced in | v0.3.0 |
Why this fails in production
Specs pointing at absolute URLs break when environments change and can hit production by accident.
What gets flagged (real detector output)
Hardcoded URL: `goto("https://prod.example.com/dashboard"`.Example from this rule's own must-fire fixture: tests/fixtures/QA-PW-123/must-fire/hardcoded.spec.ts
The fix
Use relative paths with baseURL from playwright.config, or an env variable.
Confirmed NOT to fire on the corresponding clean pattern
Verified against tests/fixtures/QA-PW-123/must-not-fire/clean.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 |
|---|---|
| cypress-io-kitchensink | 6 |
| nextauthjs-next-auth | 2 |
| playwright-community-eslint-plugin-playwright | 9 |
| positive-fixtures | 8 |
| puppeteer-puppeteer | 3 |
| vitest-dev-vitest | 1 |