Skip to content

stepTimeout

Set timeout for test steps globally.

Add this plugin to config file:

plugins: {
stepTimeout: {
enabled: true
}
}

Run tests with plugin enabled:

npx codeceptjs run --plugins stepTimeout
  • timeout - global step timeout, default 150 seconds

  • overrideStepLimits - whether to use timeouts set in plugin config to override step timeouts set in code with I.action(..., step.timeout(x)), default false

  • noTimeoutSteps - an array of steps with no timeout. Default:

    • amOnPage
    • wait*

    you could set your own noTimeoutSteps which would replace the default one.

  • customTimeoutSteps - an array of step actions with custom timeout. Use it to override or extend noTimeoutSteps. You can use step names or step prefixes ending with *. As such, wait* will match all steps starting with wait.

plugins: {
stepTimeout: {
enabled: true,
overrideStepLimits: true,
noTimeoutSteps: [
'scroll*', // ignore all scroll steps
/Cookie/, // ignore all steps with a Cookie in it (by regexp)
],
customTimeoutSteps: [
['myFlakyStep*', 1],
['scrollWhichRequiresTimeout', 5],
]
}
}
  • config