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

Remove cy.server() boilerplate #439

Closed
paulfalgout opened this issue Feb 24, 2017 · 3 comments · Fixed by #4176
Closed

Remove cy.server() boilerplate #439

paulfalgout opened this issue Feb 24, 2017 · 3 comments · Fixed by #4176
Assignees
Labels
topic: network type: breaking change Requires a new major release version

Comments

@paulfalgout
Copy link
Contributor

There's probably a really good reason not to do this, but I thought I'd float it just in case.

If you call cy.route() without first calling cy.server() you get CypressError: cy.route() cannot be invoked before starting the cy.server()

Totally makes sense.. but in every Cypress test I've written thus far my only use case for cy.server() is adding it prior to the first cy.route() call.

Is there any reason why, instead of erroring it could just call cy.server() for me?

@brian-mann
Copy link
Member

I agree. The idea behind cy.server was that it would provide all of the defaults for all of the subsequent cy.route calls.

But I imagine most if not all users don't pass anything into it. In that sense it just becomes "that one thing you do before cy.route".

There is a looming network traffic proxy rewrite coming soon, and we were going to remove it then, because we will add breaking changes to the routing API anyway.

@jennifer-shehane jennifer-shehane added the type: enhancement Requested enhancement of existing feature label Mar 1, 2017
@jennifer-shehane jennifer-shehane added stage: ready for work The issue is reproducible and in scope type: breaking change Requires a new major release version and removed type: enhancement Requested enhancement of existing feature labels Jan 31, 2019
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope labels Jun 24, 2020
@jennifer-shehane jennifer-shehane assigned flotwig and unassigned bahmutov Jul 13, 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
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 removed the stage: needs review The PR code is done & tested, needs review label Sep 1, 2020
@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: breaking change Requires a new major release version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants