Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Add page on e2e testing and browser automation #2336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/2.0/docs/tools/browser-automation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Test your Polymer app with a browser automation tool

---

<!-- toc -->

Many app developers use browser automation tools such as WebDriver.io and Selenium to help with end-to-end testing.

Without shadow DOM, you can use [the `querySelector` method](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) to access an element from the DOM, such as a button, in order to simulate a user action such as a click. However, if the button in question is encapsulated inside shadow DOM, it is out of scope of `querySelector` and will not be accessible.

You may still want to perform end-to-end testing of your Polymer application with a browser automation tool.

[Chad Killingsworth has written a gist](https://gist.github.com/ChadKillingsworth/d4cb3d30b9d7fbc3fd0af93c2a133a53) with code for a custom WebDriver.io command to retrieve elements from inside shadow DOM.

Refer to the [WebDriver.io documentation on custom commands](http://webdriver.io/guide/usage/customcommands.html) for instructions on how to set up and use a custom command.
3 changes: 3 additions & 0 deletions app/2.0/nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
- title: Test your elements
path: /2.0/docs/tools/tests
indent: True
- title: Browser automation
path: /2.0/docs/tools/browser-automation
indent: True
# - title: Publish an element
# path: /2.0/docs/tools/reusable-elements
# indent: True
Expand Down