Skip to content

[BUG] snapshot updating causes failures for all tries except the last #9760

@abierbaum

Description

@abierbaum

Context:

  • Playwright Version: 16.1
  • Operating System: Linux
  • Node.js version: 14
  • Browser: Chromium

Reproduction

Configure playwright to have 2 or more retries. Then run any tests that use screenshot snapshots. Run playwright using --update-snapshots flag. Notice that the first N-1 runs will have failures even though you have marked to update the snapshots. It will only update and pass the last try.

Describe the bug

I think this PR broke the normal behavior of snapshot updating on the CLI using --update-snapshots. (#9246)

I think the desired logic is something more like:

testInfo.config.updateSnapshots ? true :  testInfo.retry < testInfo.project.retries ? 'none' : testInfo.config.updateSnapshots,

Basically some type of logic to detect the case when the user has explicitly said to update the snapshots and thus we should do that instead of 'none' for all the tries.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions