1.0.1 • Published 11 months ago

cypress-skip-this-test v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

cypress-skip-this-test

Skips the current test if it depends on the previous failed test

Install

$ npm i -D cypress-skip-this-test
# or using Yarn
$ yarn add -D cypress-skip-this-test

Import the in the specs with tests that depend on each other

import { skipIfPreviousTestsFailed } from 'cypress-skip-this-test'

describe('Parent suite', () => {
  // second test fails on purpose
  // and the third test should skip
  beforeEach(skipIfPreviousTestsFailed)

  it('test 1', () => {})

  it('test 2', () => {
    throw new Error('fail on purpose')
  })

  it('test 3', () => {})
})

The "test 3" will be skipped when the test "test 2" fails. If all tests in the parent suite before "test 3" pass successfully, then the test will run.

Small print

Author: Gleb Bahmutov <gleb.bahmutov@gmail.com> © 2024

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

1.0.1

11 months ago

1.0.0

11 months ago