Bug: Modifying the `Cypress.SelectorPlayground.defaults - selectorPriority` breaks the Selector Playground
See original GitHub issueCurrent behavior:
Modifying the Cypress.SelectorPlayground.defaults
in the support/index.js
file breaks the Selector Playground in the GUI.
Desired behavior:
To be able to modify/add to the selectorPriority
list and still use the Selector Playground.
Test code to reproduce
If you modify the cypress/support/index.js
file with this:
Cypress.SelectorPlayground.defaults({
selectorPriority: [
"data-qa",
"data-test",
"data-cy",
"id",
"class",
"name",
"tag",
"attributes",
"nth-child",
],
});
The selector playground is broken and doesn’t work at all.
When I comment this block of code out, the Selector Playground works normally.
This issue helped me figure out where to modify the selectorPriority: 7606
Versions
Cypress 4.7.0 and 4.8.0, MacOS, Chrome
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Cypress.SelectorPlayground
The Selector Playground exposes APIs that enable you to: Change the default selector strategy; Override the selectors that are returned per element. Syntax....
Read more >Cypress Selector Playground - YouTube
Today the video is on Cypress Selector Playground Cypress selector ... Once your test case is launch in your default or preferred browser ......
Read more >cli/types/cypress.d.ts - Fossies
Selector ): boolean 703 /** 704 * Returns a boolean indicating whether an element ... 760 */ 761 SelectorPlayground: { 762 defaults(options: ...
Read more >How To Find HTML Elements Using Cypress Locators
Cypress supports only CSS selectors out of the box for locating elements in the DOM. So in case you intend to use other...
Read more >cypress: Versions - Openbase
An error now throws when invalid options are passed to the selectorPriority configuration option of Cypress.SelectorPlayground.defaults .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a workaround, instead of using
selectorPriority
useonElement
.So instead of:
Use this:
I am facing the same issue. Will this be resolved?