-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
cy.intercept() not overriding existing alias properly #20728
Comments
I was stuck in the same scenario and the below change worked when you want to wait for multiple occurrences of an call describe('cy.intercept', () => { |
If thats the case cy.wait('firstRoute') should have been failed. We are expecting behaviour to be same as cy.route(), as per #9302, In above snippet if we change cy.intercept() to cy.route(),(though we know cy.route() is depreciated in latest version),
Following is the result and it is the expected behaviour for us, same we are expecting in case of cy.intercept() as well, |
We are awaiting response...!!! |
I also read #9302. And the goal of the issue is to define a new way of behavior for the same route when In the case of this issue, the same route is intercepted multiple times with the different aliases. "alias" means:
It's an another name of something. The route has 2 aliases: So, not failing when waiting for And I personally think this behavior is more intuitive to the new users because we don't usually think making a new alias deprecates the old one. What we need now is to check if there are cases when deprecating/removing old aliases is unavoidable. Maybe, |
As @sainthkh notes, this is working as intended. You can use the |
Current behavior
In the following test case, firstRoute is not getting overridden by secondRoute, i.e cypress should wait for secondRoute .
Following is the reference screenshot for using cy.intercept()
Desired behavior
In the following test case, firstRoute has to be overridden by secondRoute, i.e cypress should wait for secondRoute .
Following is the reference screenshot for using cy.route()
Test code to reproduce
Cypress Version
9.5.0, 9.0.0, 7.2.0, 7.0.0
Other
No response
The text was updated successfully, but these errors were encountered: