Skip to content

Commit a768b5b

Browse files
Add notes about the variability of the ElementSelector API and the de… (#6238)
* Add notes about the variability of the ElementSelector API and the deprecation of Selector Playground * update info areas * lint fix
1 parent 4184dc7 commit a768b5b

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 105
99

1010
# Cypress.ElementSelector
1111

12-
The ElementSelector API lets you define how Cypress selects elements in tools like [Cypress Studio](/app/guides/cypress-studio) and the [Selector Playground](/app/core-concepts/open-mode#Selector-Playground).
12+
The ElementSelector API lets you define how Cypress selects elements in tools like [Cypress Studio](/app/guides/cypress-studio) and the [Selector Playground](/app/core-concepts/open-mode#Selector-Playground) (which will be replaced by Cypress Studio once it is no longer experimental).
1313

1414
By setting your own selector strategy, you can control which attributes Cypress prioritizes (like `data-*`, `id`, or `aria-label`) when generating selectors. This helps you enforce consistency, improve test readability, and make generated tests more resilient to changes in your HTML.
1515

@@ -33,6 +33,14 @@ An object containing any or all of the following options:
3333
| ------------------ | ------------------ | ---------------------------------------------------------------------- |
3434
| `selectorPriority` | `Array of strings` | Determines the order of attributes Cypress uses to generate selectors. |
3535

36+
:::info
37+
38+
##### API Stability
39+
40+
The `selectorPriority` API is under active development and may change in future versions as we refine the best way to generate selectors within our products. Stay updated with our [changelog](/app/references/changelog) for any breaking changes.
41+
42+
:::
43+
3644
Accepted values for `selectorPriority` are:
3745

3846
- `attribute:${string}` - for specific attributes like `attribute:aria-label`, `attribute:lang`, etc.
@@ -64,7 +72,7 @@ The [jQuery element](http://api.jquery.com/Types/#jQuery) for which you want to
6472

6573
### Set custom selector priority
6674

67-
You can customize how Cypress generates selectors by defining a priority order for which attributes to prefer. This affects the selectors you see in tools like [Cypress Studio](/app/guides/cypress-studio) and the [Selector Playground](/app/core-concepts/open-mode#Selector-Playground).
75+
You can customize how Cypress generates selectors by defining a priority order for which attributes to prefer. This affects the selectors you see in tools like [Cypress Studio](/app/guides/cypress-studio) and the [Selector Playground](/app/core-concepts/open-mode#Selector-Playground) (which will be replaced by Cypress Studio once it is no longer experimental).
6876

6977
For example, this config tells Cypress to prefer semantic and accessibility attributes before falling back to styling details like class names.
7078

docs/app/core-concepts/open-mode.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,13 @@ unexpected behaviors
540540

541541
## Selector Playground
542542

543+
:::caution
544+
545+
##### Deprecation Notice
546+
547+
The Selector Playground will be replaced by [Cypress Studio](/app/guides/cypress-studio) once it is no longer experimental. Cypress Studio provides the same functionality for constructing Cypress commands using unique selectors, along with additional recording capabilities.
548+
:::
549+
543550
The Selector Playground is an interactive feature that helps you:
544551

545552
- Determine a unique selector for an element.

0 commit comments

Comments
 (0)