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

v6.0 Release #3111

Merged
merged 30 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cb1a1a5
Add docs for visibility check (#3071)
panzarino Aug 28, 2020
bd3277a
Merge branch 'develop' into 6.0.0-release
jennifer-shehane Nov 6, 2020
bf114b3
Begin writing changelog
jennifer-shehane Nov 6, 2020
af7da38
Begin writing migration guide
jennifer-shehane Nov 6, 2020
1e466a2
docs(net-stubbing): rename cy.route2 to cy.http (#3322)
flotwig Nov 14, 2020
9762363
Merge branch 'develop' into 6.0.0-release
jennifer-shehane Nov 14, 2020
5b138e7
Update migration guide + breaking changes for cy.route2 rename
jennifer-shehane Nov 14, 2020
95e9eae
docs: note experimentalFetchPolyfill as deprecated (#3330)
flotwig Nov 19, 2020
d89e680
Document printing electron / node version from Cypress (#3324)
bahmutov Nov 19, 2020
ab9102e
docs: Disable dev shm usage by default (#3335)
jennifer-shehane Nov 20, 2020
41d0a42
fix docs on negated assertions (#1375)
kuceb Nov 20, 2020
e4f5c12
Write migration guide for negated assertions
jennifer-shehane Nov 20, 2020
7b84697
Merge branch 'develop' into 6.0.0-release
jennifer-shehane Nov 20, 2020
7f9148d
Add disable-dev-shm-usage to migration guide + some more readability …
jennifer-shehane Nov 20, 2020
497124b
Add key takeaway to negated assertions migration guide cause it's rea…
jennifer-shehane Nov 20, 2020
75a10d9
docs(net-stubbing): deprecate cy.route(), remove experimentalNetworkS…
flotwig Nov 23, 2020
4c82237
Write more of the 6.0 changelog
jennifer-shehane Nov 23, 2020
ae0f076
Add negated assertions to breaking changes.
jennifer-shehane Nov 23, 2020
cd3be8f
Update roadmap to be accurate to whats been delivered.
jennifer-shehane Nov 23, 2020
ef99542
Merge branch 'develop' into 6.0.0-release
jennifer-shehane Nov 23, 2020
58156d0
update for cypress-io/cypress#9280
flotwig Nov 23, 2020
06767aa
document printing individual component version (#3339)
bahmutov Nov 23, 2020
70f5fcd
Add summary to changelog
jennifer-shehane Nov 23, 2020
72f6c8b
docs(migration-guide): document cy.wait(alias) type change (#3337)
flotwig Nov 23, 2020
9b666e9
Add breaking change of http type to changelog
jennifer-shehane Nov 23, 2020
ea6df73
Add missing feature to changelog
jennifer-shehane Nov 23, 2020
5dd34d2
Rearrange breaking changes
jennifer-shehane Nov 23, 2020
ab608ba
rename cy.http to cy.intercept (#3340)
jennifer-shehane Nov 23, 2020
aad7206
updates
flotwig Nov 23, 2020
f3d14fc
changelog
flotwig Nov 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ alias:
api/assertions/assertions.html: guides/references/assertions.html
api/commands/cypress-blob.html: api/utilities/blob.html
api/commands/api-server.html: api/cypress-api/cypress-server.html
api/commands/route2.html: api/commands/http.html

examples/index.html: examples/examples/recipes.html

Expand Down
4 changes: 2 additions & 2 deletions source/_changelogs/5.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

- Introducing *experimental* full network stubbing support 🎉.
- With `experimentalNetworkStubbing` enabled, the `cy.route2` command is available. Addressed in {% issue 4176 %}.
- By using {% url `cy.route2()` route2 %}, your tests can intercept, modify, and wait on any type of HTTP request originating from your app, including `XMLHttpRequest`s, `fetch` requests, beacons, and subresources (like iframes and scripts).
- By using {% url `cy.route2()` http %}, your tests can intercept, modify, and wait on any type of HTTP request originating from your app, including `XMLHttpRequest`s, `fetch` requests, beacons, and subresources (like iframes and scripts).
- Outgoing HTTP requests can be modified before reaching the destination server, and the HTTP response can be intercepted as well before it reaches the browser.
- See the {% url `cy.route2()` route2 %} docs for more information on how to enable this experiment.
- See the {% url `cy.route2()` http %} docs for more information on how to enable this experiment.
- `cy.trigger()` now accepts an `eventConstructor` option for specifying the constructor with which to create the event to trigger. Addresses {% issue 5650 %}.

**Bugfixes:**
Expand Down
10 changes: 5 additions & 5 deletions source/_changelogs/5.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
**Features:**

- Added the configuration option `includeShadowDom` for enabling shadow DOM querying globally, per-suite, per-test, or programmatically. Addresses {% issue 8442 %}.
- Added a `followRedirect` option to request interception with `cy.route2()`, allowing redirects to be followed before continuing to response interception. Addresses {% issue 7967 %}.
- Added the capability to specify `delayMs` and `throttleKbps` when stubbing static responses with `cy.route2()`. Addresses {% issue 7661 %}.
- Added a `followRedirect` option to request interception with {% url "`cy.route2()`" http %}, allowing redirects to be followed before continuing to response interception. Addresses {% issue 7967 %}.
- Added the capability to specify `delayMs` and `throttleKbps` when stubbing static responses with {% url "`cy.route2()`" http %}. Addresses {% issue 7661 %}.
- Installing Cypress pre-releases no longer requires setting the `CYPRESS_BINARY_INSTALL` environment variable. Addresses {% issue 8482 %}.

**Performance Improvements:**
Expand All @@ -29,14 +29,14 @@

**Documentation Changes:**

- Fixed examples of delaying and throttling responses with `cy.route2()`. Addresses {% issue 8489 %}.
- Added examples of using a response function with `cy.route2()`. Addresses {% issue 8468 %}.
- Fixed examples of delaying and throttling responses with {% url "`cy.route2()`" http %}. Addresses {% issue 8489 %}.
- Added examples of using a response function with {% url "`cy.route2()`" http %}. Addresses {% issue 8468 %}.
- Removed unmaintained languages. English docs is the only supported language by the Cypress team. We greatly appreciate the contributions from the community for other languages, but these docs are largely stale, unmaintained, and partial. The Cypress team will seek out more scalable docs internalization implementation in the future.

**Misc:**

- The `experimentalShadowDomSupport` configuration flag has been removed. It is no longer necessary to enable shadow DOM testing.
- Improved the error message when the subject provided to `cy.shadow()` is not a shadow host. Addresses {% issue 8530 %}.
- Improved the error message when the Cypress binary is not executable. It now recommends trying to clear the cache and re-install. Addresses {% issue 8397 %}.
- Added missing type declarations for the `cy.route2()` command.
- Added missing type declarations for the {% url "`cy.route2()`" http %} command.
- Updated the type declaration for `Cypress.Commands.add()`, adding `Promise` to the list of allowed return types. Addresses {% issue 7807 %}.
6 changes: 3 additions & 3 deletions source/_changelogs/5.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

**Bugfixes:**

- Fixed a bug where `cy.route2` would not automatically JSONify an empty array handler. Addresses {% issue 8532 %}.
- Fixed a bug where objects yielded by using `cy.wait` on a `cy.route2` alias would not always have a `response` property. Addresses {% issue 8536 %}.
- Fixed an issue where `cy.route2` routes would not be able to intercept requests to HTTPS destinations on a different origin. Addresses {% issue 8487 %}.
- Fixed a bug where {% url "`cy.route2()`" http %} would not automatically JSONify an empty array handler. Addresses {% issue 8532 %}.
- Fixed a bug where objects yielded by using `cy.wait` on a {% url "`cy.route2()`" http %} alias would not always have a `response` property. Addresses {% issue 8536 %}.
- Fixed an issue where {% url "`cy.route2()`" http %} routes would not be able to intercept requests to HTTPS destinations on a different origin. Addresses {% issue 8487 %}.
- Fixed an issue where subjects became `undefined` after certain assertion failures. Addresses {% issue 5763 %}.
- Fixed an issue where a `cy.task` with no arguments passed would receive `null` as the first argument instead of `undefined`. Addresses {% issue 5913 %}.
- Fixed an issue preventing users from passing the config-file argument when starting cypress through the node module API. Addresses {% issue 8632 %}.
Expand Down
6 changes: 3 additions & 3 deletions source/_changelogs/5.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
- When a command is chained after {% url "`.within()`" within %} and {% url "`cy.get()`" %} is called inside it, the scope will no longer permanently change. Fixes {% issue 2106 %}, {% issue 4672 %}, {% issue 4757 %}, and {% issue 5183 %}.
- Dual commands like {% url "`cy.contains()`" contains %} when used after an {% url "`.each()`" each %} commands now query as expected. Fixes {% issue 4921 %}.
- `/` is no longer added to the URL when `baseUrl` has param(s). Fixes {% issue 2101 %}.
- When using {% url "`cy.route2()`" route2 %} the route handler timeouts will no longer leak into other tests and cause random failures. Addressed in {% issue 8727 %}.
- The `request.body` is now available when using {% url "`cy.wait()`" wait %} on an aliased {% url "`cy.route2()`" route2 %} route which had not been intercepted. Fixes {% issue 8695 %}.
- When using {% url "`cy.route2()`" http %} the route handler timeouts will no longer leak into other tests and cause random failures. Addressed in {% issue 8727 %}.
- The `request.body` is now available when using {% url "`cy.wait()`" wait %} on an aliased {% url "`cy.route2()`" http %} route which had not been intercepted. Fixes {% issue 8695 %}.
- Re-running failed build steps in Bitbucket will no longer create a new run on the Cypress Dashboard. Fixes {% issue 8720 %}.
- The forced garbage collection timer will no longer display when using a version of Firefox newer than 80. Fixes {% issue 8725 %}.
- The browser dropdown is no longer covered when opened from the Runs tab in the Test Runner. Fixed in {% issue 8745 %}.
- Fixed an issue where preprocessor-related plugins would cause tests not to run and a duplicate instance of Cypress to be spawned. Fixes {% issue 8634 %}.

**Misc:**

- Improved type definitions for {% url "`cy.route2()`" route2 %}. Addresses {% issue 8694 %} and {% issue 8782 %}.
- Improved type definitions for {% url "`cy.route2()`" http %}. Addresses {% issue 8694 %} and {% issue 8782 %}.
- The Test Runner now shows an indicator in the footer and a toast notification if there is a new version available. Addressed in {% issue 8702 %} and {% issue 8803 %}.

**Dependency Updates:**
Expand Down
10 changes: 5 additions & 5 deletions source/_changelogs/5.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
**Bugfixes:**

- Updated the Cypress proxy layer to proxy HTTPS traffic from non-AUT origins. Addressed in {% issue 8827 %}.
- This fixed an issue with {% url "`cy.route2()`" route2 %} where HTTPS requests to a non-AUT origin would not be intercepted as expected.
- {% url "`cy.route2()`" route2 %} now properly handles passing a method as its first argument. Fixes {% issue 8729 %}.
- Fixed an issue with {% url "`cy.route2()`" route2 %} where a "Cannot set property response of undefined" error would occasionally occur. Fixes {% issue 8858 %}.
- Headers field names passed to {% url "`cy.route2()`" route2 %} now case-insensitively match against the field names of incoming HTTP requests. Fixes {% issue 8921 %}.
- Routes that stub fixtures for binary resources (including images) made with {% url "`cy.route2()`" route2 %} now serve the correct mime-type and content. Fixes {% issue 8623 %}.
- This fixed an issue with {% url "`cy.route2()`" http %} where HTTPS requests to a non-AUT origin would not be intercepted as expected.
- {% url "`cy.route2()`" http %} now properly handles passing a method as its first argument. Fixes {% issue 8729 %}.
- Fixed an issue with {% url "`cy.route2()`" http %} where a "Cannot set property response of undefined" error would occasionally occur. Fixes {% issue 8858 %}.
- Headers field names passed to {% url "`cy.route2()`" http %} now case-insensitively match against the field names of incoming HTTP requests. Fixes {% issue 8921 %}.
- Routes that stub fixtures for binary resources (including images) made with {% url "`cy.route2()`" http %} now serve the correct mime-type and content. Fixes {% issue 8623 %}.
- When {% url "`experimentalNetworkStubbing`" experiments %} is enabled, using {% url "`cy.visit()`" visit %} to URLs that redirect and set Transfer-Encoding: chunked will no longer fail in Cypress with a "Parse Error". Fixes {% issue 8497 %}.
- `cypress.run()` through the {% url "Module API" module-api %} now has a `status` property in the results matching the correct CLI types (`"failed"` or `"finished"`). Addresses {% issue 8799 %}.
- When a value containing an `e` character is passed to the `--ci-build-id` flag, Cypress now properly reads it as a string. Fixes {% issue 8874 %}.
Expand Down
8 changes: 4 additions & 4 deletions source/_changelogs/5.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Features:**

- You can now dynamically add aliases for requests intercepted via {% url "`cy.route2()`" route2 %}. {% url "See an example" route2#Aliasing-individual-requests %}. Addresses {% issue 387 %}.
- You can now dynamically add aliases for requests intercepted via {% url "`cy.route2()`" http %}. {% url "See an example" http#Aliasing-individual-requests %}. Addresses {% issue 387 %}.
- You can now run all integration specs or all component specs separately (or a filtered list of specs) by clicking the appropriate button in the Test Runner in the *Tests* tab. Addresses {% issue 8203 %}.
- Added a new modifier syntax to {% url "`cy.type()`" type %}. You can now type shortcuts like `{ctrl+z}`. Addressed in {% issue 5694 %}.
- We now show a modal with release notes when available when there is a new version of Cypress. Addressed in {% issue 9006 %}.
Expand All @@ -14,9 +14,9 @@

- Fixed a regression introduced in {% url "4.12.0" changelog#4-12-0 %} where snapshotting caused images to load too many times. Fixes {% issue 8679 %}.
- Using {% url "`cy.visit()`" visit %} on sites with `content-type` of `text-html` followed by parameters (like `text/html;charset=utf-8`) will no longer throw an error about visiting a site with an invalid content-type. Fixes {% issue 8506 %}
- The `Cannot access 'continueSent' before initialization` error will no longer throw when using {% url "`cy.route2()`" route2 %}. Fixes {% issue 8926 %}.
- Awaiting a request body when providing a static response stub in {% url "`cy.route2()`" route2 %} should now work properly. Addressed in {% issue 9059 %}.
- The way that intercepted {% url "`cy.route2()`" route2 %} requests are displayed in the Command Log has been improved, including showing the progress bar correctly. Addresses {% issue 9053 %}.
- The `Cannot access 'continueSent' before initialization` error will no longer throw when using {% url "`cy.route2()`" http %}. Fixes {% issue 8926 %}.
- Awaiting a request body when providing a static response stub in {% url "`cy.route2()`" http %} should now work properly. Addressed in {% issue 9059 %}.
- The way that intercepted {% url "`cy.route2()`" http %} requests are displayed in the Command Log has been improved, including showing the progress bar correctly. Addresses {% issue 9053 %}.
- The `Cannot read property 'replace' of undefined` error will no longer throw when attempting to generate the stack trace from an error thrown in the application. Fixes {% issue 7915 %}.
- Stack traces in the Command Log originating from application errors where the location is unavailable will no longer show as a clickable link to open in IDE. Fixes {% issue 9106 %}.
- When using the `fixture:` prefix as a stubbed response to {% url "`cy.route()`" route %}, JSON fixtures containing only a number or boolean will no longer throw an error. Fixes {% issue 4899 %}.
Expand Down
53 changes: 53 additions & 0 deletions source/_changelogs/6.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 6.0.0

*Released 11/23/2020*

**Summary:**



**Breaking Changes:**

**{% fa fa-exclamation-triangle red %} Please read our {% url "Migration Guide" migration-guide %} which explains the changes in more detail and how to change your code to migrate to Cypress 6.0.**

- Cypress now always throws an error when asserting on an element that doesn't exist in the DOM (unless you're asserting that the element should `not.exist`). Assertions such as `not.visible`, `not.contains`, `not.have.class`, etc will now fail when used on non-existent DOM elements. Addresses {% issue 205 %}.
- DOM elements where the CSS style (or ancestors) are `opacity: 0` are no longer considered visible. However these are still considered {% url "actionable" interacting-with-elements %} and {% url "any action commands" interacting-with-elements#Actionability %} used to interact with the element will perform the action. This matches browser's implementation on how they regard elements with `opacity: 0`. Addresses {% issue 4474 %}.
- The `experimentalNetworkStubbing` option has been removed and made the default behavior. You can safely removed this configuration option. Addressed in {% issue 9185 %}.
- We removed several deprecation errors around APIs that were removed in versions of Cypress prior to 4.0.0. This will not cause any changes for anyone upgrading from a 4.0+ version of Cypress. For a full list of all APIs affected see {% issue 8946 %}.
- We updated our HTTP status codes and reason phrases to match Node.js `http.STATUS_CODES`. If you have code that relies on a reason phrase, then this could affect you. Addressed in {% issue 8969 %}.
- When using {% url "`.type()`" type %} and {% url "`.click()`" click %} on elements inside a `contenteditable` element, the events are now properly triggered on the inside elements. This may cause unintended consequences if you were relying on the previous behavior. Addressed in {% issue 9066 %}.

**Deprecations:**

Deprecations still work as before but will be removed from Cypress in a future release. We encourage you to update your code now to remove uses of deprecations.

- `cy.server()` and `cy.route()` have been deprecated. In a future release, support for `cy.server()` and `cy.route()` will be moved to a plugin. We encourage you to use {% url "`cy.http()`" http %} instead. Addressed in {% issue 9185 %}.
- `experimentalFetchPolyfill` has been deprecated. We encourage you to use {% url "`cy.http()`" http %} to intercept requests using the Fetch API instead.
- `cy.route2()` was renamed to {% url "`cy.http()`" http %}. We encourage you to update usages of `cy.route2()` to use {% url "`cy.http()`" http %}. Addressed in {% issue 9182 %}.

**Features:**

- The new {% url "`cy.http()`" http %} command can be used to manage the behavior of HTTP requests at the network layer. Addressed in {% issue 9182 %}.
- We now pass `—disable-dev-shm-usage` to the Chrome browser flags by default. This will write shared memory files into `/tmp` instead of `/dev/shm`. If you're passing this flag in your `plugins` file, you can now remove this code. Addresses {% issue 5336 %}.
- A warning is now displayed when passing invalid configuration keys through the CLI. Addresses {% issue 428 %}.
- The `cypress version` command now also displays the current Electron and bundled Node versions. Addresses {% issue 9180 %}.
- Cypress Doesn't Finish Typing Strings Before Continuing to Next Field https://github.com/cypress-io/cypress/issues/5480

**Bugfixes:**

- We fixed a regression introduced in {% url "3.5.0" changelog#3-5-0 %} that would cause {% url "`.type`" type %} to not type the entire string when focus was called away from the target element. Fixes {% issue 9254 %}.
- {% url "`.type()`" type %} and {% url "`.click()`" click %} now properly work on elements inside a `contenteditable` element. Fixes {% issue 2717 %} and {% issue 7721 %}.
- We fixed a regression introduced in {% url "5.6.0" changelog#5-6-0 %} that would cause the Test Runner to crashes and display a white page when switching tabs while tests are running. Fixes {% issue 9151 %}.

**Documentation Changes:**

- Our {% url "Migration Guide" migration-guide %} has a new section for 6.0 migration.
- Many of our docs examples have been updated to use {% url "`cy.http()`" http %} in place of `cy.route()` including our {% url "Network Requests" network-requests %} doc.

**Misc:**

**Dependency Updates**

- Upgraded Chrome browser version used during `cypress run` and when selecting Electron browser in `cypress open` from `85` to `87`. Addressed in {% PR 9222 %}.
- Upgraded bundled Node.js version from `12.16.3` to `12.18.3`. Addressed in {% PR 9222 %}.
- Upgraded `electron` from `10.1.5` to `11.0.2`. Addressed in {% PR 9222 %}.
2 changes: 1 addition & 1 deletion source/_data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ api:
go: go.html
hash: hash.html
hover: hover.html
http: http.html
invoke: invoke.html
its: its.html
last: last.html
Expand All @@ -123,7 +124,6 @@ api:
rightclick: rightclick.html
root: root.html
route: route.html
route2: route2.html
screenshot: screenshot.html
scrollintoview: scrollintoview.html
scrollto: scrollto.html
Expand Down
9 changes: 6 additions & 3 deletions source/_partial/network_stubbing_warning.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{% note danger %}
🚨 Please be aware that Cypress only currently supports intercepting XMLHttpRequests. **Requests using the Fetch API and other types of network requests like page loads and `<script>` tags will not be intercepted or visible in the Command Log.** You can automatically polyfill `window.fetch` to spy on and stub requests by enabling an [experimental](https://on.cypress.io/experimental) feature `experimentalFetchPolyfill`. See {% issue 95 %} for more details and temporary workarounds.
{% note warning %}
⚠️ `cy.route()` and `cy.server()` only support intercepting XMLHttpRequests. Requests using the Fetch API and other types of network requests like page loads and `<script>` tags will not be intercepted by `cy.route()` and `cy.server()`.

Cypress also has a new experimental [route2](/api/commands/route2.html) feature that supports requests using the Fetch API and other types of network requests like page loads. For more information, check out the [cy.route2() documentation](/api/commands/route2.html).{% endnote %}
**To support requests using the Fetch API you can use one of the solutions below:**

- 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 %}
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah, I agree

3 changes: 3 additions & 0 deletions source/_partial/xhr_stubbing_deprecated.md
Original file line number Diff line number Diff line change
@@ -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.
Copy link
Member

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()

Copy link
Member Author

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

{% endnote %}
Loading