Cypress / Quiz
The Command Queue Conspiracy
Cypress commands look like promises, act like a queue, and punish anyone who treats them as either. Prove you know what actually runs when.
- Difficulty
- Medium
- Format
- Quiz
- Points
- 150
- Estimate
- 10 min
// MISSION BRIEF
Your Mission
Half of all confusing Cypress failures trace back to one misunderstanding: commands do not run when you write them. They enqueue, then execute serially, with queries retrying and actions firing once.
Seven questions on the queue, retry-ability, and the .then/.should split. Speed bonus active: quick, correct answers earn extra points.
// FIRST CONTACT
Battle teaser
A teammate writes `const btn = cy.get('#save')` and calls `btn.click()` several lines later. Why is this an anti-pattern?
- Acy.get returns a chainable that only enqueues a command; the variable never holds a DOM element, and reusing it detaches the click from queue order and retry semantics
- Bconst is wrong; using let would make it work
- Ccy.get is async, so the code just needs an await in front
- DIt works fine as long as both lines are in the same test
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
cypressjavascripte2e-testingweb