Skip to content

attempt number is added to screenshot name, causing retries of failures to inappropriately succeed #168

Closed
@froodian

Description

@froodian

Describe the bug
Similar to meinaart/cypress-plugin-snapshots#217 (and the open pull that fixes it), cy.state('runnable')._currentRetry (as documented here) should be incorporated into the nameCacheCounter logic so that a retried test is not seen as a new test.

To Reproduce
Steps to reproduce the behavior:

  1. Have a test, with an accepted and committed baseline image
  2. Have retries enabled in the cypress config (docs)
  3. Change the code under test so that the test will go red
  4. Run the test

Expected behavior
Test should go red. Instead test goes red, then on retry it goes green because the plugin is generating an actual with #1.png in the name instead of #0.png and therefore treating it as a new test.

Screenshots
image

image

Please complete the following information:

  • Mac OS 12.6
  • Chrome 107
  • Cypress 10.8.0

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions