Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 743 Bytes

File metadata and controls

17 lines (12 loc) · 743 Bytes

Test timeout

The example shows how to stop a test if it takes too long to execute, similar to Mocha's timeout option. The timeout function is in cypress/integration/timeout.js.

You can set timeout inside the test only, see cypress/integration/spec.js

// this test fails after two seconds due to timeout
it('does not finish long tests', () => {
  testTimeout(2 * 1000)
  cy.wait(10 * 1000)
})

Test is too long

You can set global timeout that applies to every test, see cypress/integration/all-tests-spec.js using Cypress.on('test:before:run' ... event