🕐 Time Travel & Retry-ability

Time Travel & Retry-ability: Cypress's most beloved feature is "time travel debugging": a DOM snapshot is stored in the background after every command.

Cypress's most beloved feature is "time travel debugging": a DOM snapshot is stored in the background after every command. Once a test finishes (or fails), you can click any past entry in the Command Log to see exactly how the app looked AT THAT MOMENT — no need to re-run the test or open a debugger.

Cypress Time Travel — Live Demo

▶ Click Run and watch the test execute step by step. Once it finishes, click any PAST command on the left — the screen on the right will show the DOM exactly as it was then. This is a debugging superpower that simply does not exist in Selenium.

🎬 A Snapshot After Every Command: Time Travel Debugging

Selenium: The Moment You Never Captured

A test consists of 3 commands. In Selenium these commands run and are gone, only the final state remains. In Cypress, EVERY command runs an invisible "camera" behind it. In this film you will watch that camera at work.

Step 1 — the moment cy.visit() runs, Cypress takes a COMPLETE snapshot of the DOM at that instant and attaches it to this line in the Command Log. This happens automatically, without you asking for it.

Step 2 — cy.get().type() and cy.get().click() do the same: each adds its own snapshot to the store. Now there are 3 separate "time capsules" for 3 commands.

Step 3 — AFTER the test finishes (or fails), you click the 2nd command (type) in the Command Log. Cypress does NOT re-run the test — it directly restores that exact snapshot from the store to the screen.

Contrast scene — Selenium has no such "go back in time" feature: to see the DOM state at that moment, you would have had to add a driver.getScreenshotAs(...) call in advance, while WRITING the test. If the test breaks somewhere you didn't anticipate, the evidence of that moment is lost FOREVER.

The takeaway: this is why, instead of combing through logs for hours when a Cypress test fails in CI, you can see exactly what an element showed at exactly which command with a single click — this is the feature that turns flaky-test analysis into a matter of minutes.

Write It Yourself: A Retry-able Assertion Instead of cy.wait(number)

Complete the TODO line with a cy.get(...).should(...) chain that waits for the counter text to be "3".

Selenium — Explicit Wait