Skip to content
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

Support mocking of iframe document response #2818

Closed
olofd opened this issue Nov 21, 2018 · 3 comments · Fixed by #4176
Closed

Support mocking of iframe document response #2818

olofd opened this issue Nov 21, 2018 · 3 comments · Fixed by #4176
Assignees
Labels
topic: network type: feature New feature that does not currently exist

Comments

@olofd
Copy link

olofd commented Nov 21, 2018

With cy.route it seems like document responses (GET-document requests) can not be mocked/replaced with fixture.

The use case is for having an foreign iframe embedded on our site and wanting to test our interaction with that iframe. But I can not reliably run the foreign iframe document in our tests.

It would be nice if (at least for relative paths, aka own domain) these responses could me mocked in cypress. If that's already possible with cy.route, please let me know.

@chrisbreiding
Copy link
Contributor

Currently, cy.route can only mock XHR requests, but we plan to add broader support for mocking any type of request in the future.

@jennifer-shehane jennifer-shehane added stage: proposal 💡 No work has been done of this issue type: feature New feature that does not currently exist labels Jan 28, 2019
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: proposal 💡 No work has been done of this issue labels Jun 24, 2020
@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: needs review The PR code is done & tested, needs review stage: work in progress labels Aug 25, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Aug 31, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 1, 2020

Released in 5.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 1, 2020
@jennifer-shehane
Copy link
Member

The features requested in this issue are now possible as part of cy.route2().

cy.route2() is currently experimental and requires being enabled by passing "experimentalNetworkStubbing": true through your Cypress configuration. This will eventually be merged in as part of our standard API.

Please see the cy.route2() docs for full details: https://on.cypress.io/route2

If you encounter any issues or unexpected behavior while using cy.route2() we encourage you to open a new issue so that we can work out all the issues before public release. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: network type: feature New feature that does not currently exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants