All tests fail in Firefox Web Components Test
After creating a clean copy of the Polymer Starter Kit, running tests with the Web Component Tester ("test" Gulp) causes all tests to fail in Firefox.
The tests run in both Chrome and IE.
Mistake:
firefox 39 ✖ my-greeting-basic.html
Timed out loading http://localhost:2000/components/polymer-starter/my-greeting-basic.html?
<unknown> at done at /components/mocha/mocha.js:1846:0
<unknown> at Runner.prototype.run/< at /components/mocha/mocha.js:5213:0
<unknown> at EventEmitter.prototype.emit at /components/mocha/mocha.js:616:0
<unknown> at start/< at /components/mocha/mocha.js:5203:0
<unknown> at Runner.prototype.runSuite at /components/mocha/mocha.js:5103:0
<unknown> at start at /components/mocha/mocha.js:5201:0
<unknown> at Runner.prototype.run at /components/mocha/mocha.js:5226:0
<unknown> at Mocha.prototype.run at /components/mocha/mocha.js:1849:0
<unknown> at g at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at w at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at f at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at p at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
404 GET /components/polymer-starter/my-list-basic.html
firefox 39 ✖ my-list-basic.html
Timed out loading http://localhost:2000/components/polymer-starter/my-list-basic.html?
firefox 39 Tests failed: 2 failed tests
Test run ended in failure: 2 failed tests
Process terminated with code 1.
In the browser, calls to test cases result in 404s.
source to share
The problem is that Firefox on Windows pops up when it sees a backslash in the path. Took me forever to figure this out, but I opened a ticket for the relevant project and submitted a request to get the fix I came up with.
If you are impatient, you can go to <your project>/node_modules/web_component_tester/runner/webserver.js
and put the following before line 80 ( options.webserver.webRunnerContent = INDEX_TEMPLATE(options)
)
options.suites = options.suites.map(function (cv) {
return cv.replace(/\\/g,'/');
})
This will change the backslash in the forwarding forward slash path, which Firefox has no problem with.
source to share