Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add global config option for including shadow DOM in commands #8442

Closed
chrisbreiding opened this issue Aug 28, 2020 · 2 comments · Fixed by #8479
Closed

Feature: Add global config option for including shadow DOM in commands #8442

chrisbreiding opened this issue Aug 28, 2020 · 2 comments · Fixed by #8479
Assignees
Labels
topic: shadow dom Issues when testing shadow dom type: feature New feature that does not currently exist

Comments

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Aug 28, 2020

Current behavior:

Currently, to enable shadow dom support, it's necessary to pass includeShadowDom into a command that supports it every time it's used.

cy.get('.in-shadow-dom', { includeShadowDom: true })
cy.get('.shadow-root').find('.in-shadow-dom', { includeShadowDom: true })

Desired behavior:

Enable configuring shadow dom inclusion globally, per-suite, per-test, or programmatically. Still need to decide on a name for it.

cypress.json

Turns on inclusion behavior for all tests

{
  "includeShadowDom": true
}

Per Suite

Turns on inclusion behavior for all tests and commands within the suite

describe('shadow dom tests', { includeShadowDom: true }, () => {
  it(...)
  it(...)
})

Per Test

Turns on inclusion behavior for all commands within the test

it('shadow dom tests', { includeShadowDom: true }, () => {
  cy.get(...)
  cy.get(...).find(...)
})

Programmatically

Turns on inclusion behavior conditionally based on where it's used (before, beforeEach, etc)

before(() => {
  Cypress.config('includeShadowDom', true)
})
@chrisbreiding chrisbreiding self-assigned this Aug 28, 2020
@chrisbreiding chrisbreiding added topic: shadow dom Issues when testing shadow dom type: feature New feature that does not currently exist labels Aug 28, 2020
@cypress-bot cypress-bot bot added stage: work in progress There is an open PR for this issue [WIP] stage: needs review The PR code is done & tested, needs review and removed stage: work in progress There is an open PR for this issue [WIP] stage: needs review The PR code is done & tested, needs review labels Sep 2, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 10, 2020

The code for this is done in cypress-io/cypress#8479, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Sep 10, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 15, 2020

Released in 5.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: shadow dom Issues when testing shadow dom type: feature New feature that does not currently exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant