Playwright / Scenario
Boss Fight: The Suite of a Thousand Sleeps
An inherited spec file with every sin in the book: shared login state, sleeps, positional XPath, one-shot assertions, and serial coupling. Plan the demolition.
- Difficulty
- Boss
- Format
- Scenario
- Points
- 300
- Estimate
- 20 min
// MISSION BRIEF
Your Mission
You inherited legacy-checkout.spec.ts, the most-hated file in the repo: 14 minutes of runtime, weekly false alarms, and a comment that says "DO NOT REORDER TESTS". Leadership has given you one sprint to civilize it.
This is the boss fight: identify every anti-pattern, sequence the rescue correctly, and dodge the tempting non-fixes. Decisions carry heavy weights, and partial credit is scarce.
// FIRST CONTACT
Battle teaser
First artifact
legacy-checkout.spec.ts (abridged, sins intact)
Roll call: which anti-patterns are actually present in this file? (Select all that apply.)
- AOrder-coupled tests smuggling state (savedCookies, serial mode, server-side cart)
- BOne-shot ElementHandle reads ($, textContent) instead of retrying web-first assertions
- CStructure-encoding positional XPath locators
- DFixed sleeps standing in for conditions (waitForTimeout x5)
// SKILL TAGS