Skip to content

QA-PW-140 — Screenshot without maxDiffPixelRatio ​

← Back to the rule catalog

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

FieldValue
Severitywarning
Confidencemedium
Tierextended
Measured FP rate0% (n=10)
Evidence levelE1
QA impactTest hygiene debt (HYGIENE)
False-positive risk (author estimate)medium
Autofix availableno
Languagestypescript, javascript
Frameworksplaywright
Detection strategyLEXICAL
Introduced inv0.3.0

Why this fails in production ​

Pixel-exact snapshots flake on font rasterization and GPU differences between machines, training the team to ignore red builds.

What gets flagged (real detector output) ​

`toHaveScreenshot` without a diff tolerance (maxDiffPixelRatio/maxDiffPixels).

Example from this rule's own must-fire fixture: tests/fixtures/QA-PW-140/must-fire/example.must-fire.ts

The fix ​

Pass { maxDiffPixelRatio: 0.02 } (or maxDiffPixels) so only meaningful visual regressions fail.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-PW-140/must-not-fire/example.must-not-fire.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
positive-fixtures10

Released under the MIT License.