Skip to main content

Cypress.currentRetry

Cypress.currentRetry is a number representing the current test retry count.

caution

Note that Cypress.currentRetry may only be used inside tests and test hooks, and will be null outside of tests and test hooks.

Syntax​

Cypress.currentRetry

Examples​

Get current test retry​

it('example', () => {
expect(Cypress.currentRetry).to.eq(0)
})

History​

VersionChanges
12.3.0Added Cypress.currentRetry