old-docs-site icon indicating copy to clipboard operation
old-docs-site copied to clipboard

End-to-end testing docs

Open justinfagnani opened this issue 6 years ago • 5 comments

Users have requested a little more information on end-to-end testing.

It probably doesn't need to be much different from end-to-end testing with other web technologies, except for dealing with native Shadow DOM in frameworks like Selenium.

Chad Killingsworth has writtena Gist with useful info here: https://gist.github.com/ChadKillingsworth/d4cb3d30b9d7fbc3fd0af93c2a133a53

justinfagnani avatar Aug 14 '17 20:08 justinfagnani

Can you give more details of the user requests so I can get a sense of what would be involved?

ghost avatar Aug 15 '17 18:08 ghost

I think it's a pretty general request: given an app with a front-end written in Polymer and a specific app server, how do we perform tests of user workflows, presumably using Selenium/WebDriver. I believe that's the context of Chad's gist too.

justinfagnani avatar Aug 16 '17 01:08 justinfagnani

What is/are the specific app server/s? Can you confirm that the use case is for testing with WebDriver?

If you can give me contact details for the users who are requesting this documentation, I can find out more details about their requirements and create a documentation plan for the use cases we should cover.

ghost avatar Aug 16 '17 20:08 ghost

@ChadKillingsworth wrote the gist and knows the use cases.

I think the basic issue here is that for end-to-end testing you want a tool to be able to pick out an element, like a button, and perform a synthetic action on it (like clicking). With shadow DOM, that button can't just be accessed using querySelector, which breaks the test tools.

arthurevans avatar Sep 21 '17 23:09 arthurevans

Have to be careful on terminology: my gist adds a custom command to the webdriver.io package to facilitate accessing items nested inside shadow dom - exactly what @arthurevans mentioned. There are many other JS frameworks that use selenium (via the selenium webdrivers).

The core concept is the same in all of these frameworks - you need to execute JS in the browser to traverse down through the shadow roots.

This is seriously the only place I really miss the shadow piercing combinator ...

ChadKillingsworth avatar Sep 21 '17 23:09 ChadKillingsworth