-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(net-stubbing): experimental full network mocking support #4176
Conversation
When is this targeted to be released? |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
200+ commits PRs |
Addendum to cypress-io@c378960 (cypress-io#4176)
When is the new version going to be released with full network stubbing support? |
Looking forward for the new releases having the full network layer stubbing. |
Release 5.1.0 has the experimental support from this PR. |
I just came to say THANK YOU @flotwig and team. I could not get |
This comment has been minimized.
This comment has been minimized.
We had a pretty hacky (but very much working) setup for mocking JSONP and OAuth requests and also some hacks for dynamic responses. That's all gone with the new API - thank you very much. Not only it has new capabilities but is IMHO actually easier to use. Great work 🚀 |
This is working perfect for us. Fetch requests were blocking our tests but now it's not an issue. Thanks! |
This is a lifesaver and thank you so much for this 🙏 Few questions out of curiosity:
|
@hkar9113 This is going to be promoted from "experimental" in the next major release of Cypress, 6.0.0. #9185
With 6.0.0, With 6.0.0, we will begin to encourage users to use
Cypress 6.0.0 is scheduled to come out next week. |
Hi guys , sorry if i'm on the wrong thread here but basically what i want to do is stub every outgoing request with header that has a dynamic parameter where the test stored in the cypress\integration folder is setting the parameter Basically we have this functionality today for a constant header on this page https://docs.cypress.io/api/commands/intercept#Intercepting-a-request section so something like |
@TheNumbaCruncha yes, you can do that with this feature. I'm not sure what your "dynamic parameter" is - this seems like a JS question, maybe try StackOverflow or GitHub Discussions, this is a pull request comment thread. |
window.fetch
capturing/mocking #95 (implementwindow.fetch
capturing / mocking)User facing changelog
experimentalNetworkMocking
enabled, added support forcy.route2
, which can intercept any HTTP traffic.Additional details
Objectives
Todo List
proxy-refactor
: Refactor proxy into own package, implement middleware pattern #5136Internal Events
cy.route()
Eventsroute:added
AddRouteFrame
HTTPController
Eventshttp:request:received
CyIncomingRequest
http:request:continue
CyIncomingRequest
http:response:received
CyIncomingResponse
req.reply
callback registeredhttp:response:continue
CyIncomingResponse
http:request:complete
PR Tasks
cypress-documentation
? Network Stubbing Documentation cypress-documentation#2854type definitions
?cypress.schema.json
?