-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
v6.0 Release #3111
v6.0 Release #3111
Conversation
Co-authored-by: Jennifer Shehane <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
# Conflicts: # source/faq/questions/using-cypress-faq.md
Co-authored-by: Jennifer Shehane <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
This reverts commit 7d2f44d.
…tubbing (#3323) Co-authored-by: Jennifer Shehane <[email protected]>
- Use [`cy.http()`](/api/commands/http.html) which supports requests using the Fetch API and other types of network requests like page loads. See [`cy.http()`](/api/commands/http.html). | ||
- Polyfill `window.fetch` to spy on and stub requests using `cy.route()` and `cy.server()` by enabling [`experimentalFetchPolyfill`](https://on.cypress.io/experimental). See {% issue 95 %} for more details and temporary workarounds. | ||
{% endnote %} |
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.
With cy.http()
becoming official, I believe these deprecation methods need to be more prominent. It seems odd to list multiple "workarounds" when there is an officially supported version. I suggest removing the experimentalFetchPolyfill
and explain that cy.http()
can now achieve this directly.
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.
yah, I agree
@@ -0,0 +1,3 @@ | |||
{% note warning %} | |||
⚠️ **`cy.server()` and `cy.route()` are deprecated in Cypress 6.0.0**. In a future release, support for `cy.server()` and `cy.route()` will be moved to a plugin. Consider using [`cy.http()`](/api/commands/http.html) instead. |
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.
see comment above. not worth calling out cy.route()
as a plugin... just straight up suggest using cy.http()
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.
I'm not sure I agree - unless we are very unsure about future support in a plugin.. The idea of us removing support forever may be intimidating to some users
Co-authored-by: Jennifer Shehane <[email protected]>
cy.fixture('comment.json').should('deep.eq', xhr.responseBody) | ||
cy.wait('@postComment').then(({ response }) => { | ||
cy.exec(`echo ${JSON.stringify(response.body)} >cypress/fixtures/comment.json`) | ||
cy.fixture('comment.json').should('deep.eq', response.body) |
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.
Example doesn't work. See #3323 (comment)
{ id: 1, comment: 'hi' }, | ||
{ id: 2, comment: 'there' } | ||
]) |
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.
Example doesn't work. See #3323 (comment)
cy.wait('@getUser').then((xhr) => { | ||
expect(xhr.requestBody.firstName).to.eq('Jane') | ||
cy.wait('@getUser').then(({ request }) => { | ||
expect(request.body.firstName).to.eq('Jane') |
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.
Example doesn't work. See #3323 (comment)
|
||
cy.get('form').submit() | ||
|
||
cy.wait('@postUser').its('requestBody').should('have.property', 'name', 'Brian') | ||
cy.wait('@postUser').then(({ request }) => { | ||
expect(JSON.parse(request.body)).to.have.property('name', 'Brian') |
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.
Exampled doesn't work. See #3323 (comment)
id: '101', | ||
firstName: 'Joe', | ||
lastName: 'Black' | ||
}) |
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.
Example doesn't work. See #3323 (comment)
// it is a good practice to add assertion messages | ||
// as the 2nd argument to expect() | ||
expect(xhr.response.headers, 'response headers').to.include({ | ||
expect(response.headers, 'response headers').to.include({ |
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.
Example doesn't work. See #3323 (comment)
Co-authored-by: Zach Bloomquist <[email protected]>
For cypress-io/cypress#8437 - 6.0 features in develop also
Targeted release date: Nov 23, 2020
experimentalFetchPolyfill
docs: note experimentalFetchPolyfill as deprecated #3330