Open mvuksano opened 9 years ago
You may also try to import
<script src="../bower_components/web-component-tester/browser.js"></script>
@dmaslov That's imported too.
The issue still exists with Firefox 44 and Safari 9.0.3 on Mac OS X 10.11.4: tests work when the element is defined in a separate file, but don't work when it is defined inside the test HTML file.
FWIW, I found an ugly work-around. Wait for the 'webComponentsReady' event to fire on every test.
window.addEventListener('WebComponentsReady', (e) => {
Polymer/WebCompontentTester tests...
});
Anyone figured out why this happens on Firefox? I'm seeing the same issue, and @btelles' hack fixes it.
This is just same problem of main page element definitions without native HTML Imports, because we can't make main page scripts wait. WCT already waits to run tests until WebComponentsReady, so I'd just put the element definition in a wait too. You shouldn't need to do that for every test.
@justinfagnani, For my scenario, the test itself needs to wait, because it's using native HTML imports to load some vanilla Javascript, and it doesn't make sense to make that Javascript wait for the WebComponetsReady event.
Btw, is there a discussion thread on element definitions without native HTML imports that you can link to?
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 have a test which is of the following structure:
And when I run this tests they cause an exception in Firefox (while working just fine in Chrome):
I also made sure to import