-
Notifications
You must be signed in to change notification settings - Fork 20
retry afterEach #7
Comments
@lukeapage I have only ever used an You could try proxying the describe.only('some suite', () => {
const itWithTest = (fn) => (...args) => {
it(args[0], () => {
args[1]()
fn()
})
}
const it_ = itWithTest(() => {
expect('foo').ok
})
it_('can test', () => {
expect(true).ok
})
it_('can test 2', () => {
expect(true).ok
})
}) but then you'll lose calls to |
Thanks for the work-around!
|
@lukeapage sounds like a good solution. I would also recommend putting a Cypress.log in there like so, to quickly identify where a failure is. fn()
Cypress.log({type:'afterEach'})`
afterEachCode() |
Would love to get more info on how to implement this? |
afterEach hooks are retried as part of test retries added in Cypress 5.0. https://docs.cypress.io/guides/references/migration-guide.html#Tests-retries |
Thanks for the plugin - a great step forward - it seems overall to work for us, except.. we have some assertions in afterEach which cause failures.. and we want to retry.
Are there any plans to add support for this? Or any ideas to always run an assertion on every test other than calling a custom command in every it() ?
The text was updated successfully, but these errors were encountered: