Skip to content
This repository has been archived by the owner on Apr 30, 2022. It is now read-only.

Latest commit

 

History

History
29 lines (19 loc) · 1.7 KB

tests.md

File metadata and controls

29 lines (19 loc) · 1.7 KB

Tests

Tests are realized via the web-component-tester module. General information about testing with Polymer can be found here. Polymer uses Mocha as its test framework, Chai for assertions, Sinon for spies, stubs, and mocks, Selenium for running tests against multiple browsers, and Accessibility Developer Tools for accessibility audits. To support you in your testing, you can additionally use iron-test-helpers, a small library of Polymer testing utility tools.

Prerequisites

For Safari, you need to install the extension SafariDriver.safariextz. Also, you need to have the Develop menu active (toggled on in Preferences) and have toggled on the option Allow Remote Automation underneath the Develop menu.

Running tests

The component is set up to be tested via web-component-tester. The test suite can be executed locally by running

$ npm test

Note: Safari will fail this test when accessing a fixture because of a bug.

Debugging Tests

If tests fail, it can be very helpful to see more information about why they fail. To be able to debug tests, you should run the following command:

$ npm run serve

You can then open the URL of a certain unit test in the browser, for example:

http://localhost:8080/components/video-player/test/video-player_test.html