You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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', () => {
179
198
})
180
199
```
181
200
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
+
:::
183
208
184
209
You might find yourself repeatedly creating a `cy.spy()` for each of your
185
210
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.
208
233
209
234
:::
210
235
211
-
:::caution
212
-
213
-
`autoSpyOutput` is an **experimental feature** and could be removed or changed
214
-
in the future
215
-
216
-
:::
217
-
218
236
### Signals
219
237
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
-
222
238
:::info
223
239
224
240
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
434
450
`ButtonComponent` and `CardComponent` as declarations into each `cy.mount()`
435
451
call.
436
452
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
+
:::
438
460
439
461
Here is an example of defaulting `autoSpyOutputs` for every mounted component:
Copy file name to clipboardExpand all lines: docs/app/component-testing/angular/overview.mdx
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,12 @@ sidebar_label: Overview
20
20
21
21
## Framework Support
22
22
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`.
24
24
25
25
:::info
26
26
27
27
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`.
@@ -26,6 +26,119 @@ inform your testing strategy, and ship high-quality code with confidence.
26
26
27
27
:::
28
28
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:
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:
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
+
29
142
## Actionability
30
143
31
144
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
71
184
above steps. You will usually get an error explaining why the element was not
72
185
found to be actionable.
73
186
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
-
113
187
### Disability
114
188
115
189
Cypress checks whether the `disabled` property is `true` on a
Copy file name to clipboardExpand all lines: docs/app/references/assertions.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,6 +258,14 @@ Watch the short video
258
258
["Multiple elements and should('be.visible') assertion"](https://www.youtube.com/watch?v=LxkrhUEE2Qk)
259
259
that shows how to correctly check the visibility of elements.
260
260
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).
Copy file name to clipboardExpand all lines: docs/app/references/changelog.mdx
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,34 @@ sidebar_label: Changelog
8
8
9
9
# Changelog
10
10
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).
0 commit comments