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

docs(net-stubbing): rename cy.route2 to cy.http #3322

Merged
merged 3 commits into from
Nov 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
3 changes: 1 addition & 2 deletions source/_partial/network_stubbing_warning.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% 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.

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 %}

Cypress also has a new experimental [http](/api/commands/http.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.http() documentation](/api/commands/http.html).{% endnote %}
Loading