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: image

Manually: image

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");
  });
});

Repository with simple test

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)

Most upvoted comments