The angular-phonecat tutorial assumes you are running angular-phonecat on a server that has chrome installed.
After entering npm test
the local chrome-browser should open and run the tests continously.
Of course this does not work on my headless server:
/var/www/angular-phonecat$ npm test
> angular-phonecat@0.0.0 pretest /var/www/angular-phonecat
> npm install
> angular-phonecat@0.0.0 postinstall /var/www/angular-phonecat
> bower install
> angular-phonecat@0.0.0 test /var/www/angular-phonecat
> karma start test/karma.conf.js
INFO [karma]: Karma v0.10.10 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
ERROR [launcher]: Cannot start Chrome
Can not find the binary google-chrome
Please set env variable CHROME_BIN
I would like to do this on a linux machine that is a server and has no X installed.
One way would to tunnel the X session but I'd rather connect the npm test
environment to my local chrome over http manually.
How would I do this?
I would need to tell npm test
that it should not start chrome? I see the server is running on http://localhost:9876/
so I would connect manually.
The angular-phonecat tutorial assumes you are running angular-phonecat on a server that has chrome installed.
After entering npm test
the local chrome-browser should open and run the tests continously.
Of course this does not work on my headless server:
/var/www/angular-phonecat$ npm test
> angular-phonecat@0.0.0 pretest /var/www/angular-phonecat
> npm install
> angular-phonecat@0.0.0 postinstall /var/www/angular-phonecat
> bower install
> angular-phonecat@0.0.0 test /var/www/angular-phonecat
> karma start test/karma.conf.js
INFO [karma]: Karma v0.10.10 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
ERROR [launcher]: Cannot start Chrome
Can not find the binary google-chrome
Please set env variable CHROME_BIN
I would like to do this on a linux machine that is a server and has no X installed.
One way would to tunnel the X session but I'd rather connect the npm test
environment to my local chrome over http manually.
How would I do this?
I would need to tell npm test
that it should not start chrome? I see the server is running on http://localhost:9876/
so I would connect manually.
Edit 1: What i tried was this, create a dummy binary instead of not existing chrome:
/var/www/angular-phonecat$ cat dummy.sh
#!/bin/sh
read -p "Press enter to terminate ... " dummy_userinput
... and pass this to the tests:
/var/www/angular-phonecat$ export CHROME_BIN="/var/www/angular-phonecat/dummy.sh" && npm test
It somehow works but the dummy chrome does not give the correct answers I suspect:
INFO [karma]: Karma v0.10.10 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 34.0.1847 (Windows 7)]: Connected on socket Ri4I_SRpM8UA1q_Kq6V6
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again.
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again.
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome [[again (2/2)]] ERROR [launcher]: Cannot start Chrome ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up. Should we assume that you can't test Angular apps on a headless server? Seems dubious, but I'd love clarification from someone with more experience. – mightypile Sep 14 '14 at 17:34