I am using cypress 5.0 in JS project. When I try to run npx cypress open
keep getting error verification timed out after 30000 milliseconds
.
Node version: v12.18.2 OS: Windows 7 Cypress : 5.0.0
I have downgraded to Cypress 4.0.0 and downgraded my node too. But keep getting the error. Please find the screenshot below. 2
Developers may opt to manually address flaky tests caused by timeout errors by pursuing one or a combination of the following: Use the Cypress intercept and aliasing commands to require Cypress to wait on your asynchronous operations to complete before running the next command or assertion.
cypress verify Verify that Cypress is installed correctly and is executable. Note that the cypress verify command is executed as part of the cypress open and cypress run commands.
I had a similar issue and I used the npx cypress verify
to carry out the verification
This issue is not related to Cypress version. To resolve it, you need to increase the default timeout.
Open node_modules\cypress\lib\tasks\verify.js
, search for VERIFY_TEST_RUNNER_TIMEOUT_MS
and change it from 30000
(default) to 100000
.
Save the file, then try to open the runner.
Retrying launching Cypress
one more time worked out with the error being gone, hmm...
From Cypress version 9.2.0
, you no longer have to change the timeout value in node_modules\cypress\lib\tasks\verify.js
file manually.
Instead, you can utilize an environment variable called CYPRESS_VERIFY_TIMEOUT
"to override the timeout duration of the verify command". Here is the link to the documentation about cypress verify
command that mentions it.
Even better, starting from version 9.3.0
, we can set the environment variable in a project's package.json or .npmrc (or .yarnrc) file.
Using this environment variable to increase the timeout (3 minutes for us) was necessary for us to ensure stability in our CI testing pipeline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With