Testing Polymer WebUI

Skip to first unread message

Michael Giuffrida

Jun 15, 2015, 3:33:29 PM6/15/15
to chromium...@chromium.org
Hi all,

I've just landed a change which provides PolymerTest, a small class that uses the new mocha BrowserTest adapter to run Mocha tests.

I'd strongly suggest using this framework for Polymer elements. See documentation here. 

  • loads a "blank" WebUI by default, so you have a DOM for your elements
  • imports polymer and iron-test-helpers
  • lets you define as many mocha tests as you want inside an individual TEST_F, so you don't have to spin up a new browser for each component you want to test
  • has helpers for importing HTML
  • opines that you should specify tests for components in separate files and importing them into one BrowserTest for your family of components
Thanks, and feel free to ping me with questions or suggestions, or CC me on code reviews!

Reply all
Reply to author
0 new messages