Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If anything but a number is passed as the timeout option on cy.get(), the test never reaches the failure state #29323

Closed
bernardodomingues-hotmart opened this issue Apr 12, 2024 · 5 comments · Fixed by #29327
Labels
good first issue Good for newcomers type: user experience Improvements needed for UX

Comments

@bernardodomingues-hotmart

Current behavior

Passing something that is not a number to the timeout field causes what should be a failing test never to reach the failure state.

Desired behavior

If the option is not a valid number, ignore it and apply the default timeout (AFAIK 4s).

Test code to reproduce

https://github.com/bernardodomingues-hotmart/cypress-test-tiny

Cypress Version

13.7.3

Node version

v20.12.2

Operating System

macOS 13.6.6 / Docker cypress-included

Debug Logs

No response

Other

Even though we should have TS for type checking, old codebases are still in JS. This was caused by a developer error when creating custom commands, but there should be a safety net, as IMHO is better for a test to fail fast than never finish. This in a CI environment was a disaster :)

@cacieprins
Copy link
Contributor

It may make the most sense here to throw a TypeError if a non-number timeout is supplied to any command, rather than falling back to the default timeout. What do you think?

@jennifer-shehane jennifer-shehane added the type: user experience Improvements needed for UX label Apr 12, 2024
@jennifer-shehane
Copy link
Member

@bernardodomingues-hotmart We'd be open to a PR to handle this.

@jennifer-shehane jennifer-shehane added the good first issue Good for newcomers label Apr 12, 2024
@sossost
Copy link

sossost commented Apr 13, 2024

hi. @jennifer-shehane I am sossost, a new contributor. Can I fix this? thank you

@bernardodomingues-hotmart
Copy link
Author

It may make the most sense here to throw a TypeError if a non-number timeout is supplied to any command, rather than falling back to the default timeout. What do you think?

I agree.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 23, 2024

Released in 13.8.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.8.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers type: user experience Improvements needed for UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants