Cypress / Scenario

The Stub That Never Fired

The fixture promised a Mega Deal, the UI showed an empty shelf, and the real staging API got hit 200 times overnight. Autopsy of an intercept that never matched.

Difficulty
Hard
Format
Scenario
Points
200
Estimate
14 min

// MISSION BRIEF

Your Mission

A deals-page spec stubs the products API with a fixture, yet CI screenshots show an empty page, and the staging backend logged real traffic from the test runner. Three separate mistakes are conspiring.

Read the spec and the network evidence, then take the shots: why the stub missed, what the matcher should be, and how to make a stub failure loud instead of silent. Decisions are weighted.

// FIRST CONTACT

Battle teaser

First artifact

deals.cy.ts (excerpt)

Why did the stub never apply? (Select all that apply.)

  1. ANothing ever cy.wait()s on the alias, so the test never even checks whether the stub fired
  2. BIt was registered AFTER cy.visit, and the app fired the request ~80ms into page load, before the route existed
  3. CFixtures cannot be used as intercept responses in Cypress 13
  4. DThe URL does not match: the app calls /api/v2/products with extra query params, and the exact-string matcher has no wiggle room
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

cypressnetwork-mockingdebuggingweb