I have a donejs plugin (https://github.com/riescorp/donejs-typeahead) and I decided to use funcunit (http://funcunit.com/) to do the GUI interaction tests. Everything works fine on my computer, either running the test page (http://localhost:8080/test/test.html) or running npm test
on the console.
The problem is that when running tests on CircleCI or Travis CI the tests won't pass. The error is something like "xxxxx page not loaded in time!" (see example below).
There is a simplified branch to show what's going on (https://github.com/riescorp/donejs-typeahead/tree/testing-open), you can clone it, then run npm install
and npm test
and you'll see that it works.
You can check the details of the error in CircleCI here:
Travis generates the same error but it will fail as I'm testing both firefox and chrome (chrome not supported in travis)
Example error:
1) QUnit "test/test.html" on Chrome 53.0.2785 / Linux 0.0.0: donejs-typeahead GUI Interaction DEBUG TESTS DEBUG 1 Page //../src/donejs-typeahead.html not loaded in time!:
Error: Expected true but was false
at Object.ok (http://localhost:3996/node_modules/steal-qunit/node_modules/qunitjs/qunit/qunit.js:2194:12)
at Object.assertOK (http://localhost:3996/node_modules/funcunit/browser/adapters/qunit.js:12:10)
at http://localhost:3996/node_modules/funcunit/browser/queue.js:168:27
You can have Funcunit open new windows in an iframe by setting frameMode: true
. This is what the DoneJS app generator sets up.