Skip to content

fix: restore screenshot counters correctly on test retry - #415

Merged
FRSgit merged 1 commit into
feat/major-5from
fix/retry-screenshot-numbering
Sep 21, 2026
Merged

FRSgit merged 1 commit into
feat/major-5from
fix/retry-screenshot-numbering

Conversation

@FRSgit

@FRSgit FRSgit commented Sep 21, 2026

Copy link
Copy Markdown
Member

The retry handling in generateScreenshotPath only remembered the last screenshot path handed out during the previous attempt. So a retried test that took screenshots under a couple of titles (or several under the same title) ended up with different _#n names than the attempt that failed, which then produced fresh baselines instead of comparing against the right ones.

It also had no way to tell "retry of this test" apart from "next test that happens to start at retry 0", and could rewind counters that belonged to earlier tests.

This tracks the counters as they were before the current attempt for every path the attempt touched, keyed by a stable test id (cy.state('test').id, with a spec + title fallback), and restores all of them when the same test retries. Added a test file for the path generator covering the cases above.

馃 Generated with Claude Code

The retry handling in generateScreenshotPath only remembered the last
screenshot path handed out during the previous attempt, so a retried test
that took screenshots under several titles (or several of the same title)
got different `_#n` names than the attempt that failed. It also could not
tell a retry apart from the next test starting at retry 0, and rewound
counters that belonged to earlier tests.

Track the counters as they were before the current attempt for every path
the attempt touched, keyed by a stable test id passed from the command, and
restore all of them when the same test retries.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@FRSgit
FRSgit merged commit 0e10726 into feat/major-5 Sep 21, 2026
@FRSgit
FRSgit deleted the fix/retry-screenshot-numbering branch September 21, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant