Skip to content

Commit 9579880

Browse files
Merge branch 'release/15.0.0' into glibc-electron-36
2 parents 42d36e0 + 0df7c38 commit 9579880

File tree

9 files changed

+311
-9
lines changed

9 files changed

+311
-9
lines changed

docs/api/cypress-api/element-selector-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const $el = Cypress.$('button')
8383
const selector = Cypress.ElementSelector.getSelector($el) // '#bingo'
8484
```
8585

86-
With a custom selector strategy that favours classes, the selector value will be
86+
With a custom selector strategy that favors classes, the selector value will be
8787
`'.number3'`.
8888

8989
```js

docs/app/get-started/install-cypress.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ Cypress requires [Node.js](https://nodejs.org/) in order to install. We support
120120

121121
Cypress generally aligns with
122122
[Node's release schedule](https://github.com/nodejs/Release).
123-
Accordingly, use of Node.js 18 and 23 with Cypress is deprecated and support is planned for removal in a future release of Cypress.
124123

125124
#### Installing Node.js
126125

docs/app/guides/cypress-studio.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ e2eSpecific: true
2121

2222
## Overview
2323

24-
Cypress Studio makes test creation faster and easier. With Studio, you can record user interactions in the browser and instantly generate Cypress test code. Add assertions with a rightclick and fine-tune your tests inline.
24+
Cypress Studio makes test creation faster and easier. With Studio, you can record user interactions in the browser and instantly generate Cypress test code. Add assertions with a right-click and fine-tune your tests inline.
2525

2626
It is ideal for bootstrapping new tests or extending existing ones without writing every `.get()`, `.click()`, or `.type()` command by hand.
2727

docs/app/references/changelog.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@ sidebar_label: Changelog
1010

1111
## 15.0.0
1212

13-
_Released 7/01/2025 (PENDING)_
13+
_Released 7/22/2025 (PENDING)_
14+
15+
## 14.5.1
16+
17+
_Released 7/01/2025_
18+
19+
**Bugfixes:**
20+
21+
- Fixed an issue where prerequests with Firefox BiDi were prematurely being removed or matched incorrectly. Addresses [#31482](https://github.com/cypress-io/cypress/issues/31482).
22+
23+
**Dependency Updates:**
24+
25+
- Updated `pbkdf2` from `3.1.2` to `3.1.3`. This removes the [SNYK-JS-PBKDF2-10495498](https://security.snyk.io/vuln/SNYK-JS-PBKDF2-10495498) vulnerability being reported in security scans. Addressed in [#31941](https://github.com/cypress-io/cypress/pull/31941).
1426

1527
## 14.5.0
1628

docs/app/references/migration-guide.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ This guide details the code changes needed to migrate to Cypress
1414
version 15.
1515
[See the full changelog for version v15.0](/app/references/changelog#15-0-0).
1616

17-
### Node.js 20 and 22+ support
17+
### Node.js 20, 22 and 24+ support
1818

19-
Cypress requires [Node.js](https://nodejs.org/en) in order to install the Cypress binary and the supported versions are now Node.js 20 and 22+.
19+
Cypress requires [Node.js](https://nodejs.org/en) in order to install the Cypress binary and the supported versions are now Node.js 20, 22, 24 and above.
2020
Node.js versions 18 and 23 are no longer supported.
2121
[See Node's release schedule](https://github.com/nodejs/Release).
2222

@@ -31,7 +31,7 @@ To display which version of glibc your Linux system is running, execute `ldd --v
3131

3232
### Webpack `4` is no longer supported
3333

34-
Cypress is no longer supporting Webpack `4` as it is no longer maintained by the core Webpack team and Webpack `5` has been available since Q4 2020. This includes Webpack `4` support for:
34+
Cypress is no longer supporting Webpack `4` as it is no longer maintained by the core Webpack team and Webpack `5` has been available since Q4 2020. This includes dropping Webpack `4` support for:
3535

3636
- `@cypress/webpack-dev-server` for component testing. This use case is most common and will require an update to Webpack `5`.
3737
- `@cypress/webpack-dev-server` also no longer supports [Webpack Dev Server v4](https://github.com/webpack/webpack-dev-server/tree/v4.15.2). We shipped [Webpack Dev Server v5](https://github.com/webpack/webpack-dev-server/tree/v5.2.1) as the default in Cypress 14 with `webpack-dev-server@4` being an option.
@@ -66,7 +66,7 @@ export default defineConfig({
6666
})
6767
```
6868

69-
Note that this package version is deprecated and no longer supported by Cypress and is intended as a workaround until you can migrate to Webpack `5`. More information on how to configure the dev server can be found in the [Cypress Webpack Dev Server documentation](https://github.com/cypress-io/cypress/blob/@cypress/webpack-dev-server-v4.0.2/npm/webpack-dev-server/README.md) and [Custom Dev Server documentation](/app/component-testing/component-framework-configuration#Custom-Dev-Server).
69+
Note that this package version is deprecated and no longer supported by Cypress and is intended as a workaround until you can migrate to Webpack `5`. More information on how to configure the dev server `v4 `can be found in the [Cypress Webpack Dev Server documentation](https://github.com/cypress-io/cypress/blob/@cypress/webpack-dev-server-v4.0.2/npm/webpack-dev-server/README.md) and [Custom Dev Server documentation](/app/component-testing/component-framework-configuration#Custom-Dev-Server).
7070

7171
##### End-to-End Testing
7272

@@ -127,7 +127,7 @@ module.exports = (on) => {
127127

128128
### Angular `17` CT no longer supported
129129

130-
With [LTS ending](https://angular.dev/reference/releases#actively-supported-versions) for Angular 17, the minimum required Angular version for component testing is now `18.0.0`.
130+
With [LTS end](https://angular.dev/reference/releases#actively-supported-versions) for Angular 17, the minimum required Angular version for component testing is now `18.0.0`.
131131

132132
#### To continue using Angular below 18.0.0
133133

docs/ui-coverage/changelog.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ sidebar_position: 200
99

1010
# Changelog
1111

12+
## Week of 6/23/25
13+
14+
UI Coverage now supports defining custom commands that will count towards coverage scores, restricting which kinds of interactions are allowed for certain elements, and including assertions in the UI Coverage calculations. See the following new properties for more details:
15+
16+
- [`additionalInteractionCommands`](/ui-coverage/configuration/additionalinteractioncommands)
17+
- [`allowedInteractionCommands`](/ui-coverage/configuration/allowedinteractioncommands)
18+
1219
## Week of 5/26/2025
1320

1421
- Launched AI-powered Test Generation in Cypress Cloud, to help you quickly add tests for the untested elements detected in UI Coverage reports, in a way that follows your existing practices and conventions. For more details, read [our blog post](https://www.cypress.io/blog/add-your-missing-tests-faster-with-test-generation-in-ui-coverage).
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: 'Additional Interaction Commands | Cypress UI Coverage'
3+
description: 'The `additionalInteractionCommands` configuration property allows users to extend the default set of interaction command types recognized by UI Coverage.'
4+
sidebar_label: additionalInteractionCommands
5+
sidebar_position: 90
6+
---
7+
8+
<ProductHeading product="ui-coverage" />
9+
10+
# additionalInteractionCommands
11+
12+
UI Coverage automatically tracks how elements are used in tests using a predefined set of [Cypress interaction commands](/ui-coverage/core-concepts/interactivity#Interaction-Commands) such as `click`, `type`, `dblclick`, and more.
13+
14+
The `additionalInteractionCommands` configuration allows you to extend this default set. You can specify custom command types that should also be recognized as interactions, which can increase the range of actions that are counted towards UI Coverage
15+
16+
## Why use additionalInteractionCommands?
17+
18+
- **Custom command support**: Track interactions from custom Cypress commands that aren't included in the default set.
19+
- **Third-party library support**: Ensure interactions from third-party testing libraries (such as [`cypress-real-events`](#Adding-third-party-library-commands)) are properly recognized and tracked.
20+
- **Enhanced reporting**: Improve the accuracy of your UI Coverage reports by including all relevant interaction types.
21+
22+
## Syntax
23+
24+
```json
25+
{
26+
"uiCoverage": {
27+
"additionalInteractionCommands": [
28+
string
29+
]
30+
}
31+
}
32+
```
33+
34+
### Options
35+
36+
The `additionalInteractionCommands` property accepts an array of strings, where each string represents a command name that should be treated as an interaction command by UI Coverage.
37+
38+
| Option | Required | Default | Description |
39+
| ------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
40+
| `additionalInteractionCommands` | Optional | `[]` | An array of command names (strings) that should be recognized as interaction commands in addition to the defaults. |
41+
42+
## Examples
43+
44+
### Adding custom interaction commands
45+
46+
#### Config
47+
48+
```json
49+
{
50+
"uiCoverage": {
51+
"additionalInteractionCommands": ["customClick", "dragAndDrop", "swipeLeft"]
52+
}
53+
}
54+
```
55+
56+
#### Usage in tests
57+
58+
```javascript
59+
// These custom commands will now be tracked as interactions
60+
cy.get('[data-testid="submit-button"]').customClick()
61+
cy.get('[data-testid="draggable"]').dragAndDrop()
62+
cy.get('[data-testid="carousel"]').swipeLeft()
63+
```
64+
65+
### Adding third-party library commands
66+
67+
#### Config
68+
69+
```json
70+
{
71+
"uiCoverage": {
72+
"additionalInteractionCommands": ["realClick", "realType", "realHover"]
73+
}
74+
}
75+
```
76+
77+
#### Usage in tests
78+
79+
```javascript
80+
// Commands from cypress-real-events plugin will be tracked
81+
cy.get('[data-cy="button"]').realClick()
82+
cy.get('[data-cy="input"]).realType('Hello World')
83+
cy.get('[data-cy="tooltip-trigger"]').realHover()
84+
```
85+
86+
## Notes
87+
88+
- Command names are case-sensitive and must match exactly as they appear in your test code.
89+
- The additional commands are merged with the default interaction commands, the default commands are not replaced.
90+
- Only commands that actually interact with DOM elements should be included in this configuration.
91+
- Custom commands must log a snapshot that references the subject element. This ensures that the command renders element highlights in Cypress open mode/Test Replay, and also ensures that UI Coverage can properly attribute the interaction to the expected element. More information regarding Custom Commands can be found [here](/api/cypress-api/custom-commands).
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
title: 'Allowed Interaction Commands | Cypress UI Coverage'
3+
description: 'The `allowedInteractionCommands` configuration property allows users to limit the interaction commands that are tracked for specific elements in UI Coverage.'
4+
sidebar_label: allowedInteractionCommands
5+
sidebar_position: 100
6+
---
7+
8+
<ProductHeading product="ui-coverage" />
9+
10+
# allowedInteractionCommands
11+
12+
UI Coverage tracks all interaction commands by default for comprehensive coverage reporting. The `allowedInteractionCommands` configuration allows you to limit which interaction commands are tracked for specific elements by defining rules based on CSS selectors.
13+
14+
This is particularly useful for filtering out irrelevant interactions or focusing coverage tracking on specific interaction patterns for different types of elements.
15+
16+
## Why use allowedInteractionCommands?
17+
18+
- **Focused tracking**: Limit coverage tracking to relevant interaction types for specific elements or components to reduce noise in reports.
19+
- **Component-specific rules**: Apply different interaction tracking rules based on element types or component categories. For example, you may require specific kinds of interactions on complex data-visualization components that are not required in regular interactive elements.
20+
21+
## Syntax
22+
23+
```json
24+
{
25+
"uiCoverage": {
26+
"allowedInteractionCommands": [
27+
{
28+
"selector": string,
29+
"commands": [string]
30+
}
31+
]
32+
}
33+
}
34+
```
35+
36+
### Options
37+
38+
The `allowedInteractionCommands` property accepts an array of objects, where each object defines a rule for limiting interaction commands for elements matching a specific selector.
39+
40+
| Option | Required | Default | Description |
41+
| ---------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
42+
| `selector` | Required | | A CSS selector to identify elements. Supports standard CSS selector syntax, including IDs, classes, attributes, and combinators. |
43+
| `commands` | Required | | An array of command names (strings) that should be tracked as interactions for elements matching the selector. All other interaction commands will be ignored for these elements. |
44+
45+
## Examples
46+
47+
### Limiting button interactions to clicks only
48+
49+
#### Config
50+
51+
```json
52+
{
53+
"uiCoverage": {
54+
"allowedInteractionCommands": [
55+
{
56+
"selector": "button, [role='button']",
57+
"commands": ["click", "realClick"]
58+
}
59+
]
60+
}
61+
}
62+
```
63+
64+
#### Usage in tests
65+
66+
```javascript
67+
// Only click and realClick will be tracked for buttons
68+
cy.get('[data-cy="submit-button"]').click() // ✓ Tracked
69+
cy.get('[data-cy="submit-button"]').realClick() // ✓ Tracked
70+
cy.get('[data-cy="submit-button"]').hover() // ✗ Not tracked
71+
cy.get('[data-cy="submit-button"]').focus() // ✗ Not tracked
72+
```
73+
74+
### Different rules for form elements
75+
76+
#### Config
77+
78+
```json
79+
{
80+
"uiCoverage": {
81+
"allowedInteractionCommands": [
82+
{
83+
"selector": "input[type='text'], textarea",
84+
"commands": ["type", "clear", "realType"]
85+
},
86+
{
87+
"selector": "select",
88+
"commands": ["select", "click"]
89+
},
90+
{
91+
"selector": "input[type='checkbox'], input[type='radio']",
92+
"commands": ["check", "uncheck", "click"]
93+
}
94+
]
95+
}
96+
}
97+
```
98+
99+
#### Usage in tests
100+
101+
```javascript
102+
// Text inputs: only type, clear, and realType are tracked
103+
cy.get('[data-cy="username"]').type('john_doe') // ✓ Tracked
104+
cy.get('[data-cy="username"]').clear() // ✓ Tracked
105+
cy.get('[data-cy="username"]').focus() // ✗ Not tracked
106+
107+
// Select elements: only select and click are tracked
108+
cy.get('[data-cy="country"]').select('US') // ✓ Tracked
109+
cy.get('[data-cy="country"]').click() // ✓ Tracked
110+
cy.get('[data-cy="country"]').hover() // ✗ Not tracked
111+
112+
// Checkboxes/Radio buttons: check, uncheck, and click are tracked
113+
cy.get('[data-cy="agree-terms"]').check() // ✓ Tracked
114+
cy.get('[data-cy="agree-terms"]').click() // ✓ Tracked
115+
```
116+
117+
### Excluding hover interactions for mobile components
118+
119+
#### Config
120+
121+
```json
122+
{
123+
"uiCoverage": {
124+
"allowedInteractionCommands": [
125+
{
126+
"selector": "[data-mobile='true']",
127+
"commands": ["click", "tap", "swipe", "type"]
128+
}
129+
]
130+
}
131+
}
132+
```
133+
134+
#### Usage in tests
135+
136+
```javascript
137+
// Mobile components: hover interactions are excluded
138+
cy.get('[data-mobile="true"][data-cy="menu-item"]').click() // ✓ Tracked
139+
cy.get('[data-mobile="true"][data-cy="menu-item"]').tap() // ✓ Tracked
140+
cy.get('[data-mobile="true"][data-cy="menu-item"]').hover() // ✗ Not tracked
141+
```
142+
143+
### Allowing assertions as interactions
144+
145+
Note that because `allowedInteractionCommands` replaces the allowed interactions, if you add `assert` as an interaction, remember to also add any other acceptable interactions to the list.
146+
147+
#### Config
148+
149+
```json
150+
{
151+
"uiCoverage": {
152+
"additionalInteractionCommands": [
153+
{
154+
"selector": "button[data-no-explicit-interaction='true']",
155+
"commands": ["assert"]
156+
}
157+
]
158+
}
159+
}
160+
```
161+
162+
#### Usage in tests
163+
164+
```javascript
165+
// Any assertions on matching elements are tracked
166+
cy.get('button[data-no-explicit-interaction="true"]').should('exist) // ✓ Tracked
167+
cy.get('button[data-no-explicit-interaction="true"]').should('be.visible) // ✓ Tracked
168+
cy.get('button[data-no-explicit-interaction="true"]').click() // ✗ Not tracked
169+
```
170+
171+
## Notes
172+
173+
- Elements that don't match any selector will have all interaction commands tracked (default behavior).
174+
- If an element matches multiple selectors, commands from all matching rules will be allowed. A high degree of specificity for these selectors is recommended.
175+
- Command names are case-sensitive and must match exactly as they appear in your test code.
176+
- This configuration works separately from `additionalInteractionCommands`. Custom commands do **not** need to be globally defined as `additionalInteractionCommands` in order to be declared here.

docs/ui-coverage/configuration/overview.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ Configuration enables you to customize and fine-tune UI Coverage in Cypress to s
1313

1414
**Note**: By default, setting configuration is limited to Admin users. At your request, this can be changed to allow setting config by all users. Reach out to your Cypress point-of-contact if you would like to change this.
1515

16+
:::success
17+
18+
## New configuration options
19+
20+
UI Coverage now supports defining custom commands that will count towards coverage scores, restricting which kinds of interactions are allowed for certain elements, and including assertions in the UI Coverage calculations. See the following new properties for more details:
21+
22+
- [`additionalInteractionCommands`](/ui-coverage/configuration/additionalinteractioncommands)
23+
- [`allowedInteractionCommands`](/ui-coverage/configuration/allowedinteractioncommands)
24+
25+
:::
26+
1627
## Setting configuration
1728

1829
To add or modify the configuration for your project:
@@ -27,6 +38,12 @@ To add or modify the configuration for your project:
2738

2839
## Configuration options
2940

41+
:::info
42+
43+
For a quick overview of the practical application of the most common UI Coverage confiuration properties, you can read [this blog post](https://www.cypress.io/blog/making-the-most-of-ui-coverage).
44+
45+
:::
46+
3047
A complete configuration with all available options looks as follows:
3148

3249
```json

0 commit comments

Comments
 (0)