You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Describe the solution you'd like
Two possible solutions jump to mind:
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).
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.
The text was updated successfully, but these errors were encountered:
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.
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
cypress-plugin-snapshots/src/utils/snapshotTitles.js
Lines 3 to 4 in cf07698
Describe the solution you'd like
Two possible solutions jump to mind:
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).
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.
The text was updated successfully, but these errors were encountered: