1

I use exec() function on cypress but I get timeout error sometimes even if it works properly.

Is there any possibility ignore this timeout error?

I do not want to see this error. I want to see always pass/true in any case.

1
  • Please add your code and your error message to the question. Commented Oct 24, 2021 at 9:11

1 Answer 1

1

You can look into failOnNonZeroExit options flag. It determines whether to fail if the command exits with a non-zero code.

cy.exec('some commands', { failOnNonZeroExit: false }) 

Or, You can also pass a timeout options object with cy.exec(), something like:

cy.exec('some commands', { timeout: 10000 }) //timeout for 10 seconds 
Sign up to request clarification or add additional context in comments.

2 Comments

I tried it but did not work. I did everything on the document of cypress.
failOnNonZeroExit: false does not work, I still got timeout errors, however it helped me to manage exec error as I want and not from cypress

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.