Skip to content

Commit 639cfea

Browse files
jennifer-shehaneAtofStrykermschilecacieprinsMikeMcC399
authored
14.0 Docs (#5964)
* Start 14.0 doc updates * Write JIT compile migration * Add note about deprecation of resourceType * Add deprecated badge to intercept resourceType * Add badge styling * Add new browser support * update miggration to right number of versions * update to be more specific * Add more docs around justInTimeCompile * chore: update supported vite versions for cypress 14 (#5978) * chore: remove nuxt2 documentation as it is removed as a CT option in Cypress 14 (#5976) * chore: remove vue 2 documentation from Component Testing as it will no longer be supported in Cypress 14 (#5977) * chore: remove vue 2 docs from component testing as it is no longer supported in Cypress v14 * add vue2 migration guide for temporary support if needed * chore: update nextjs documentation to reflect Cypress 14 (#5980) * chore: update angular documentation with supported versions from Cypress 14 (#5983) * chore: update angular documentation with supported versions from cypress 14 and add migration guide documentation * address comments from code review * chore: remove CRA docs from cypress 14 and add migration guide (#5987) * docs: remove svelte 3 references and update migration guide (#5999) * chore: remove vue/cli-service from cypress docs and add migration guide (#5989) * Write a preliminary 'Summary' for v14 * chore: update react docs for Cypress 14 (#6003) * remove jit from experimental section (#6013) * chore: add docs for react 19 and next.js 15 (#6008) * chore: update angular docs to include Angular 19 (#6018) * chore: add angular 19 docs * Update docs/app/component-testing/angular/examples.mdx Co-authored-by: Matt Schile <mschile@cypress.io> --------- Co-authored-by: Matt Schile <mschile@cypress.io> * chore: update vite docs to include v6 (#6019) * chore: update docs to svelte 5 (#6028) * chore: update docs to svelte 5 * Update docs/app/references/migration-guide.mdx Co-authored-by: Matt Schile <mschile@cypress.io> --------- Co-authored-by: Matt Schile <mschile@cypress.io> * chore: remove react 19 rc warning (#6030) * Updates to changelog/migration guide to clean it up. * updates * fix: linting errors (#6067) * fix link to intercept command from migration-guide * prettier * Documents changes to cy.origin, configuration for document.domain inj… (#6058) * Documents changes to cy.origin, configuration for document.domain injection removal and reversion * lint and broken link fixes * lint * address code review comments: typos, clarification * lint * Update docs/app/references/configuration.mdx Co-authored-by: Bill Glesias <bglesias@gmail.com> * update example in cyorigin --------- Co-authored-by: Cacie Prins <cacie@cypress.io> Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com> Co-authored-by: Bill Glesias <bglesias@gmail.com> * lint * chore: updates some of the images on the component testing setup guide to show more modern dependency versions (#6073) * Update docs/app/references/changelog.mdx Co-authored-by: Bill Glesias <bglesias@gmail.com> * Update docs/app/references/changelog.mdx Co-authored-by: Bill Glesias <bglesias@gmail.com> * Update docs/partials/_document-domain-workaround.mdx Co-authored-by: Bill Glesias <bglesias@gmail.com> * Update docs/app/guides/cross-origin-testing.mdx Co-authored-by: Bill Glesias <bglesias@gmail.com> * Update docs/app/references/changelog.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * Update docs/app/references/changelog.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * Update docs/app/references/changelog.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * Update docs/app/references/changelog.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * fix link * Update docs/app/references/migration-guide.mdx Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> * chore: make sure prettier doesnt run on these lines as things look quite odd (#6081) --------- Co-authored-by: Bill Glesias <bglesias@gmail.com> Co-authored-by: Matt Schile <mschile@cypress.io> Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com> Co-authored-by: Cacie Prins <cacie@cypress.io> Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
1 parent 303d316 commit 639cfea

31 files changed

+728
-681
lines changed

Diff for: docs/api/commands/intercept.mdx

+16-15
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,21 @@ glob-matched against the request using
136136
[`Cypress.minimatch`](/api/utilities/minimatch) with the `{ matchBase: true }`
137137
minimatch option applied.
138138

139-
| Option | Description |
140-
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
141-
| auth | HTTP Basic Authentication (`object` with keys `username` and `password`) |
142-
| headers | HTTP request headers (`object`) |
143-
| hostname | HTTP request hostname |
144-
| https | `true`: only secure (https://) requests, `false`: only insecure (http://) requests |
145-
| method | HTTP request method (matches any method by default) |
146-
| middleware | `true`: match route first and in defined order, `false`: match route in reverse order (default) |
147-
| path | HTTP request path after the hostname, including query parameters |
148-
| pathname | Like `path`, but without query parameters |
149-
| port | HTTP request port(s) (`number` or `Array`) |
150-
| query | Parsed query string (`object`) |
151-
| resourceType | The resource type of the request. See ["Request object properties"](#Request-object-properties) for a list of possible values for `resourceType`. |
152-
| times | Maximum number of times to match (`number`) |
153-
| url | Full HTTP request URL |
139+
| Option | Description |
140+
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
141+
| auth | HTTP Basic Authentication (`object` with keys `username` and `password`) |
142+
| headers | HTTP request headers (`object`) |
143+
| hostname | HTTP request hostname |
144+
| https | `true`: only secure (https://) requests, `false`: only insecure (http://) requests |
145+
| method | HTTP request method (matches any method by default) |
146+
| middleware | `true`: match route first and in defined order, `false`: match route in reverse order (default) |
147+
| path | HTTP request path after the hostname, including query parameters |
148+
| pathname | Like `path`, but without query parameters |
149+
| port | HTTP request port(s) (`number` or `Array`) |
150+
| query | Parsed query string (`object`) |
151+
| resourceType <Badge type="caution">deprecated</Badge> | The resource type of the request. See ["Request object properties"](#Request-object-properties) for a list of possible values for `resourceType`. |
152+
| times | Maximum number of times to match (`number`) |
153+
| url | Full HTTP request URL |
154154

155155
See [examples](#With-RouteMatcher) below.
156156

@@ -1628,6 +1628,7 @@ information about the request and response to the console:
16281628

16291629
| Version | Changes |
16301630
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1631+
| [14.0.0](/app/references/changelog#14-0-0) | Deprecated `resourceType` property |
16311632
| [12.2.0](/app/references/changelog#12-2-0) | Added `resourceType` property to `req` and `RouteMatcher`. |
16321633
| [7.6.0](/app/references/changelog#7-0-0) | Added `query` option to `req` (The incoming request object yielded to request handler functions). |
16331634
| [7.0.0](/app/references/changelog#7-0-0) | Removed `matchUrlAgainstPath` option from `RouteMatcher`, reversed handler ordering, added request events, removed substring URL matching, removed `cy.route2` alias, added `middleware` RouteMatcher option, renamed `res.delay()` to `res.setDelay()` and `res.throttle()` to `res.setThrottle()`. |

Diff for: docs/api/commands/mount.mdx

+1-31
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ to start with for your commands:
4242
<TabItem value='React'>
4343

4444
```js
45-
// React 18
46-
import { mount } from 'cypress/react18'
47-
48-
// React 16, 17
4945
import { mount } from 'cypress/react'
5046

5147
Cypress.Commands.add('mount', (component, options) => {
@@ -56,33 +52,7 @@ Cypress.Commands.add('mount', (component, options) => {
5652
```
5753

5854
</TabItem>
59-
<TabItem value='Vue 2'>
60-
61-
```js
62-
import { mount } from 'cypress/vue2'
63-
64-
Cypress.Commands.add('mount', (component, options = {}) => {
65-
// Setup options object
66-
options.extensions = options.extensions || {}
67-
options.extensions.plugins = options.extensions.plugins || []
68-
options.extensions.components = options.extensions.components || {}
69-
70-
/* Add any global plugins */
71-
// options.extensions.plugins.push({
72-
// install(app) {
73-
// app.use(MyPlugin);
74-
// },
75-
// });
76-
77-
/* Add any global components */
78-
// options.extensions.components['Button'] = Button;
79-
80-
return mount(component, options)
81-
})
82-
```
83-
84-
</TabItem>
85-
<TabItem value='Vue 3'>
55+
<TabItem value='Vue'>
8656

8757
```js
8858
import { mount } from 'cypress/vue'

Diff for: docs/api/commands/origin.mdx

+31-16
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ e2eSpecific: true
99

1010
# origin
1111

12-
Visit multiple domains of different
13-
[origin](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#definition_of_an_origin)
12+
Visit multiple different
13+
[origins](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#definition_of_an_origin)
1414
in a single test.
1515

1616
In normal use, a single Cypress test may only run commands in a single origin, a
@@ -34,6 +34,18 @@ doc.
3434

3535
:::
3636

37+
:::info
38+
39+
<strong>Changes in Cypress [v14.0.0](/app/references/changelog#14-0-0)</strong>
40+
41+
Cypress no longer injects `document.domain` by default, which means `cy.origin()`
42+
must now be used to navigate between any two origins in the same test, even if
43+
the two origins are in the same superdomain. This behavior can be disabled by setting
44+
the `injectDocumentDomain` configuration option to `true`, to allow a smooth transition
45+
of tests to the new behavior. In Cypress 15, this configuration option will be removed.
46+
47+
:::
48+
3749
## Syntax
3850

3951
```js
@@ -69,26 +81,28 @@ cy.get('h1').contains('My cool site under test')
6981
const hits = getHits()
7082
cy.visit('https://example.cypress.io/history/founder')
7183
// To interact with cross-origin content, move this inside cy.origin() callback
72-
cy.get('h1').contains('About our Founder')
73-
// Domain must be a precise match including subdomain, i.e. example.cypress.io
74-
cy.origin('cypress.io', () => {
75-
cy.visit('/history/founder')
76-
cy.get('h1').contains('About our Founder')
77-
// Fails because hits is not passed in via args
78-
cy.get('#hitcounter').contains(hits)
84+
cy.get('h1').contains('Kitchen Sink')
85+
// Origin must be a precise match including scheme, subdomain and port, i.e. https://www.cypress.io
86+
cy.origin('https://www.cypress.io', () => {
87+
cy.visit('/about-us')
88+
cy.get('h1').contains('About us')
89+
// Fails because doanloads is not passed in via args
90+
cy.contains(downloads)
7991
})
80-
// Won't work because still on cypress.io
81-
cy.get('h1').contains('My cool site under test')
92+
// Won't work because still on www.cypress.io
93+
cy.get('h1').contains('Kitchen Sink')
8294
```
8395

8496
### Arguments
8597

86-
<Icon name="angle-right" /> **url _(String)_**
98+
<Icon name="angle-right" /> **origin _(String)_**
8799

88-
A URL specifying the secondary origin in which the callback is to be executed.
89-
This should at the very least contain a hostname, and may also include the
90-
protocol, port number & path. The hostname must precisely match that of the
91-
secondary origin, including all subdomains. Query params are not supported.
100+
A string specifying the origin in which the callback is to be executed.
101+
This should at the very least contain a hostname. It may also include the
102+
scheme and port number. The path may be included, but is not necessary.
103+
The hostname must precisely match that of the secondary origin, including
104+
all subdomains. Query params are not supported. If no scheme is provided,
105+
the scheme defaults to `https`.
92106

93107
This argument will be used in two ways:
94108

@@ -548,6 +562,7 @@ inclusion in a future version of Cypress.
548562

549563
| Version | Changes |
550564
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
565+
| [14.0.0](/app/references/changelog#14-0-0) | `cy.origin()` is now required when navigating between origins in the same test, rather than superdomains. |
551566
| [12.6.0](/app/references/changelog#10-7-0) | Support for `Cypress.require()` added and support for CommonJS `require()` and ES module `import()` removed |
552567
| [10.11.0](/app/references/changelog#10-7-0) | Support for CommonJS `require()` and ES module `import()` added and support for `Cypress.require()` removed |
553568
| [10.7.0](/app/references/changelog#10-7-0) | Support for `Cypress.require()` added |

Diff for: docs/app/component-testing/angular/api.mdx

+10-8
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ sidebar_label: API
1717
import { mount } from 'cypress/angular'
1818
```
1919

20-
Be sure to use the `cypress/angular-signals` package if using Angular `17.2` and up and wishing to test `signal()`s within your component tests.
21-
22-
```js
23-
import { mount } from 'cypress/angular-signals'
24-
```
25-
2620
<table class="api-table">
2721
<tr>
2822
<td>Description</td>
@@ -164,8 +158,16 @@ providers, declarations, imports and even component @Inputs()
164158
</tr>
165159
<tr>
166160
<td>componentProperties</td>
167-
<td>Partial&lt;&lbrace;[P in keyof T]: T[P];&rbrace;&gt; (optional)</td>
168-
<td> If using the `cypress/angular-signals` test harness, this type is adapted to `Partial<{[P in keyof T]: T[P] extends InputSignal<infer V> ? InputSignal<V> | WritableSignal<V> | V : T[P]}>` to allow for generic types to be wrapped inside a signal</td>
161+
<td>
162+
Partial&lt;&lbrace;[P in keyof T]: T[P] extends InputSignal&lt;infer V&gt;
163+
? InputSignal&lt;V&gt; | WritableSignal&lt;V&gt; | V : T[P]&rbrace;&gt;
164+
(optional)
165+
</td>
166+
<td>
167+
{' '}
168+
signal based inference types need only apply if you are using signals within
169+
your component tests
170+
</td>
169171
</tr>
170172
</table>
171173

Diff for: docs/app/component-testing/angular/examples.mdx

+11-4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ If you need to set up any additional `imports`, `declarations`, or `providers`
7474
for your component to mount successfully, you can set them in the options
7575
(similar to setting them up in `ngModule` in a app):
7676

77+
:::info
78+
Note: `imports`, `declarations`, and `providers` options do not work with `standalone` components as they are set within the test `ngModule`. This is the default behavior in Angular 19.
79+
:::
80+
7781
```ts
7882
cy.mount(ComponentThatFetchesData, {
7983
imports: [HttpClientModule],
@@ -213,10 +217,13 @@ in the future
213217

214218
### Signals
215219

216-
With the releases of Angular versions [17.1](https://github.com/angular/angular/blob/main/CHANGELOG.md#1710-2024-01-17) and [17.2](https://github.com/angular/angular/blob/main/CHANGELOG.md#1720-2024-02-14), [input](https://github.com/angular/angular/pull/53521) and [model](https://github.com/angular/angular/pull/54252) signals were introduced into the `@angular/core` API.
217-
Since signals introduced new methods and types to the core API, Cypress introduced a new test harness, `@cypress/angular-signals`.
220+
With the releases of Angular versions [17.1](https://github.com/angular/angular/blob/main/CHANGELOG.md#1710-2024-01-17) and [17.2](https://github.com/angular/angular/blob/main/CHANGELOG.md#1720-2024-02-14), [input](https://github.com/angular/angular/pull/53521) and [model](https://github.com/angular/angular/pull/54252) signals were introduced into the `@angular/core` API. Though basic signals were introduced in Angular `16`, using all signals requires Angular `17.2` and above.
218221

219-
Though basic signals were introduced in Angular `16`, this testing harness requires Angular `17.2` and above.
222+
:::info
223+
224+
With Cypress 14, signal support is directly included in the `cypress/angular` testing harness.
225+
226+
:::
220227

221228
For the below examples, we'll be working with a very simple component called `TestComponent`, which looks something like shown below:
222229

@@ -273,7 +280,7 @@ cy.get('[data-cy="test-component-title-display"]').should(
273280
```
274281

275282
:::info
276-
Under the hood, Cypress wraps the generic value in a writable `signal()` and merges it into the prop. In other words, the `@cypress/angular-signals` test harness in this example is really:
283+
Under the hood, Cypress wraps the generic value in a writable `signal()` and merges it into the prop. In other words, this example is really:
277284

278285
```typescript
279286
cy.mount(TestComponent, {

Diff for: docs/app/component-testing/angular/overview.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sidebar_label: Overview
2020

2121
## Framework Support
2222

23-
Cypress Component Testing supports Angular 13+.
23+
Cypress Component Testing supports Angular 17.2.0+.
2424

2525
## Tutorial
2626

@@ -124,5 +124,5 @@ export default {
124124

125125
#### Sample Angular Apps
126126

127-
- [Angular 14](https://github.com/cypress-io/cypress-component-testing-apps/tree/main/angular)
128-
- [Angular 16 Standalone](https://github.com/cypress-io/cypress-component-testing-apps/tree/main/angular-standalone)
127+
- [Angular 18](https://github.com/cypress-io/cypress-component-testing-apps/tree/main/angular)
128+
- [Angular 19 Standalone](https://github.com/cypress-io/cypress-component-testing-apps/tree/main/angular-standalone)

0 commit comments

Comments
 (0)