Skip to content

Screenshot (failed) captured during skipped tests #17660

@jennifer-shehane

Description

@jennifer-shehane

Current behavior

In some circumstances invovling skipped tests and the Cypress 'fail' event listener a failure screenshot will be taken when it shouldn't be.

Desired behavior

  1. A failure screenshot should never be taken when the test is skipped.
  2. The fail event handler shouldn't be triggered during skipped tests.

Test code to reproduce

spec.js

Cypress.on('fail', () => {
  throw new Error('error')
})

describe('tests', () => {
  before(function () {
    this.skip()
  })
  it('failing test', () => {
    expect(true).to.be.false
  })
})

Screen Shot 2021-08-09 at 2 14 45 PM

Cypress Version

8.2.0

Other

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions