Skip to content

Instantly share code, notes, and snippets.

@RollerIn
RollerIn / e2e-shadowdom.md
Created September 1, 2021 14:04 — forked from ChadKillingsworth/e2e-shadowdom.md
Selenium Testing with Shadow DOM

End-to-end Testing with Shadow DOM

As the web component specs continue to be developed, there has been little information on how to test them. In particular the /deep/ combinator has been deprecated in Shadow DOM 1.0. This is particularly painful since most end-to-end testing frameworks rely on elements being discoverable by XPath or calls to querySelector. Elements in Shadow DOM are selectable by neither.

WebDriver.io

Webdriver.io has the standard actions by selectors, but also allows browser executable scripts to return an element