question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Karma is not able to run test cases on phantomJS

See original GitHub issue

I have been trying to get Karma to run tests on PhantomJS for the last couple of hours and seem to be stuck at it. I had my entire suit run tests in Chrome and it ran without a quirk. on trying to run it with Karma, it would just not run.

I was running phantomjs 1.9 and then i reverted to 1.8. i tried installing it from the distributed binary from the phantomjs site and i also tried to install it through npm. But i had no avail in any of the combinations. I am on a 64bit Ubuntu machine.

I am pretty sure my configurations are correct and i checked phantomjs which again seems to be working.

Am i missing something here. or is this some bizarre bug.

I am attaching my debug logs below.

DEBUG [reporter]: Using reporter "dots".
DEBUG [reporter]: Using reporter "junit".
INFO [karma]: Karma server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
DEBUG [launcher]: Creating temp dir at /tmp/testacular-86450027
DEBUG [launcher]: phantomjs /tmp/testacular-86450027/capture.js
DEBUG [watcher]: Resolved files:
    /home/kausikram/lib/node_modules/karma/adapter/lib/jasmine.js
    /home/kausikram/lib/node_modules/karma/adapter/jasmine.js
    /home/kausikram/Projects/scloud/src/main/webapp/resources/jquery/jquery.js
    /home/kausikram/Projects/scloud/src/main/webapp/resources/jquery/jquery.dynoform.js
[...]

DEBUG [web server]: serving: /home/kausikram/lib/node_modules/karma/static/client.html
DEBUG [web server]: serving: /home/kausikram/lib/node_modules/karma/static/testacular.js
DEBUG [karma]: New browser has connected on socket s2jUXmnylvNYdQux4Wc2
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 1
ERROR [launcher]: Cannot start PhantomJS

DEBUG [launcher]: Cleaning temp dir /tmp/testacular-86450027
INFO [launcher]: Trying to start PhantomJS again.
DEBUG [launcher]: Creating temp dir at /tmp/testacular-86450027
DEBUG [launcher]: phantomjs /tmp/testacular-86450027/capture.js
DEBUG [web server]: serving: /home/kausikram/lib/node_modules/karma/static/client.html
DEBUG [web server]: serving: /home/kausikram/lib/node_modules/karma/static/testacular.js
DEBUG [karma]: New browser has connected on socket 3qsGGwLPK5ogNJs_4Wc3
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 1
ERROR [launcher]: Cannot start PhantomJS

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:105 (10 by maintainers)

github_iconTop GitHub Comments

8reactions
pawelszymanskicommented, Jul 23, 2014

Hey, all the people here: you are doing this so wrong!

The point is to test your app with Karma in real browsers, the one that your users use… unless you want your tests to have no value at all.

4reactions
allenhwkimcommented, Oct 19, 2016

I solved this issue by reinstalling node_modules

karma 
karma-chrome-launcher
karma-jasmine
karma-ng-html2js-preprocessor
karma-phantomjs-launcher
phantomjs
Read more comments on GitHub >

github_iconTop Results From Across the Web

Karma test fails when running on PhantomJS - Stack Overflow
The problem is that the test opens the Chrome, does something and close the browser. Now I want to change this implementation not...
Read more >
Error with Karma test runner and PhantomJS
I've included "karma-phantomjs-launcher" and "karma-teamcity-reporter" plugins. I'm using the command line runner in my build step with the ...
Read more >
Developers - Karma is not able to run test cases on phantomJS -
I have been trying to get Karma to run tests on PhantomJS for the last couple of hours and seem to be stuck...
Read more >
Front-End Unit Testing Using Karma Test Runner
This tutorial shows how to write test specs for a sample project using Karma & Jasmine. You will also quickly learn how to...
Read more >
Running tests with Karma and Jasmine manual
Make sure that Karma has the environmental variable of operating system. Create a file named karma.conf.js. To perform this, run karma init karma.conf.js ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found