Skip to content

Bug: Modifying the Cypress.SelectorPlayground.defaults - selectorPriority breaks the Selector Playground #7745

@mthoreso

Description

@mthoreso

Current 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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions