Skip to content

QA-CYP-001 — Fixed cy.wait(n) hard-coded wait ​

← Back to the rule catalog

Generated from the rule registry. Get the same detail from the CLI with mjolnir explain QA-CYP-001.

FieldValue
Severitywarning
Confidencehigh
Tierextended
Measured FP rate20% (n=15)
Evidence levelE2
QA impactFlaky-test risk (FLAKY-RISK)
False-positive risk (author estimate)medium
Autofix availableno
Languagestypescript, javascript
Frameworkscypress
Detection strategyLEXICAL (cy.wait with a numeric-literal argument only — alias waits (cy.wait('@…')) are the legitimate routed-request form and never fire)
Introduced inv0.6.0

Why this fails in production ​

A fixed cy.wait(n) pauses for the full duration no matter what — it is either too short (flaky) or too long (slow), and it cannot adapt to the app.

What gets flagged (real detector output) ​

`cy.wait(3000)` — fixed hard-coded wait.

Example from this rule's own must-fire fixture: tests/fixtures/QA-CYP-001/must-fire/checkout.cy.js

The fix ​

Wait on the real condition: cy.wait('@alias') for a routed request, cy.intercept + assertions on the response, or cy.contains(...).should(...) retry semantics.

Confirmed NOT to fire on the corresponding clean pattern ​

Verified against tests/fixtures/QA-CYP-001/must-not-fire/checkout.cy.js — 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
cypress-io-kitchensink15

Released under the MIT License.