Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karma not capturing with PhantomJS - I have a debug log and versions listed inside. #783

Closed
iangregsondev opened this issue Oct 10, 2013 · 3 comments

Comments

@iangregsondev
Copy link

Hi there,

I seem to have some major issue with running tests via PhantonJS, it works with Chrome but PhantomJS just constantly timesout.

Here are my versions

NPM 1.3.8

Karma 0.10.2

PhantomJS 1.9.2-2

I have gone into IE and disabled Automatic detect proxy settings but no luck

I run the following command

karma start --browsers PhantomJS --log-level debug

And my log

PS C:\dev\testTesting> karma start --browsers PhantomJS --log-level debug
DEBUG [plugin]: Loading karma-* from C:\dev\testTesting\node_modules
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-chrome-launcher.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-coffee-preprocessor
.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-firefox-launcher.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-html2js-preprocesso
r.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-ng-html2js-preproce
ssor.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-ng-scenario.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-phantomjs-launcher.

DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-requirejs.
DEBUG [plugin]: Loading plugin C:\dev\testTesting\node_modules/karma-script-launcher.
DEBUG [plugin]: Loading inlined plugin (defining ).
INFO [karma]: Karma v0.10.2 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
DEBUG [launcher]: Creating temp dir at C:\Users\gregsoni\AppData\Local\Temp\karma-154897
54
DEBUG [launcher]: C:\Users\gregsoni\AppData\Roaming\npm\node_modules\phantomjs\lib\phant
om\phantomjs.exe C:\Users\gregsoni\AppData\Local\Temp\karma-15489754/capture.js
WARN [watcher]: Pattern "C:/dev/testTesting/test/mock/**/*.js" does not match any file.
DEBUG [watcher]: Resolved files:
        C:/dev/testTesting/node_modules/karma-jasmine/lib/jasmine.js
        C:/dev/testTesting/node_modules/karma-jasmine/lib/adapter.js
        C:/dev/testTesting/app/bower_components/angular/angular.js
        C:/dev/testTesting/app/bower_components/angular-mocks/angular-mocks.js
        C:/dev/testTesting/app/scripts/app.js
        C:/dev/testTesting/app/scripts/controllers/main.js
        C:/dev/testTesting/test/spec/controllers/main.js
DEBUG [web-server]: serving: C:\dev\testTesting\node_modules\karma\static/client.html
DEBUG [web-server]: serving: C:\dev\testTesting\node_modules\karma\static/karma.js
DEBUG [karma]: A browser has connected on socket CDXcWDkgF39AWX28AW4X
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 0
DEBUG [launcher]: Cleaning temp dir C:\Users\gregsoni\AppData\Local\Temp\karma-15489754
INFO [launcher]: Trying to start PhantomJS again.
DEBUG [launcher]: Creating temp dir at C:\Users\gregsoni\AppData\Local\Temp\karma-154897
54
DEBUG [launcher]: C:\Users\gregsoni\AppData\Roaming\npm\node_modules\phantomjs\lib\phant
om\phantomjs.exe C:\Users\gregsoni\AppData\Local\Temp\karma-15489754/capture.js
DEBUG [web-server]: serving: C:\dev\testTesting\node_modules\karma\static/client.html
DEBUG [web-server]: serving: C:\dev\testTesting\node_modules\karma\static/karma.js
DEBUG [karma]: A browser has connected on socket YwRE8rJjV46J3ffKAW4Y
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 0
DEBUG [launcher]: Cleaning temp dir C:\Users\gregsoni\AppData\Local\Temp\karma-15489754
INFO [launcher]: Trying to start PhantomJS again.
DEBUG [launcher]: Creating temp dir at C:\Users\gregsoni\AppData\Local\Temp\karma-154897
54
DEBUG [launcher]: C:\Users\gregsoni\AppData\Roaming\npm\node_modules\phantomjs\lib\phant
om\phantomjs.exe C:\Users\gregsoni\AppData\Local\Temp\karma-15489754/capture.js
DEBUG [web-server]: serving: C:\dev\testTesting\node_modules\karma\static/client.html
DEBUG [web-server]: serving: C:\dev\testTesting\node_modules\karma\static/karma.js
DEBUG [karma]: A browser has connected on socket mfDQsgnZURWq4Yf6AW4Z
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 0
DEBUG [launcher]: Cleaning temp dir C:\Users\gregsoni\AppData\Local\Temp\karma-15489754
@iangregsondev
Copy link
Author

I have managed to get this working but its not ideal, I increased the captureTimeout to 200,000 and it seems to work. For some reason the capture is taking a long time.

Any fixes for this or anyone know why it should be taking over 60,000 ms to capture ?

Thanks in advance

@vojtajina
Copy link
Contributor

I have no idea why capturing takes so long.

You can try to debug PhantomJS to figure out what's going on in the browser:
https://github.com/ariya/phantomjs/wiki/Troubleshooting#remote-debugging

Honestly, I'm surprised, that so many people still using PhantomJS. It so slower than using regular Chrome/Safari and debuggability is so much worse.

@dignifiedquire
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants