You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the changes documented here, did not consider the use of Page Object Model, when a selector/element is referenced from the test it block (from many), when ONLY in some instances do you need to specify the timeout (often you might not need to change a timeout), and thus you do not bother to pass a value. This is a valid, and I am sure a common use case.
Desired behavior
Rather when null it should be set to the default timeout rather than fail with the error
Hi @Dale-777, thanks for reaching out. I'm sorry this resulted in unexpectedly breaking tests.
The only valid option for timeout has always been a Number. The addition of validations was to ensure one wouldn't get into a situation where Cypress would hang with invalid options passed to timeout as seen in this issue: #29323
This is not a change of any of our behavior as it has always only ever accepted a Number. We don't intend to make an update to the logic of timeout to accept a null or undefined value for timeout as this may cause confusion if that were introduced. Does undefined mean they want it to be 0 timeout or to use the default?
We suggest updating any custom commands for Page Object Models to handle when the timeout option is not passed via the calling function. An example is shown below that falls back to default timeout if it is not present.
constelements={companyNameDropdown: (timeout)=>cy.get('[data-cy="avatar"]',(timeout ? { timeout } : {}))}it('test without timeout',()=>{elements.companyNameDropdown().should("be.visible")})it('test with timeout',()=>{elements.companyNameDropdown(7000).should("be.visible")})
Current behavior
release 13.8.1 resulted in 50% of our tests failing due to tests requiring updates.
#29323
#29327
#28872
I believe the changes documented here, did not consider the use of Page Object Model, when a selector/element is referenced from the test it block (from many), when ONLY in some instances do you need to specify the timeout (often you might not need to change a timeout), and thus you do not bother to pass a value. This is a valid, and I am sure a common use case.
Desired behavior
Rather when null it should be set to the default timeout rather than fail with the error
Test code to reproduce
File 1 (test 1):
File 2 (test 2):
File 3 (page object):
Cypress Version
13.8.1
Node version
v18.16.0
Operating System
All OS
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: