Skip to content

Commit b84dd3f

Browse files
AtofStrykermschilecacieprins
authored
chore: release 15.8.0 documentation (#6330)
* chore: add basic entry for cypress 15.8.0 * chore: add angular 21 documentation (#6326) * doc: add docs for synchronous XHR requests (#6332) * Experimental fast visibility (#6337) * initial experiment documentation * add default & fast visibility semantics, cross-reference links * add history entry to experiments page * add link to github issue for the experimental fast visibility experiment * add note that scrolling is a future enhancement/fix * edit pass * another edit pass --------- Co-authored-by: Bill Glesias <bglesias@gmail.com> * chore: add 15.8.0 changelog (#6339) --------- Co-authored-by: Matt Schile <mschile@cypress.io> Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>
1 parent 1fd6f14 commit b84dd3f

File tree

9 files changed

+315
-61
lines changed

9 files changed

+315
-61
lines changed

docs/app/component-testing/angular/api.mdx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ sidebar_label: API
1313

1414
### mount
1515

16+
```js
17+
// for Angular 20 and 21 using zoneless configuration
18+
import { mount } from 'cypress/angular-zoneless'
19+
```
20+
1621
```js
1722
import { mount } from 'cypress/angular'
1823
```
@@ -142,18 +147,22 @@ providers, declarations, imports and even component @Inputs()
142147
<td>Description</td>
143148
</thead>
144149
<tr>
145-
<td>autoSpyOutputs</td>
150+
<td>autoSpyOutputs (deprecated)</td>
146151
<td>boolean (optional)</td>
147152
<td>
148153
flag to automatically create a cy.spy() for every component @Output()
149-
property
154+
property. This is deprecated and not supported in
155+
`cypress/angular-zoneless` and will be removed in a future version
150156
</td>
151157
</tr>
152158
<tr>
153-
<td>autoDetectChanges</td>
159+
<td>autoDetectChanges (deprecated)</td>
154160
<td>boolean (optional)</td>
155161
<td>
156-
flag defaulted to true to automatically detect changes in your components
162+
flag defaulted to true to automatically detect changes in your components.
163+
This is deprecated and not supported in `cypress/angular-zoneless` and
164+
will be removed in a future version as it is not needed with zoneless
165+
configuration
157166
</td>
158167
</tr>
159168
<tr>

docs/app/component-testing/angular/examples.mdx

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ in the options:
4646
cy.mount(StepperComponent, {
4747
componentProperties: {
4848
count: 100,
49-
change: new EventEmitter(),
5049
},
5150
})
5251
```
@@ -157,6 +156,26 @@ it('clicking + fires a change event with the incremented value', () => {
157156
})
158157
```
159158

159+
### Working with Legacy @Input() Decorators
160+
161+
With the release of Angular 18, [signals](https://angular.dev/guide/signals) became the preferred way to handle data binding.
162+
However, legacy components that use `@Input()` and `@Output()` decorators are still supported.
163+
164+
Interacting with legacy `@Input()` decorators is a bit different than working with signals.
165+
In order to update the `@Input()` value, you need to use the `componentRef.setInput` method so Angular change detection runs properly.
166+
Otherwise, you may see errors.
167+
168+
```ts
169+
cy.mount(StepperComponent, { componentProperties: { count: 100 } })
170+
.then(({ fixture }) => {
171+
return cy.contains('span', '100').wrap(fixture)
172+
})
173+
.then((fixture) => {
174+
fixture.componentRef.setInput('count', 110)
175+
return cy.contains('span', '110')
176+
})
177+
```
178+
160179
### Using createOutputSpy()
161180

162181
To make spying on event emitters easier, there is a utility function called
@@ -179,7 +198,13 @@ it('clicking + fires a change event with the incremented value', () => {
179198
})
180199
```
181200

182-
### Using autoSpyOutputs
201+
### Using autoSpyOutputs (deprecated)
202+
203+
:::caution
204+
205+
The `autoSpyOutputs` flag is deprecated and not supported in `cypress/angular-zoneless` and will be removed in a future version.
206+
207+
:::
183208

184209
You might find yourself repeatedly creating a `cy.spy()` for each of your
185210
component outputs. Because of this, we created an easy mechanism to handle this
@@ -208,17 +233,8 @@ function. It currently does not work with the template syntax.
208233

209234
:::
210235

211-
:::caution
212-
213-
`autoSpyOutput` is an **experimental feature** and could be removed or changed
214-
in the future
215-
216-
:::
217-
218236
### Signals
219237

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.
221-
222238
:::info
223239

224240
With Cypress 14, signal support is directly included in the `cypress/angular` testing harness.
@@ -434,7 +450,13 @@ This custom mount command will allow you to skip manually passing in the
434450
`ButtonComponent` and `CardComponent` as declarations into each `cy.mount()`
435451
call.
436452

437-
### autoSpyOutputs
453+
### autoSpyOutputs (deprecated)
454+
455+
:::caution
456+
457+
The `autoSpyOutputs` flag is deprecated and not supported in `cypress/angular-zoneless` and will be removed in a future version.
458+
459+
:::
438460

439461
Here is an example of defaulting `autoSpyOutputs` for every mounted component:
440462

docs/app/component-testing/angular/overview.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ sidebar_label: Overview
2020

2121
## Framework Support
2222

23-
Cypress Component Testing supports Angular `^18.0.0`, `^19.0.0`, and `^20.0.0`.
23+
Cypress Component Testing supports Angular `^18.0.0`, `^19.0.0`, `^20.0.0`, and `^21.0.0`.
2424

2525
:::info
2626

2727
Our testing harness, `cypress/angular`, still requires `zone.js` and `@angular-devkit/build-angular` to be installed in your project, even if your project is zoneless or is built with `@angular/build`.
28+
If you wish to use the zoneless configuration, which is the default in Angular 21, you can use `cypress/angular-zoneless` testing harness instead as of Cypress `15.8.0`.
2829
:::
2930

3031
## Tutorial
@@ -129,5 +130,5 @@ export default {
129130

130131
#### Sample Angular Apps
131132

132-
- [Angular 18](https://github.com/cypress-io/cypress-component-testing-apps/tree/main/angular)
133133
- [Angular 20 Standalone](https://github.com/cypress-io/cypress-component-testing-apps/tree/main/angular-standalone)
134+
- [Angular 21 Zoneless](https://github.com/cypress-io/cypress-component-testing-apps/tree/main/angular-zoneless)

docs/app/component-testing/get-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ following development servers and frameworks:
4747
| [Next.js 14-16](/app/component-testing/react/overview#Nextjs) | React 18-19 | Webpack 5 |
4848
| [Vue with Vite](/app/component-testing/vue/overview#Vue-with-Vite) | Vue 3 | Vite 5-7 |
4949
| [Vue with Webpack](/app/component-testing/vue/overview#Vue-with-Webpack) | Vue 3 | Webpack 5 |
50-
| [Angular](/app/component-testing/angular/overview#Framework-Configuration) | Angular 18-20 | Webpack 5 |
50+
| [Angular](/app/component-testing/angular/overview#Framework-Configuration) | Angular 18-21 | Webpack 5 |
5151
| [Svelte with Vite](/app/component-testing/svelte/overview#Svelte-with-Vite) <Badge type="info">Alpha</Badge> | Svelte 5 | Vite 5-7 |
5252
| [Svelte with Webpack](/app/component-testing/svelte/overview#Svelte-with-Webpack) <Badge type="info">Alpha</Badge> | Svelte 5 | Webpack 5 |
5353

docs/app/core-concepts/interacting-with-elements.mdx

Lines changed: 113 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,119 @@ inform your testing strategy, and ship high-quality code with confidence.
2626

2727
:::
2828

29+
## Visibility
30+
31+
### Default Behavior
32+
33+
Cypress checks a lot of things to determine an element's visibility. The
34+
following calculations factor in CSS translations and transforms.
35+
36+
#### An element is considered hidden if:
37+
38+
- Its `width` or `height` is `0`.
39+
- Its CSS property (or ancestors) is `visibility: hidden`.
40+
- Its CSS property (or ancestors) is `display: none`.
41+
- Its CSS property is `position: fixed` and it's offscreen or covered up.
42+
- Any of its ancestors **hides overflow**\*
43+
- AND that ancestor has a `width` or `height` of `0`
44+
- AND an element between that ancestor and the element is `position: absolute`
45+
- Any of its ancestors **hides overflow**\*
46+
- AND that ancestor or an ancestor between it and that ancestor is its offset
47+
parent
48+
- AND it is positioned outside that ancestor's bounds
49+
- Any of its ancestors **hides overflow**\*
50+
- AND the element is `position: relative`
51+
- AND it is positioned outside that ancestor's bounds
52+
53+
\***hides overflow** means it has `overflow: hidden`, `overflow-x: hidden`,
54+
`overflow-y: hidden`, `overflow: scroll`, or `overflow: auto`
55+
56+
:::info
57+
58+
<strong>Opacity</strong>
59+
60+
Elements where the CSS property (or ancestors) is `opacity: 0` are considered
61+
hidden when
62+
[asserting on the element's visibility directly](/app/references/assertions#Visibility).
63+
64+
However elements where the CSS property (or ancestors) is `opacity: 0` are
65+
considered actionable and any commands used to interact with the hidden element
66+
will perform the action.
67+
68+
:::
69+
70+
### Experimental Fast Visibility
71+
72+
You can enable a faster visibility detection algorithm using [`experimentalFastVisibility`](/app/references/experiments#Experimental-Fast-Visibility).
73+
74+
This algorithm is more accurate and less resource-intensive than the default behavior, but it has slightly different semantics.
75+
76+
When `experimentalFastVisibility` is enabled, an element is considered hidden if:
77+
78+
- Its `width` or `height` is `0`
79+
- Its computed CSS properties prevent it from being clicked on or visible:
80+
- `visibility: hidden`
81+
- `opacity: 0`
82+
- `display: none`
83+
- `pointer-events: none`
84+
- It is positioned fully outside of the browser viewport
85+
- _this is a known compatibility issue with the legacy visibility algorithm_ when it comes to asserting visibility. It will be addressed during the course of this experiment.
86+
- It is fully covered or clipped by another element
87+
88+
Keep up-to-date with the the progress of this experiment in the [Cypress repository](https://github.com/cypress-io/cypress/issues/33043).
89+
90+
#### Limitations
91+
92+
Experimental fast visibility is an experimental feature that is still under development. It uses different semantics from the legacy visibility algorithm, and does not yet fully support all testing scenarios.
93+
94+
- Shadow DOM is not yet supported. Tests that interact with Shadow DOM elements may fail or behave incorrectly.
95+
- Elements outside of the browser's viewport are not yet correctly identified as visible. Scroll elements into view before testing.
96+
97+
#### Common Compatibility Issues
98+
99+
When enabling fast visibility, you may encounter differences in how elements are detected. The fast algorithm provides more geometrically accurate visibility detection, which may reveal that elements previously considered visible are actually hidden.
100+
101+
**Elements Outside Viewport**
102+
103+
Elements positioned outside the viewport are now correctly identified as hidden. Scroll elements into view before testing:
104+
105+
```javascript
106+
// Before
107+
cy.get('.off-screen-element').should('be.visible')
108+
109+
// After
110+
cy.get('.off-screen-element').scrollIntoView().should('be.visible')
111+
```
112+
113+
**Covered Elements**
114+
115+
Elements covered by other elements are now correctly identified as hidden. Test the covering element or the user interaction that reveals the covered element:
116+
117+
```javascript
118+
// Test the user action that reveals the element
119+
cy.get('.toggle-button').click()
120+
cy.get('.covered-element').should('be.visible')
121+
```
122+
123+
**Zero-Dimension Containers**
124+
125+
Containers with zero dimensions are now correctly identified as hidden. Test the child element instead of the container:
126+
127+
```javascript
128+
// Test the child element that should be visible
129+
cy.get('.zero-dimension-container .child-element').should('be.visible')
130+
```
131+
132+
**Elements with `pointer-events: none`**
133+
134+
Elements with `pointer-events: none` may be detected as hidden when they are visible. Do not assert visibility on elements with `pointer-events: none`, as they cannot be interacted with.
135+
136+
:::caution
137+
138+
**Important:** If tests fail after enabling fast visibility, the fast algorithm is likely correct and tests should be updated to match the actual behavior.
139+
140+
:::
141+
29142
## Actionability
30143

31144
Some commands in Cypress are for interacting with the DOM such as:
@@ -71,45 +184,6 @@ Whenever Cypress cannot interact with an element, it could fail at any of the
71184
above steps. You will usually get an error explaining why the element was not
72185
found to be actionable.
73186

74-
### Visibility
75-
76-
Cypress checks a lot of things to determine an element's visibility. The
77-
following calculations factor in CSS translations and transforms.
78-
79-
#### An element is considered hidden if:
80-
81-
- Its `width` or `height` is `0`.
82-
- Its CSS property (or ancestors) is `visibility: hidden`.
83-
- Its CSS property (or ancestors) is `display: none`.
84-
- Its CSS property is `position: fixed` and it's offscreen or covered up.
85-
- Any of its ancestors **hides overflow**\*
86-
- AND that ancestor has a `width` or `height` of `0`
87-
- AND an element between that ancestor and the element is `position: absolute`
88-
- Any of its ancestors **hides overflow**\*
89-
- AND that ancestor or an ancestor between it and that ancestor is its offset
90-
parent
91-
- AND it is positioned outside that ancestor's bounds
92-
- Any of its ancestors **hides overflow**\*
93-
- AND the element is `position: relative`
94-
- AND it is positioned outside that ancestor's bounds
95-
96-
\***hides overflow** means it has `overflow: hidden`, `overflow-x: hidden`,
97-
`overflow-y: hidden`, `overflow: scroll`, or `overflow: auto`
98-
99-
:::info
100-
101-
<strong>Opacity</strong>
102-
103-
Elements where the CSS property (or ancestors) is `opacity: 0` are considered
104-
hidden when
105-
[asserting on the element's visibility directly](/app/references/assertions#Visibility).
106-
107-
However elements where the CSS property (or ancestors) is `opacity: 0` are
108-
considered actionable and any commands used to interact with the hidden element
109-
will perform the action.
110-
111-
:::
112-
113187
### Disability
114188

115189
Cypress checks whether the `disabled` property is `true` on a

docs/app/references/assertions.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@ Watch the short video
258258
["Multiple elements and should('be.visible') assertion"](https://www.youtube.com/watch?v=LxkrhUEE2Qk)
259259
that shows how to correctly check the visibility of elements.
260260

261+
:::info
262+
263+
**Visibility Semantics**
264+
265+
For detailed information about how Cypress determines element visibility, including the default behavior and the experimental fast visibility algorithm, see [Visibility](/app/core-concepts/interacting-with-elements#Visibility).
266+
267+
:::
268+
261269
### Existence
262270

263271
```javascript

docs/app/references/changelog.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,34 @@ sidebar_label: Changelog
88

99
# Changelog
1010

11+
## 15.8.0
12+
13+
_Released 12/16/2025_
14+
15+
**Performance:**
16+
17+
- Introduced a new `experimentalFastVisibility` experiment. Enabling this experiment changes how Cypress performs visibility checks and assertions. Read more about [experimental fast visibility](/app/references/experiments#Experimental-Fast-Visibility). Addresses [#33044](https://github.com/cypress-io/cypress/issues/33044). Addressed in [#32801](https://github.com/cypress-io/cypress/pull/32801).
18+
19+
**Features:**
20+
21+
- `Angular` version 21 is now supported within component testing. Addressed in [#33004](https://github.com/cypress-io/cypress/pull/33004).
22+
- Adds zoneless support for `Angular` Component Testing through the `angular-zoneless` mount function. Addresses [#31504](https://github.com/cypress-io/cypress/issues/31504) and [#30070](https://github.com/cypress-io/cypress/issues/30070).
23+
- After receiving feedback on its usefulness outside of Studio, the Selector Playground is now available for all users in open mode. When opened, the playground automatically enables interactive mode to help you build and test selectors directly in your application. Addresses [#32672](https://github.com/cypress-io/cypress/issues/32672). Addressed in [#33073](https://github.com/cypress-io/cypress/pull/33073).
24+
25+
**Bugfixes:**
26+
27+
- Fixed an issue where a EPIPE error shows up after CTRL+C is done in terminal. Fixes [#30659](https://github.com/cypress-io/cypress/issues/30659). Addressed in [#32873](https://github.com/cypress-io/cypress/pull/32873).
28+
- Fixed an issue where the browser would freeze when Cypress intercepts a synchronous XHR request and a `routeHandler` is used. Fixes [#32874](https://github.com/cypress-io/cypress/issues/32874). Addressed in [#32925](https://github.com/cypress-io/cypress/pull/32925).
29+
- Fixed an issue where `Next.js` Component Testing would not load correctly without a TypeScript-based Next config in versions 16.0.3 and up. Fixes [#32968](https://github.com/cypress-io/cypress/issues/32968).
30+
- Fixed an issue where the error message for `not.have.length` was not correctly displaying the expected length in the Command Log. Addressed in [#18927](https://github.com/cypress-io/cypress/issues/18927).
31+
- Fixed an issue where `removeAttribute()` would not work for attributes other than `target` on anchor or form elements after clicking links with `target="_top"` or `target="_parent"`. Fixes [#26206](https://github.com/cypress-io/cypress/issues/26206). Addressed in [#33051](https://github.com/cypress-io/cypress/pull/33051).
32+
33+
**Dependency Updates:**
34+
35+
- Removed extraneous dependencies that are no longer used. Addressed in [#33098](https://github.com/cypress-io/cypress/pull/33098).
36+
- Upgraded `brace-expansion`. This removes the [CVE-2025-5889](https://security.snyk.io/vuln/SNYK-JS-BRACEEXPANSION-9789073) vulnerability being reported in security scans. Addressed in [#33112](https://github.com/cypress-io/cypress/pull/33112).
37+
- Upgraded `form-data`. This removes the [CVE-2025-7783](https://security.snyk.io/vuln/SNYK-JS-FORMDATA-10841150) vulnerability being reported in security scans. Addressed in [#33113](https://github.com/cypress-io/cypress/pull/33113).
38+
1139
## 15.7.1
1240

1341
_Released 12/02/2025_

0 commit comments

Comments
 (0)