cypress: Cypress doesn't see shadow-root (user-agent) with pseudo elements
Current behavior
Cypress doesn’t see a shadow-root (user-agent) and I can’t get access to pseudo elements inside a root.
AssertionError: Timed out retrying after 4000ms: Expected the subject to host a shadow root, but never found it.
Cypress:

Manually:

Desired behavior
Make access to pseudo-elements inside the shadow-root (user agent).
Test code to reproduce
describe("shadow_root_user_agent", () => {
it("access_to_pseudo_elements", () => {
// visit google player site
cy.visit("https://googleads.github.io/googleads-ima-html5/vsi/");
// get a pseudo element inside a shadow-root (user-agent)
cy.get("#h5-player")
.shadow()
.find('div[pseudo="-webkit-media-controls"]')
.should("exist");
});
});
Cypress Version
12.9.0
Node version
18.6.0
Operating System
Win 10
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 18 (2 by maintainers)
Hello 4all!
I solve the problem, using this article: https://dzone.com/articles/exploring-shadow-dom-with-examples-using-cypress
I use the: Approach 2: Using the includeShadowDom Flag in Config
Version Cypress: v12.14.0