Cypress / Quiz
Anti-Pattern Firing Range
Conditional DOM testing, cy.wait(5000), after-hook cleanup, chained tests: the official hall of shame, and what disciplined suites do instead.
- Difficulty
- Medium
- Format
- Quiz
- Points
- 150
- Estimate
- 10 min
// MISSION BRIEF
Your Mission
The Cypress docs keep a public list of best practices because the same seven mistakes sink suite after suite. This drill puts each anti-pattern in front of you and asks for the professional alternative.
Seven questions. Speed bonus active: quick, correct answers earn extra points.
// FIRST CONTACT
Battle teaser
cy.wait(5000) sprinkled before assertions is an anti-pattern because:
- AFixed sleeps are always wrong twice: too short on a slow day (flake) and too long on a fast day (waste); wait on a network alias or let assertions retry instead
- BIt is fine; the docs recommend it for slow pages
- Ccy.wait only accepts aliases, so it throws on numbers
- D5000ms exceeds the maximum allowed wait
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
cypressbest-practicese2e-testingweb