1.0.3 • Published 7 months ago

cy-retryable-before v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

cy-retryable-before

A before hook alternative for Cypress that gets run when a failing test is retried.

By default cypress before hook isn't run when a test below it fails and is retried. Because we use before() as a place to setup state before running assertions inside it() this means we can't make use of cypress retry functionality to make our suites more reliable.

retryableBefore is a workaround for this issue.

Usage

Install, import and replace the default before hook with retryableBefore in your Cypress test file.

npm i -D cy-retryable-before
yarn add -D cy-retryable-before
pnpm i -D cy-retryable-before
import { retryableBefore } from 'cy-retryable-before'

describe('CRUD movie', () => {
  // just replace `before` with `retryableBefore`
  retryableBefore(() => {
    // ...
  })

  it('should', () => {
    // ...
  })
})

Demo

See demo video.

1.0.3

7 months ago

1.0.2

7 months ago

1.0.0

7 months ago