Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Tests failing with 404 for Firefox in Windows #2961

Open AbandonedFridge opened 9 years ago

AbandonedFridge commented 9 years ago

Myself and at least one other person (see SO question: http://stackoverflow.com/questions/31287254/all-tests-fail-in-web-component-tester-for-firefox) are encountering an error where all tests fail with a 404 in Firefox.

[13:35:39] Starting 'wct:local'...
Starting Selenium server for local browsers
Selenium server running on port 57084
Web server running on port 2000 and serving from C:\Users\Daniel\Projects\polymer-starter-kit-1.0.2
ie 11.0.9600.17840       Beginning tests via http://localhost:2000/components/polymer-starter-kit-1.0.2/generated-index.html?cli_browser_id=2
ie 11.0.9600.17840       Tests passed
chrome 43                Beginning tests via http://localhost:2000/components/polymer-starter-kit-1.0.2/generated-index.html?cli_browser_id=0
firefox 39               Beginning tests via http://localhost:2000/components/polymer-starter-kit-1.0.2/generated-index.html?cli_browser_id=1
chrome 43                Tests passed
404 GET /components/polymer-starter-kit-1.0.2/my-greeting-basic.html?
firefox 39               ✖ my-greeting-basic.html

  Timed out loading http://localhost:2000/components/polymer-starter-kit-1.0.2/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-kit-1.0.2/my-list-basic.html?
firefox 39               ✖ my-list-basic.html

  Timed out loading http://localhost:2000/components/polymer-starter-kit-1.0.2/my-list-basic.html?

firefox 39               Tests failed: 2 failed tests
Test run ended in failure: 2 failed tests

chrome 43 (2/0/0)                       firefox 39 (0/0/2)                      ie 11.0.9600.17840 (2/0/0)
[13:37:17] 'wct:local' errored after 1.62 min
[13:37:17] Error: 2 failed tests

I also found reference to the same error in this separate issue on the starter-kit project from last month - https://github.com/PolymerElements/polymer-starter-kit/issues/119 - but it wasn't the focus of the question and it doesn't look like anyone ever actually looked into it.

I can't speak for others, but I'm encountering this problem on two separate Windows 8.1 computers with Firefox 33.1 and 39. Tests on both versions of FF work perfectly on my OSX 10.10 iMac at work however.

I've tested using the locally installed WCT with the gulp test:local command as well as by globally installing and running the wct command.

Edit: I guess I should probably mention that all these tests have been conducted in the Polymer Starter Kit installed either directly from the zip download or with yo polymer

AbandonedFridge commented 9 years ago

I figured it out. The generated index file for WCT is loading the very Windowsy path of app\\test\\index.html which Firefox handles weird. It loads the index.html file but treats it as app%5Ctest%5Cindex.html for all future path calculations which screws up the relative paths for the sub-tests. This causes Firefox to try to load the my-*.html files from /components/polymer-starter-kit-1.0.2/ instead of /components/polymer-starter-kit-1.0.2/app/test/. See PR for fix.

mazswojejzony commented 8 years ago

@unfairSurprisery thanks a lot for sharing this info and the PR! I hope it is going to land in the main repo soon.

stale[bot] commented 4 years ago

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.