Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots during retries cause errors #13

Closed
JackCA opened this issue Nov 22, 2021 · 4 comments
Closed

Snapshots during retries cause errors #13

JackCA opened this issue Nov 22, 2021 · 4 comments

Comments

@JackCA
Copy link

JackCA commented Nov 22, 2021

The problem

playwright supports retries but when a snapshot is taken in a retry, we get an error:

Error: The name of each snapshot must be unique, and this name already exists in the build: 'foo' -- You can fix this by passing a 'name' param when creating the snapshot. See the docs for more info on identifying snapshots for your specific client: https://percy.io/docs

Environment

  • Node version:
  • @percy/cli version: 1.0.0-beta.70
  • Version of Percy SDK you’re using: percy/playwright 1.0.1
  • If needed, a build or snapshot ID: n/a
  • OS version: n/a
  • Type of shell command-line [interface]: n/a

Details

It looks like there is work that was merged into core related to this but I don't think the sdk supports using this functionality?

Other related discussions:

Code to reproduce issue

in playwright.config add retries: 2

in a test.spec.ts:

test('foo', async (page) => {
  snapshot(page, 'foo')
 throw new Error('run retry')
})
@unlikelyzero
Copy link

@JackCA I think you should consider creating a separate visual testing profile with retries disabled. I've been doing visual testing for 3 years and now create multiple e2e profiles: one for CI and one for Visual Tests

@JackCA
Copy link
Author

JackCA commented Nov 23, 2021

@JackCA I think you should consider creating a separate visual testing profile with retries disabled. I've been doing visual testing for 3 years and now create multiple e2e profiles: one for CI and one for Visual Tests

Definitely agree with you there -- I'm doing my best to prevent even needing retries. However, I still think this would be a valuable feature and think the opportunity is there because of the upstream changes made to core.

@Robdel12
Copy link
Contributor

Robdel12 commented Dec 2, 2021

Hey @JackCA! Going to close this out since the CLI ticket you linked to is the right place to track it. We'll be shipping retry support after 1.x in early 2022.

@Robdel12 Robdel12 closed this as completed Dec 2, 2021
@JackCA
Copy link
Author

JackCA commented Dec 2, 2021

great, thanks @Robdel12

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

No branches or pull requests

3 participants