Open pengying opened 8 years ago
@pengying I found a work around for now, seems to be a problem with the bower web-component-tester package. I'm using the yeoman polymer-generator, but it is also based off polymer-starter-kit so it should apply here. Make sure npm install
has been run to get web-component-tester from npm.
In all the test files in the test/
directory e.g. tests/my-greeting-basic.html
, change the script import for web-component tester to reference from node_modules
instead of bower_components
:
Find:
<script src="../../bower_components/web-component-tester/browser.js"></script>
and change to:
<script src="../../node_modules/web-component-tester/browser.js"></script>
Does the problem still persist after that? If so, could it to do with importing paper-dialog in the tests/my-greeting-basic.html
file directly instead of as an import inside of elements/my-greeting/my-greeting.html
?
Yeah the problem still occurs. I diffed the two browser.js and they're the same for me.
@pengying, I experienced a very similar problem to yours. Specifically, my errors looked like this for Chrome (but not Firefox):
chrome 46 ✖ Test Suite Initialization
Failed to execute 'registerElement' on 'Document': Registration failed for type 'test-fixture'. A type with that name is already registered.
<unknown> at <unknown> at /components/demo-web-app/bower_components/test-fixture/test-fixture.html:312:0
<unknown> at <unknown> at /components/demo-web-app/bower_components/test-fixture/test-fixture.html:315:0
My workaround was to comment out the import to test-fixture.html
in my tests. It seems as though they're already imported somewhere and the deduplication of imports isn't being done properly. Perhaps you are importing polymer-micro.html
somewhere in your tests?
Strangely enough, Firefox worked fine. It's just Chrome that was complaining. Something something shadow DOM, perhaps? Beats me...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm getting
When including elements from the local project
elements
directory andbower_components
To repro: clone polymer-start-kit bower install PolymerElements/paper-dialog include paper dialog in tests/my-greeting-basic.html start test and get error