-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[WIP] Network emulation for Chrome #6932
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening a PR! This is a good idea, but I think it is better suited to be used as a separate NPM module users can require in their support file for now.
While this is definitely functionality we eventually want to have in Cypress core, the lack of Firefox support blocks this from being merged for now.
Handles
cy.request
- No idea what the desired behavior is here?
cy.request
is simply a means for the user to perform a normal, unintercepted HTTP request from their test code, so it should be exempt from any network conditioning that applies to their test code.
Thank you @flotwig for your reply. For supporting Firefox, we should be able to simulate clicks towards the user-facing "Work offline" function of Firefox. As far as I know, the That would go a long way in bridging the gap until Firefox offers "real" API-support for it. Because lack of Firefox-support seems like the only major blocking issue, this would seem like a doable workaround - one that I can imagine people will be happy with. (Whether released in the end as separate package or as PR - I don't mind either way. I would like to offer as much functionality as possible on this topic.) |
@EtienneBruines no, there's no way to do this currently, you'd have to work through Firefox's available APIs to enable/disable work offline mode. When you do publish a plugin, you can open a pull request to add it to our documentation? Instructions here. Closing this PR for now. |
User facing changelog
cy.network()
that simulates network conditionsAdditional details
This allows you to simulate network conditions, such as being offline or on a slow 3G network.
How has the user experience changed?
It allows the following:
PR Tasks
cypress-documentation
?type definitions
?Have new configuration options been added to thenot applicablecypress.schema.json
?Network.emulateNetworkConditions
in FirefoxBrowser.getVersion
to1.3
in FirefoxNetwork.getAllCookies
in Firefoxcy.network
not being available)cy.request
should be unaffected