Ragavan Rajan
Ragavan Rajan

Reputation: 4397

Cypress verification timed out after 30000 milliseconds

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

enter image description here

Upvotes: 72

Views: 61109

Answers (15)

madhuri varada
madhuri varada

Reputation: 93

Add the default command timeout in the cypress.config.js file

cypress.config.js file

defaultCommandTimeout : 10000,

Add the timeout for the command like this

cy.get('.class',{timeout:1000}).should('be.visible')

Upvotes: -1

Hemjal
Hemjal

Reputation: 300

I fixed the problem by restarting the vs code and run again. WSL2

Upvotes: 0

Ukpai Chukwuemeka
Ukpai Chukwuemeka

Reputation: 799

I had a similar issue and I used the npx cypress verify to carry out the verification.

This happens because there's a verification that's meant to happen for first-time users but for some reason, the verification process times out.so one way to make the verification work is by using the npx cypress verify package.

Upvotes: 86

Jelle Hak
Jelle Hak

Reputation: 499

Problem with Windows was restarting the terminal, probably the PATH was not correctly updated.

Upvotes: 0

GHULAM NABI
GHULAM NABI

Reputation: 496

It's all due the Cache. Clear the cache it will automatically set. I got the solution from this article. Follow the last step:

npm cache clean --force 

https://softans.com/clear-cache-file-in-cypress/

Upvotes: -1

edjm
edjm

Reputation: 5472

1st time using this tool today on my CentOS system. Got the same error when trying to run cypress open and cypress verify. Tried clearing the cache, reinstalling and all that fun stuff. Nothing fixed it.

Note: I had VSCode running on my system and I had recently started the Angular ng test to test other tests.

Apparently something with ng test interferes with Cypress. Once I turned off ng test and tried to open and verify Cypress it worked.

Cypress 9.1.1

Upvotes: 0

Niel
Niel

Reputation: 2006

I had the same problem, running Cypress in WSL 2 would throw the same error even after trying all the solutions here.

I realised my Xserver was not running, started it up and everything worked again.

Upvotes: 9

flying_duck
flying_duck

Reputation: 196

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.

Upvotes: 12

Kumar Gaurav
Kumar Gaurav

Reputation: 397

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.

Upvotes: 38

Maximilian Kaden
Maximilian Kaden

Reputation: 350

I just had the same problem, I solved it just by disabling the antivirus [Windows 10].

Upvotes: 0

BlueShadow
BlueShadow

Reputation: 47

Please try this go to path: node_modules\cypress\lib\tasks\verify.js, and you need to increase the default timeout.

Open verify.js, search for the variable VERIFY_TEST_RUNNER_TIMEOUT_MS. By default it should be 30000. Change it to 100000.

Save and try to open the runner. I hope now you will able to run the tests.

Upvotes: 1

Sudip Ghosh
Sudip Ghosh

Reputation: 351

Rerun it. It will work. Rerunning it verified the cypress.

Upvotes: 5

Bilawal Wajid Ali
Bilawal Wajid Ali

Reputation: 264

I also got this error , so I relaunch the cypress again(Which works for me) and also to be on safe side i have change the default duration with 100000s for future.

Upvotes: 0

Daniel Danielecki
Daniel Danielecki

Reputation: 10502

Retrying launching Cypress one more time worked out with the error being gone, hmm...

Upvotes: 31

Swaraj Dash
Swaraj Dash

Reputation: 7

To resolve this issue, you need to increase default timeout. For this, go to below path: node_modules\cypress\lib\tasks\verify.js & Open verify.js, search variable VERIFY_TEST_RUNNER_TIMEOUT_MS. By default it should be 30000. Change it to 100000.

Upvotes: -1

Related Questions