3

After creating a clean copy of the Polymer Starter Kit, running the tests using the Web Component Tester ("test" Gulp task) results in all tests failing in Firefox.

The tests run through fine in both Chrome and IE.

The error is:

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 the calls to the test suites result in 404s.

Brett Postin
  • 11,215
  • 10
  • 60
  • 95
  • To get Karma to work right with browsers on Windows, you'll need to add a couple system variables, have these been setup for firefox: setx FIREFOX_BIN "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" /M – Daniel Billingham Jul 08 '15 at 08:35
  • Firefox launches fine, but the requests for the html test suites result in 404s. – Brett Postin Jul 08 '15 at 09:33
  • 1
    I'm encountering the same issue. Starting with either the direct download or setting up a new project with `yo polymer`, I get the same errors as above. Digging a bit deeper, I've found that if I can grab the URL and drop it in the Chrome or IE instances that pop up then the test will pass, but if I drop it into an existing instance of either browser(I.E. one that doesn't have the Selenium extension) then it fails the same way. I'm thinking FF isn't activating the extension - it is being installed though. Still digging. – Daniel Nielson Jul 13 '15 at 05:53

1 Answers1

2

The issue is that Firefox in Windows screws up when it sees backslashes in a path. Took me forever to figure it out, but I've opened a ticket on the relevant project and submitted a pull request for a fix I came up with.

If you're impatient you can navigate 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 backslashes in the path to forward slashes which Firefox doesn't have a problem with.

Brett Postin
  • 11,215
  • 10
  • 60
  • 95
Daniel Nielson
  • 381
  • 1
  • 8