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

(feat) make compatible with cypress-plugin-retries #127

Open
gnicol opened this issue Jun 26, 2020 · 2 comments
Open

(feat) make compatible with cypress-plugin-retries #127

gnicol opened this issue Jun 26, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@gnicol
Copy link

gnicol commented Jun 26, 2020

Is your feature request related to a problem? Please describe.
Rarely, I have a test failure (not due to your great plugin!) and using cypress-plugin-retries would be helpful (though I realize not best practice).

Presently, I cannot use that as the incrementing SNAPSHOTS_TEXT/SNAPSHOTS_IMAGE will continue to increment on re-runs of a given test causing the asserts to not line up.

Code located here

const SNAPSHOTS_TEXT = {}
const SNAPSHOTS_IMAGE = {};

Describe the solution you'd like
Two possible solutions jump to mind:

  1. Allow count to be reset
    I was wondering if you could expose a resetCount() method in the snapshotTitles.js that simply blanks the SNAPSHOTS_TEXT/SNAPSHOTS_IMAGE entry for the active test?
    Then I could call that in my beforeEach to ensure retries worked (assuming the test name is correctly identifiable in beforeEach).

  2. Allow full snapshot title to be specified
    I considered setting a more hard-coded snapshot name on each call so they would align during retries. But at present, I seem unable to exclude the count
    const snapshotTitle = `${testTitle} #${snapshots[testTitle]}`;
    If it was possible to specify a title template, or to specify the desired title with a flag to indicate it ought to be used verbatim; retries would line up and that would work as well.

Describe alternatives you've considered
Forking, and likely just going the drop count from title approach. But I'd very much prefer not to :(

Additional context
Highly open to other approaches/ideas though! Given some direction I'd try to push up a PR as well if that helped.

@gnicol gnicol added the enhancement New feature or request label Jun 26, 2020
@azuruce
Copy link

azuruce commented Aug 10, 2020

yes, I had a problem as our test sometimes failed and we want to retry. It could be failed for variety of reasons such as a dependency service has slightly flakiness or database lock contention.

@kuceb
Copy link

kuceb commented Aug 20, 2020

see #141 for support for native test retries in 5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants