Closed btelles closed 5 years ago
It appears the line:
<link rel="import" href="../../bower_components/test-fixture/test-fixture.html">
is not necessary?
Had the same issue... Here's what worked for me: https://github.com/PolymerElements/test-fixture/issues/20
This issue is fixed in the new version of the polymer starter kit. Removing the link from the 2 test files fixed the problem for me.
And the work-around by @BorntraegerMarc is the same one.
If I then try and import something from bower components in my test (in particular, I'm trying to import iron-ajax), the test continues to fail in the same manner. I've also tried importing iron-ajax in a variety of ways (changing load order, placing the import inside a new special_elements.html file, and changing the server pathMappings in wct).
This is quite a show stopper for using WCT for me. I had to manually create AJAX requests in my tests.
Here are the revised steps that work with the latest clone from polymer-starter-kit:
git clone https://github.com/PolymerElements/polymer-starter-kit.git myApp
cd myApp
npm install -g gulp bower && npm install && bower install && gulp
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
gulp test:local
Expected result: All tests pass on chrome (version 46) and firefox (version 25) browsers
Actual result: Tests fail on Chrome and Pass on Firefox. Here are the results:
Installing and starting Selenium server for local browsers
Selenium server running on port 48723
Web server running on port 2000 and serving from /home/btelles/code/polymer-starter-kit
chrome 46 Beginning tests via http://localhost:2000/components/polymer-starter-kit/generated-index.html?cli_browser_id=0
chrome 46 ✖ Test Suite Initialization
Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered.
<unknown> at <unknown> at /components/polymer-starter-kit/app/bower_components/polymer/polymer-micro.html:308:0
<unknown> at <unknown> at /components/polymer-starter-kit/app/bower_components/polymer/polymer-micro.html:323:0
chrome 46 ✖ Test Suite Initialization
Polymer.Base._getExtendedPrototype is not a function
<unknown> at desugar at /components/polymer-starter-kit/app/bower_components/polymer/polymer-micro.html:71:0
<unknown> at window.Polymer at /components/polymer-starter-kit/app/bower_components/polymer/polymer-micro.html:58:0
<unknown> at <unknown> at /components/polymer-starter-kit/app/bower_components/polymer/polymer.html:3512:0
<unknown> at <unknown> at /components/polymer-starter-kit/app/bower_components/polymer/polymer.html:3579:0
chrome 46 ✖ Test Suite Initialization
this._desugarBehaviors is not a function
<unknown> at HTMLElement.Polymer.Base.registerCallback at /components/polymer-starter-kit/app/bower_components/polymer/polymer-micro.html:181:0
<unknown> at desugar at /components/polymer-starter-kit/app/bower_components/polymer/polymer-micro.html:74:0
<unknown> at window.Polymer at /components/polymer-starter-kit/app/bower_components/polymer/polymer-micro.html:58:0
<unknown> at <unknown> at /components/polymer-starter-kit/app/elements/my-greeting/my-greeting.html:30:0
<unknown> at <unknown> at /components/polymer-starter-kit/app/elements/my-greeting/my-greeting.html:41:0
chrome 46 ✖ app/test/my-greeting-basic.html » my-greeting tests » Welcome!
Cannot read property 'textContent' of null
<unknown> at Context.<anonymous> at my-greeting-basic.html:43:0
chrome 46 Tests failed: 4 failed tests
Test run ended in failure: 4 failed tests
chrome 46 (1/0/4)
Fixed with test-fixture 1.1.0
Tests failing because test-fixture is already registered on Chrome.
Steps to reproduce:
Expected result: All tests pass on chrome (version 46) and firefox (version 25) browsers
Actual result: Tests fail on Chrome and Pass on Firefox. Here are the results: