Config routes with no response fail to be recognised as a route
See original GitHub issueCurrent behavior:
If we try to create the following route:
cy.route({
method: 'GET',
url: '**/some-route',
status: 400,
}).as('someRoute');
This is failed to be picked up by Cypress as a valid route:
cy.wait('@someRoute'); // The route is not recognised, so this assertion will fail
The current workaround for this is to provide an empty response object, which is technically not correct behaviour, as this particular route does not return any response (not even an empty JSON payload):
cy.route({
method: 'GET',
url: '**/some-route',
status: 400,
response: {}
}).as('someRoute');
Desired behavior:
Routes without responses should be able to be configured / considered as valid routes by Cypress:
cy.route({
method: 'GET',
url: '**/some-route',
status: 400,
}).as('someRoute');
Steps to reproduce: (app code and test code)
Same as per the current behaviour
Versions
Cypress: Latest, 3.2.0 Operating System: macOS High Sierra 10.13.6 Browser: Chrome and/or Electron 59
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Why doesn't Symfony 5.1 recognize routes configured on a ...
Routes configured inside a file routes.php result in the error "No route found for "GET /something" (404 Not Found)". When running debug:router ......
Read more >Route configuration | OpenShift Container Platform 4.10
Path -based routing is not available when using passthrough TLS, as the router does not terminate TLS in that case and cannot read...
Read more >I see "No route" or "Routing server error" - Waze Help
I see "No route" or "Routing server error". If you see one of the above routing errors, it could be because the search...
Read more >Rails Routing from the Outside In - Ruby on Rails Guides
If there is no matching route, then Rails returns HTTP status 404 to the caller. 2.2 RESTful Routes. RESTful routes take advantage of...
Read more >Routing concepts - Fortinet Documentation Library
Sometimes upon routing table changes, it is not desirable for traffic to be routed to a different gateway. For example, you may have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having the exact same issue. It also fails doing something like
cy.route('/some/route')
In the upcoming v12.0.0 release, the deprecated
cy.route()
andcy.server()
commands and the deprecatedCypress.Server.defaults
API will be removed. This has been replaced withcy.intercept()
. Close as this is no longer application.Please try recreating this issue with the latest Cypress version and
cy.intercept()
. If you are still having problems please open a new Github issue.