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

Add page on e2e testing and browser automation

Open ghost opened this issue 8 years ago • 9 comments

Fixes #2295

First draft of this page. @arthurevans @justinfagnani please comment on what else needs to be included.

ghost avatar Sep 25 '17 20:09 ghost

@arthurevans

ghost avatar Oct 02 '17 21:10 ghost

@justin @ChadKillingsworth @ergo @andreasgalster Does this seem like a helpful starting point? (Tagging the folks who were discussing this issue on Slack.)

arthurevans avatar Oct 03 '17 22:10 arthurevans

I tried to get basic WebDriver tests going a while ago, for some reason only Phantom JS worked on my machine, which does fail even the most basic test to check if my app-shell has a specific property set.

I'm guessing it's a good idea to run WebDrvier tests with the new headless Chrome option?

AndreasGalster avatar Oct 04 '17 00:10 AndreasGalster

@AndreasGalster I will ask @justinfagnani to answer that question.

Did you try the process in this doc? If it didn't work, can you say what happened when you tried it? Also you stated PhantomJS worked, but that it failed a very basic test - does this mean you couldn't use PhantomJS either?

ghost avatar Oct 04 '17 19:10 ghost

I just tried to load my page and get a property on my app-shell. Page loads but no property available. Even with waiting. I can do some more tests tonight if it's helpful. So yes, ultimately I wasn't able to run with PhantomJS and I couldn't try the process in the doc.

Unfortunately for reasons unknown to me yet all my other browsers time out (even Chrome, so I wouldn't be able to run headless). I haven't been able to figure out what that issue this, though I'm guessing this is unrelated to overall webcomponents/Polymer testing.

AndreasGalster avatar Oct 05 '17 02:10 AndreasGalster

Thanks for your feedback @AndreasGalster.

I am not sure what the next step is and hoping y'all can help me to work it out. Currently the info I've provided in the proposed document is:

  • Why automated tests won't work with Polymer elements
  • How to make them work with Chad's custom WebDriver code

From reading Andreas' response, the issues he experienced in attempting this task do not seem to be related to Chad's code.

What further info needs to be provided to enable users to conduct automated tests on Polymer elements?

ghost avatar Oct 10 '17 21:10 ghost

We have a conflict here, and we never did get input from eng. I feel like there's a lot of new stuff going on with Puppeteer etc., so we should maybe hit eng. up and see if we should merge this or do something larger for 3.x. Or both.

arthurevans avatar Feb 09 '18 20:02 arthurevans

note to self: https://github.com/SeleniumHQ/selenium/pull/5762

ghost avatar May 02 '18 21:05 ghost

FYI regarding the PR @katejeffreys , it has been merged now.

However, it doesn't introduce an accessor to shadowRoot so the gist from chad is still useful (i may one day get around to adding that but its a laborious PR).

The parts it does fix are things like (C# in my examples here) Element.Text, Element.IsVisible() and other "helper" members. They now traverse shadow dom and follow slots, etc.

Also, you should be using headless chrome for sure. You can use the existing ChromeDriver but with the --headless flag and it will work fine.

We currently use webdriver for all our polymer apps

43081j avatar May 08 '18 10:05 43081j