Code Monkey home page Code Monkey logo

karma-phantomjs-launcher's Introduction

karma-phantomjs-launcher

js-standard-style npm version npm downloads

Build Status Dependency Status devDependency Status

Launcher for PhantomJS.

Installation

The easiest way is to keep karma-phantomjs-launcher as a devDependency in your package.json, by running

$ npm install --save-dev karma-phantomjs-launcher

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    browsers: ['PhantomJS', 'PhantomJS_custom'],

    // you can define custom flags
    customLaunchers: {
      'PhantomJS_custom': {
        base: 'PhantomJS',
        options: {
          windowName: 'my-window',
          settings: {
            webSecurityEnabled: false
          },
        },
        flags: ['--load-images=true'],
        debug: true
      }
    },

    phantomjsLauncher: {
      // Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
      exitOnResourceError: true
    }
  })
}

The options attribute allows you to initialize properties on the phantomjs page object, so

options: {
  windowName: 'my-window',
  settings: {
    webSecurityEnabled: false
  },
}

is equivalent to:

var webPage = require('webpage')
var page = webPage.create()

page.windowName = 'my-window'
page.settings.webSecurityEnabled = false

You can pass list of browsers as a CLI argument too:

$ karma start --browsers PhantomJS_custom

If you set the debug option to true, you will be instructed to launch a web browser to bring up the debugger. Note that you will want to put debugger; statements in your JavaScript to hit breakpoints. You should be able to put breakpoints in both your test code and your client code. Note that the debug option automatically adds the --remote-debugger-port=9000 and --remote-debugger-autorun=yes switches to PhantomJS.


For more information on Karma see the homepage.

karma-phantomjs-launcher's People

Contributors

danielsiwiec avatar dignifiedquire avatar enterit avatar erykpiast avatar gigadude avatar huafu avatar jmdobry avatar jurko-gospodnetic avatar leightarasenko avatar mpderbec avatar nherzing avatar nmalaguti avatar park9140 avatar shinnn avatar sylvain-hamel avatar vojtajina avatar zzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

karma-phantomjs-launcher's Issues

Unable to access variable page

For my e2e tests I want to be able to open pages, query for DOM and stuff like that:

var expect = chai.expect;

describe('Home page', function() {

    beforeEach(function(done) {
      page.open('/', function() {
        done();
      });
    });

    it('has canvas', function() {
        expect(element('body').html()).to.contain('canvas');
    });

    it('has more than zero links', function() {
        expect(repeater('a').count()).to.have.length.above(0);
    });
});

But grunt-karma crashes with:

Running "karma:e2e" (karma) task
INFO [karma]: Karma v0.10.6 server started at http://localhost:9012/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.2 (Mac OS X)]: Connected on socket F8cIn0t5vwZ2OeHkbbLb
PhantomJS 1.9.2 (Mac OS X) Home page "before each" hook FAILED
    ReferenceError: Can't find variable: page
        at /xxx/client/test/e2e/home.js:6
        at /xxx/node_modules/mocha/mocha.js:4250
        at next (/xxx/node_modules/mocha/mocha.js:4534)
        at /xxx/node_modules/mocha/mocha.js:4538
        at timeslice (/xxx/node_modules/mocha/mocha.js:5531)
PhantomJS 1.9.2 (Mac OS X): Executed 1 of 4 (1 FAILED) ERROR (0.101 secs / 0 secs)

So, variable page is missing. How can I get it without using require?

Been looking for examples but found none. Thanks for any clues!

It is possible, somehow to use phantomjs features when using karma?

I am pretty new to Angular/Karma, and i really like the e2e testing. I am really interesting in making the e2e test with jasmine to capture an screenshot if the test fails.
I saw this thread: #7
But is not clear to me if there is any chance to achieve that phantomjs api calls from the karma e2e tests.


WARN [config]: "/" is proxied, you should probably change urlRoot to avoid conflicts
INFO [karma]: Karma v0.10.4 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.2 (Linux)]: Connected on socket a45DjROxS2bW27aw0lQP
LOG: 'Hello, world!'
PhantomJS 1.9.2 (Linux) ERROR
ReferenceError: Can't find variable: phantom
at ****/test/e2e/phantomscenarios.js:4
PhantomJS 1.9.2 (Linux): Executed 0 of 0 ERROR (0.247 secs / 0 secs)

The config file:


module.exports = function(config){
config.set({

basePath : '../',

files : [
    'test/e2e/**/*.js'
],

autoWatch : false,

//browsers : ['Chrome'],
browsers:  ['PhantomJS'],

frameworks: ['ng-scenario'],

singleRun : true,

proxies : {
  '/': 'http://localhost:8000/'
},

plugins : [
        'karma-junit-reporter',
        'karma-chrome-launcher',
        'karma-firefox-launcher',
        'karma-jasmine',
        'karma-ng-scenario',
        'karma-phantomjs-launcher'
        ],

junitReporter : {
  outputFile: 'test_out/e2e.xml',
  suite: 'e2e'
}

})}

Thanks for the help

PhantomJS 2

Any plans to integrate the use of PhantomJS 2 so ES6 scripts can be run and tested against?

Unable to launch phantomjs

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.16 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
ERROR [launcher]: Cannot start PhantomJS

INFO [launcher]: Trying to start PhantomJS again (1/2).
ERROR [launcher]: Cannot start PhantomJS

INFO [launcher]: Trying to start PhantomJS again (2/2).
ERROR [launcher]: Cannot start PhantomJS

ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.

Execution Time (2014-05-29 08:56:18 UTC)
karma:unit 97.8s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100%

Total 97.8s

PhantomJS: 1.9.2
karma-phantomjs-launcher: 0.1.4
Node: 0.10.28
NPM: 1.4.13
OS: GhostBSD-3.5 ( FreeBSD 9.2 release )
Shell: Fish

How to load a script that use window

Use case:
Adding a polyfill to my tests.

Issue:
ReferenceError: Can't find variable: Window

Karma Configuration

files: [
'polyfill.js',         //the polyfill I want to be part of the page
'test/*.js'           //my test itself
]

To reproduce
I use the webcomponent polyfill

Clue
I know that the issue comes from that the polyfill should be loaded using the PhantomJS API page.evaluate to access to the window or the document object.
The polyfill shouldn't be placed as a test, so where should I declare it?

PhantomJS was not killed in 2000 ms, sending SIGKILL

Hi,

On our machines karma-phantomjs-launcher is not able stop PhantomJS when using singleRun: true.

The output is:

PhantomJS was not killed in 2000 ms, sending SIGKILL

I have to CTRL+C to stop it.

Tested on:

  • Windows 8, x64
  • Windows 7, x86

Thanks

0.1.3: Cannot start PhantomJS

After upgrading 0.1.2 to 0.1.3, I get the error message:

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.2 server started at http://localhost:9001/
INFO [launcher]: Starting browser PhantomJS
ERROR [launcher]: Cannot start PhantomJS

INFO [launcher]: Trying to start PhantomJS again (1/2).
ERROR [launcher]: Cannot start PhantomJS

INFO [launcher]: Trying to start PhantomJS again (2/2).
ERROR [launcher]: Cannot start PhantomJS

ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
Warning: Task "karma:unit" failed. Use --force to continue.

There's no delays between the starting and cannot start messages.

I'm using "^0.1.2" dependency on karma-phantomjs-launcher so I had 2 systems yesterday upgrade to 0.1.3. One is Windows XP and the other Windows 7, both are running nodejs 0.10.26 and phantomjs 1.9.7. On one system phantomjs is in the path, in the other case, karma-phantomjs-launcher is using the version it downloaded itself into its lib folder. I'm running this from grunt. Initially I was using karma 0.10 but tried to upgrade to 0.12.2 to resolve the error with no luck.

Ultimately, I discovered that reverting karma-phantomjs-launcher to 0.1.2 fixes the problem. If I "npm install [email protected]" then build works, if I install 0.1.3 then it fails. This is consistent even when starting from existing project or when deleting all node_modules and allowing npm to totally refresh everything.

ReferenceError: Can't find variable: require

When I run PhantomJS using following command

phantomjs /test/phantom/colorwheel.js

{works fine}

But when I try to run the same file through Karma I am getting following error,

ReferenceError: Can't find variable: require

Any idea what could be possible issue -

Is it something not possible to do ?

Am I missing some config on Karma, Here is code from karma.conf.js

module.exports = function(karma) {
karma.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'test/phantom/colorwheel.js',
],

// list of files to exclude
exclude: [

],
reporters: ['progress'],
port: 9876,
runnerPort: 9100,
colors: true,

logLevel: karma.LOG_INFO,

autoWatch: true,

browsers: ['PhantomJS'],

captureTimeout: 60000,

singleRun: false

});
};

Node version - v0.10.12
Karma version: 0.9.4
PhantomJS - 1.9.1
OS - Mac OS X

Bind polyfill

Would it make sense to add a .bind polyfill? AFIK PhantomJS is the only extant version of webkit without .bind, and I'm having to add it manually for any project that relies on it.

I'd be happy to put together a PR if this is wanted.

Unable to pass arguments

I would like to use the --disk-cache=true and --max-disk-cache-size=XXXXX but I see no way to add additional parameters to the command that's executed. I believe they should be added to the array passed as the second parameter of the _execCommand() call, and that is just hardcoded to be the JS file that loads the tests.

Is there any way you could add this feature so I can have my tests potentially run faster by avoiding HTTP traffic?

After upgrade to 0.3.0: Karma error: "Can not load 'PhantomJS', it is not registered!"

After upgrading to ng-boilerplate 0.3.0, with its updated dependency on grunt-karma 0.5.0, the grunt process stops with a Karma warning: "Can not load 'PhantomJS', it is not registered!".

The problem is that the plugins line of karma-unit.tpl.js only has 'karma-firefox-launcher' and 'karma-chrome-launcher'. Updating it to add 'karma-phantomjs-launcher' will fix the problem.

PhantomJS runs out of memory with Karma and Mocha

Issue

When I run PhantomJS with Karma as a grunt task, I run out of memory at about 350 tests into the 2,500. The problem doesn't happen with Chrome or Firefox.

Karma.Conf

My Karma.conf.js has the following options:

  • basePath = '..'
  • frameworks = ['mocha', 'chai', 'sinon', 'chai-as-promised']
  • files = bower component list followed by javascript file list followed by javascript test files
  • preprocessors = coverage and ng-html2js
  • ngHtml2JsPreprocessor = {},
  • reporters = progress, coverage, junit
  • coverageReporter = {}
  • junitReporter = {}
  • logLevel = DEBUG
  • browsers = PhantomJS
  • singleRun = false
  • browserNoActivityTimeout = 100000

Plugins

I'm using the following Karma plugins

  • karma
  • karma-chai
  • karma-chai-plugins
  • karma-coverage
  • karma-junit-reporter
  • karma-mocha
  • karma-ng-html2js-preprocessor
  • karma-phantomjs-launcher
  • karma-sinon
  • karma-sinon-chai
  • karma-sinon-expect
  • karma-webdriver-launcher

Error

PhantomJS 1.9.8 (Windows 7)...
DEBUG [launcher]: Process PhantomJS exited with code -1073741819
ERROR [launcher]: PhantomJS crashed.

tests silently fail - no logging or error information

Some async tests i've written using mocha, sinon and es6-promise fail on phantomjs whilst running perfectly fine in every other browser tested.

I don't get any error output or console.logs whatsoever - so i'm left in the dark and unsure how i can debug these cases.

Phantomjs not registered

I am trying to set up automated testing using;

*Jenkins
*karma
*karma-launcher-phantomjs

When I run:

karma start karma-jenkins.conf.js

I get:

INFO [karma]: Karma v0.9.2 server started at http://localhost:9876/
WARN [launcher]: Launcher "phantomjs" is not registered!

My Google searches have not turn up anything.

Here are the details of my setup.
Please let me know it there is anything else I can provide.

James


OS = CentOS 5.9 64 bit
Selinux Disabled

node -v
v0.10.5

Installed from source

npm -v
1.2.18

Came with nodejs above

phantomjs --version
1.8.2

Executable located w/in karam-launcher

---karma-jenkins.conf.js---
'''
basePath = '../';
frameworks = ['jasmine']
files = [
'app/lib/angular/angular.js',
'app/lib/angular/angular-.js',
'test/lib/angular/angular-mocks.js',
'app/js/__/
.js',
// this is a local copy of a dradis-provided module, if e2e fail and unit tests pass, check if
// these files are out of sync
'test/unit/websockets.js',
// used to simplify common test data tasks
'test/unit/mockData.js',
'test/unit/*/.js'
];

autoWatch = false;
singleRun = true;

browsers = ['phantomjs'];

junitReporter = {
outputFile: 'test_out/unit.xml',
suite: 'unit'
};
'''

Fails to install on windows

I was trying to install karma on windows and it throws on this package when trying to run node install.js here is the snippet of the npm log

1354 info install [email protected]
1355 verbose unsafe-perm in lifecycle true
1356 silly exec cmd "/c" "node install.js"
1357 silly cmd,/c,node install.js,C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules\phantomjs spawning
1358 info [email protected] Failed to exec install script
1359 info C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules\phantomjs unbuild
1360 verbose from cache C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\package.json
1361 info preuninstall [email protected]
1362 info uninstall [email protected]
1363 verbose false,C:\Users\rseddon\AppData\Roaming\npm\node_modules,C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules unbuild [email protected]
1364 verbose C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules\.bin,[object Object] binRoot
1365 info postuninstall [email protected]
1366 verbose about to build C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher
1367 info C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher unbuild
1368 verbose from cache C:\Users\rseddon\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\package.json
1369 info preuninstall [email protected]
1370 info uninstall [email protected]
1371 verbose true,C:\Users\rseddon\AppData\Roaming\npm\node_modules,C:\Users\rseddon\AppData\Roaming\npm\node_modules unbuild [email protected]
1372 info postuninstall [email protected]
1373 error [email protected] install: `node install.js`
1373 error `cmd "/c" "node install.js"` failed with 1
1374 error Failed at the [email protected] install script.
1374 error This is most likely a problem with the phantomjs package,
1374 error not with npm itself.
1374 error Tell the author that this fails on your system:
1374 error     node install.js
1374 error You can get their info via:
1374 error     npm owner ls phantomjs
1374 error There is likely additional logging output above.
1375 error System Windows_NT 6.1.7601
1376 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "karma-phantomjs-launcher"
1377 error cwd C:\Users\rseddon
1378 error node -v v0.8.18
1379 error npm -v 1.2.2
1380 error code ELIFECYCLE
1381 verbose exit [ 1, true ]

Here's a link to the full log

Karma, PhantomJS : Disconnected during run, waiting for reconnecting.

already I reported this issue in Karma, But i feel this correct place to log this issues ,

myconf.js

 PhantomJS_without_security: {
            base: 'PhantomJS',
            options: {
                windowName: 'PhantomJS (debug)'
            },
            flags: ['--remote-debugger-port=9000']
        }

browsers: ['PhantomJS_without_security'],

then karma start with myconf.js

DEBUG [launcher]: C:\Documents and Settings\sweet\Application Data\npm\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe --remote-debugger-port=9000 C:\DOCUME1\sweet\LOCALS1\Temp\karma-29591838/capture.js

open the Chrome with address URL : http://localhost:9000/
click about:blank
in console : "__run()"

DEBUG [PhantomJS 1.9.2 (Windows XP)]: Disconnected during run, waiting for reconnecting.
WARN [PhantomJS 1.9.2 (Windows XP)]: Disconnected

Chrome console :
Event
bubbles: false
cancelBubble: false
cancelable: false
clipboardData: undefined
currentTarget: WebSocket
defaultPrevented: false
eventPhase: 0
returnValue: true
srcElement: WebSocket
target: WebSocket
timeStamp: 1384407329140
type: "error"
proto: Event

I am new to PhantomJS . not clear where the problem is occurs , Please some help to me . Stuck with 1 week in this issues

Console logging should be enabled by default/easy to enable.

I had to hack my index.js to turn on logging:

    var captureCode = 'var page = require("webpage").create();\n' +
        'page.onConsoleMessage = function(msg, lineNum, sourceId) {\n' +
          'console.log(\'CONSOLE: \' + msg + \' (from line #\' + lineNum + \' in "\' + sourceId + \'")\');\n' +
        '};\n' +
        optionsCode.join('\n') + '\npage.open("' + url + '");\n';

Something like this should be the default (or at least easy to enable) for testing under PhantomJS.

"Executed 0 of 0 ERROR" caused by special character

I have a project which is perfectly running with Chrome but fails with phantomjs ("Executed 0 of 0 ERROR"). There is no error message given by phantomjs (even not in debug logging mode)!

After searching for a while, it finally turned out to be a problem with a "special character" in one of my Jasmine test files (In particular "°").

For example:

describe('weather view', function() {
    it('should display the temperature in °C', function(
        expect(true).toBe(true);
    ));
});
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.7 (Windows 7)]: Connected on socket SnOGT3JYjCP3T8LMiOV0
PhantomJS 1.9.7 (Windows 7): Executed 0 of 0 ERROR (1.694 secs / 0 secs)
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

The actual problem is the "°" character in the string!
For me it's okay if you don't support this but PLEASE give a hint what kind of problem occurred and where it can be found. As I have multiple jasmine files with multiple tests and everything was running fine with Chrome, it was hard to locate this bug without getting any concrete information.

Forced to use local installation of PhantomJS

For reasons I don't want to go into here we are forced to check our node_modules directory into GIT. I would like to have a global npm install of PhantomJS and have the karma-phantomjs-launcher invoke this version instead of the one that gets automatically installed at node_modules/karma-phantomjs-launcher/node_modules/...

I have tried setting the environment variable PHANTOMJS_BIN to the location of the global phantomjs I would like to use, but either this is ignored or there is some config I am missing.

Node version: 0.10.22
Karma version: 0.10.8
karma-phantomjs-launcher version: 0.1.1
phantomjs version: 1.9.2

Severe test performance degradation when using karma-phantomjs-launcher

I am converting a set of about 561 unit tests that were previously running on JSTD to run on Karma 0.12.0 and PhantomJS 1.9.7. I'll freely admit that these unit tests are probably doing all sorts of crazy stuff and not cleaning up properly after themselves and such (I didn't write them).

The tests run pretty quick when using karma-chrome-launcher - ~23 seconds. When I switch that to karma-phantom-launcher, it takes ~20 minutes!

I saw a similar issue (about a year old) on the Karma issues page talking about a 10x slowdown mentioning tweaks such as removing console.log output (ie. console.log = function() {}) and such. I can shave off a couple of minutes if I remove that and also turn off reporting of slow tests.

Thinking maybe this was an issue with PhantomJS, I found a shell script test runner to run my tests directly on PhantomJS. It is able to run them in a little under 2 minutes with no problem. So, this leads me to believe it must be a problem with karma-phantom-launcher.

Interestingly, when I was re-running the tests to get the numbers above, I somehow had one run where everything ran in about 2.5 minutes... not sure how that happened. I immediately re-ran it and it took 20+ minutes again.

My config:

    {
        basePath: '.',
        frameworks: ['jasmine'],
        singleRun: true,
        reporters: ['dots', 'beep'],
        colors: true,
        browsers: ['PhantomJS'],
        reportSlowerThan: 500,
        plugins: [
            'karma-jasmine',
            'karma-phantomjs-launcher',
            'karma-beep-reporter'
        ],
        files: files
    }

Unable to install on windows ()

Hi,

i try to install on a windows machine and get the following error:

npm ERR! error rolling back Error: EPERM, unlink 'C:\xampp\htdocs\acme\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe'
npm ERR! error rolling back  [email protected] { [Error: EPERM, unlink 'C:\xampp\htdocs\acme\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe']
npm ERR! error rolling back   errno: 50,
npm ERR! error rolling back   code: 'EPERM',
npm ERR! error rolling back   path: 'C:\\xampp\\htdocs\\acme\\node_modules\\karma-phantomjs-launcher\\node_modules\\phantomjs\\lib\\phantom\\phantomjs.exe' }
npm ERR! Error: EPERM, unlink 'C:\xampp\htdocs\acme\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe'
npm ERR!  { [Error: EPERM, unlink 'C:\xampp\htdocs\acme\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: 'C:\\xampp\\htdocs\\acme\\node_modules\\karma-phantomjs-launcher\\node_modules\\phantomjs\\lib\\phantom\\phantomjs.exe' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

All my other npm packages install without problems.
I also executed command shell as admin but it didn't work either :-(

Latest phantom js included when installing karma causes launch error on os x

Fresh install of Karma 0.10.1, which in turn installs karma phantomjs launcher, which in turn installs phantomjs. latest install grabs phantomjs 1.9.1-5.

Version from about 2 weeks back grabs phantomjs 1.9.1-0.

1.9.1-0 launches perfectly, however 1.9.1-5 is throwing this error:

ERROR [launcher]: Cannot start PhantomJS
Error: spawn EACCES

Ran through grunt karma task for both versions of phantomjs. since it's a deeply nested dependency, I am not sure how to resolve this so I can run it in a CI environment with phantomjs.

PhantomJS is not killed

PhantomJS is not killed on Windows 8 x64. I have set PHANTOMJS_BIN to the proper exe, but it keeps using the cmd file, thus hanging:

Running "karma:travis" (karma) task
DEBUG [reporter]: Using reporter "progress".
INFO [karma]: Karma server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
DEBUG [launcher]: Creating temp dir at C:\Users\FPONTI~1\AppData\Local\Temp\testacular-31665683
DEBUG [launcher]: C:\Users\fpontillo\AppData\Roaming\npm\phantomjs.cmd C:\Users\FPONTI~1\AppData\Local\Temp\testacular-31665683/capture.js

...

DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Killing PhantomJS

Cannot install with npm v2.0

NPM 2.0 is more strict with semver, so the ~1.9 dependency on phantomjs doesn't match any of the available versions, which are all of the form "<phantomjs_version>-module_version" e.g. 1.9.7-15 is current.

While that versioning is sensible, it causes npm to treat phantomjs as eternally pre-release, so no version of the phantomjs node module satisfies the dependency on karma-phantomjs-launcher.

Ideally the phantomjs team will fix their versions, but in the meantime, could the launcher pin to a particular version e.g "^1.9.7-15" ?

problem with phantomjs dependency

Hi, new Karma plugin system works really well, but I've noticed that it breaks when I run a build process on with npm install on a Ubuntu (12.04) machine:

module.js:340
    throw err;
          ^
Error: Cannot find module '/root/PROJECT_PATH/build-dir/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

npm ERR! [email protected] install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 8
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-45-server
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /root/PROJECT_PATH/build-dir/CON-CONNUI-CON
npm ERR! node -v v0.10.11
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE

Basically I've defined all dependencies as local packages:

"devDependencies": {
    "docco": "~0.6.2",
    "grunt": "~0.4.1",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-coffee": "~0.7.0",
    "grunt-regarde": "~0.1.1",
    "grunt-contrib-connect": "~0.3.0",
    "grunt-jade": "~0.4.0",
    "grunt-contrib-livereload": "~0.1.2",
    "grunt-contrib-stylus": "~0.5.0",
    "grunt-contrib-copy": "~0.4.1",
    "grunt-contrib-clean": "~0.4.1",
    "grunt-bower-task": "~0.2.2",
    "grunt-contrib-compass": "~0.2.0",
    "grunt-html2js": "~0.1.3",
    "karma-phantomjs-launcher": "0.0.2",
    "karma-script-launcher": "0.0.1",
    "karma-firefox-launcher": "0.0.2",
    "karma-chrome-launcher": "0.0.1",
    "karma-requirejs": "0.0.1",
    "karma-jasmine": "0.0.1",
    "karma-coffee-preprocessor": "0.0.1",
    "karma-coverage": "0.0.2",
    "karma-growl-reporter": "0.0.1",
    "karma-junit-reporter": "0.0.1",
    "karma-ng-scenario": "0.0.1"
  }

I've installed karma-phantomjs-runner with npm install -g and everything seems to work fine now. I think I would be better to have a more fine grained control over dependencies, or am I wrong and everything should be installed with -g?

Cannot find module (Documents folder)\install.js

Yo.

Trying to install Karma with the PhantomJS launcher on Win8.1x64.

It works on everyone else's machine. Here are the steps we're taking:

Install Node via .msi for 64 bit

npm install karma --save-dev
npm install karma-jasmine
npm install -g karma-cli

Download PhantomJS static binary from http://phantomjs.org/download.html

npm install karma-phantomjs-launcher

And that's where, on my machine, for some reason I cannot figure out (I have checked SET and ENV, etc.), I get the following error:

npm install karma-phantomjs-launcher
-
> [email protected] install C:\InComm\enterprise-apps\Web\Admin\Scripts\Tests\node_modules\karma-phan
tomjs-launcher\node_modules\phantomjs
> node install.js

module.js:338
    throw err;
          ^
Error: Cannot find module 'C:\Users\celiyah\Documents\install.js'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "node" "C:\\Users\\celiyah\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js"
 "install" "karma-phantomjs-launcher"
npm ERR! node v0.12.0
npm ERR! npm  v2.6.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\InComm\enterprise-apps\Web\Admin\Scripts\Tests\npm-debug.log

I checked with the phantomjs folks and they say it is not their issue since npm isn't even getting to the phantomjs install package, but when I try to install phantomjs I get the same error.

Frustratingly, npm install karma-chrome-launcher works fine.

Installing [email protected] fails - regardless if I have it installed globally

Hey,

We are getting an issue when installing PhantomJS on our TeamCity agents. ' Failed at the [email protected] install script.'

This issue has been around for a while and we've been able to manage it by re running the build but now it is getting more frequent with about 4 fails to 1 success.

We have windows agents with PhantomJS installed globally, we clear the node modules on every build and runs the 'npm install' on every build. (I cannot understand why it is installed globally but it still needs to be downloaded)

We've tried to debug this locally but cannot as it is successful everytime, the only thing I can do is provide the error response:

[11:10:51][Step 3/12] > [email protected] install C:\BuildAgent2\work\7ea1530d04a43808\src\FrontendBuildTasks\node_modules\karma-phantomjs-launcher\node_modules\phantomjs
[11:10:51][Step 3/12] > node install.js
[11:10:51][Step 3/12] Looks like an `npm install -g` on windows; unable to check for already installed version.
[11:10:51][Step 3/12] Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-windows.zip
[11:10:52][Step 3/12] Saving to C:\BuildAgent2\temp\buildTmp\phantomjs\phantomjs-1.9.8-windows.zip
[11:10:52][Step 3/12] Receiving...

[11:11:01][Step 3/12] Received 7292K total.
[11:11:01][Step 3/12] Extracting zip contents
[11:11:01][Step 3/12] Removing E:\Agent 02\work\7ea1530d04a43808\src\FrontendBuildTasks\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom
[11:11:01][Step 3/12] Copying extracted folder C:\BuildAgent2\temp\buildTmp\phantomjs\phantomjs-1.9.8-windows.zip-extract-1427368259546\phantomjs-1.9.8-windows -> E:\Agent 02\work\7ea1530d04a43808\src\FrontendBuildTasks\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom


[11:11:05][Step 3/12] npm ERR! [email protected] install: `node install.js`
[11:11:05][Step 3/12] npm ERR! Exit status 1
[11:11:05][Step 3/12] npm ERR! 
[11:11:05][Step 3/12] npm ERR! Failed at the [email protected] install script.
[11:11:05][Step 3/12] npm ERR! This is most likely a problem with the phantomjs package,
[11:11:05][Step 3/12] npm ERR! not with npm itself.
[11:11:05][Step 3/12] npm ERR! Tell the author that this fails on your system:
[11:11:05][Step 3/12] npm ERR!     node install.js
[11:11:05][Step 3/12] npm ERR! You can get their info via:
[11:11:05][Step 3/12] npm ERR!     npm owner ls phantomjs
[11:11:05][Step 3/12] npm ERR! There is likely additional logging output above.
[11:11:05][Step 3/12] 
[11:11:05][Step 3/12] npm ERR! System Windows_NT 6.1.7601
[11:11:05][Step 3/12] npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
[11:11:05][Step 3/12] npm ERR! cwd C:\BuildAgent2\work\7ea1530d04a43808\src\FrontendBuildTasks
[11:11:05][Step 3/12] npm ERR! node -v v0.10.24
[11:11:05][Step 3/12] npm ERR! npm -v 1.3.21
[11:11:05][Step 3/12] npm ERR! code ELIFECYCLE

Let me know if you need anymore info!

Thanks

Liam

phantomjs-2.0.0-macosx - Killed: 9

PhantomJs build for Os X cannot started. I've checked my system log and I found this in there for PhantomJs: Cannot enforce a hard page-zero for ./phantomjs.

I found this information about the problem: http://stackoverflow.com/questions/26351831/os-x-app-that-runs-on-10-6-to-10-9-doesnt-run-on-10-10-yosemite-why

And I found that the binary is packed by upx, and this cause the problem. After I unpacked it I could use it without problem:
upx -d phantomjs

Please check if it possible to use upx, because the executable is much larger now, but at least works.

Phantomjs runner doesn't work on multiple platform.

I installed the karma-phantomjs-launcher on windows and tried to use same on mac. Looks like it doesnt work on MAC.

I got this error :

ERROR [launcher]: Cannot start PhantomJS
Can not find the binary node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom\phantomjs.exe
Please set env variable PHANTOMJS_BIN
Warning: Task "karma:unit" failed. Use --force to continue.

Is there any solution for this ?

karma-phantomjs-launcher partially missing from npm

A trivial package.json

{
    "name": "example",
    "version": "0.0.0",

    "private": true,
    "devDependencies": {
        "karma": "0.11.5",
        "karma-junit-reporter": "0.1.0",
        "xmlbuilder": "0.4.2"
    }
}

causes Karma to fail to install:

$ npm install
[...]
npm http GET https://registry.npmjs.org/karma-phantomjs-launcher
npm http 304 https://registry.npmjs.org/karma-phantomjs-launcher
npm http GET https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-0.1.1.tgz
npm http 404 https://registry.npmjs.org/karma-phantomjs-launcher/-/karma-phantomjs-launcher-0.1.1.tgz

Digging into the NPM metadata, it looks like https://registry.npmjs.org/karma-phantomjs-launcher claims that 0.1.1 is available from "." but the actual download is missing.

PhantomJS release

Is there any way you could set the PhantomJS package to an exact version instead of ~0.9.0? There was an issue this morning where phantomJS had updated prior to the windows binary being ready, and our CI environment, (*along with many others) was brought down. see Medium/phantomjs#131

PhantomJS install issues with 1.9.7-1

The following snippet occurs when installing this launcher package (~0.1.1) :

[email protected] install /Users/cwood/Workspaces/edge/edge-tdm/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
node install.js

Downloading http://cdn.bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-macosx.zip
Saving to /var/folders/bd/ytqbdgms43126qy99g0cc_v00000gp/T/phantomjs/phantomjs-1.9.7-macosx.zip
Receiving...
Error requesting archive
...
...
...

Please review this issue : Medium/phantomjs#161

Looks like this (karma-phantomjs-launcher) package needs to be updated to the latest release of PhantomJS (1.9.7-8).

Do not download phantomjs if local one is provided

karma package depends on the phantomjs package (via peer dependency on karma-phantomjs-launcher). The trouble with this is that phantomjs package will try to download binary from phantomjs.googlecode.com.

I want to use the older version of PhantomJS (1.8.1) which is available on my local file-system. While I can do that, the latest phantomjs binary will be downloaded nevertheless (adding the local binary to PATH doesn't help here as phantomjs package will do the download if binary in PATH does not match the latest version).

So how can I prevent this download from happening?

Something went terribly wrong when upgrading from 0.1.2 --> 0.1.3

I just downgraded to get everything working again.

Windows 8.1 x64

The 0.1.2 version grabbed the following (right) stuff:

 C:\Users\Alexander\Documents\cx-cui\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe

For some reason, the launcher is trying to grab the following:

C:\Users\Alexander\Documents\cx-cui\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\node_modules\phantomjs\bin\phantomjs

Obviously, the directory node_modules after lib\phantom\ doesn't exist!

Please look into it -- I may dive into the source this weekend.

Thanks for your time.
Alex

install error

I'm trying to setup an angular dev environment using angular-seed inside a vagrant box ( running Ubuntu 12.02 32 Bit / precise32 ) on Windows 7. When I download the angular-seed project and run npm install --no-bin-links I get an error related to phantomJS, Reading through the error shows phantomJS install had an issue with karma-phantomjs-launcher directories not being present. It appears to be happening during the karma-phantomjs-launcher install, so I thought i would start here.

Here is the result of running the install on its own outside of angular-seeds npm install script.

vagrant@precise32:/vagrant$ npm install karma-phantomjs-launcher --no-bin-links
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No README data
Phantom installation failed { [Error: ENOTDIR, not a directory '/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs']
  errno: 27,
  code: 'ENOTDIR',
  path: '/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs',
  syscall: 'chmod' } Error: ENOTDIR, not a directory '/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs'
    at Object.fs.chmodSync (evalmachine.<anonymous>:833:18)
    at Object.chmodSync (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/fs-extra/node_modules/graceful-fs/polyfills.js:141:17)
    at Promise.validExit [as _successFn] (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:145:8)
    at Promise._call (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/kew/kew.js:373:13)
    at Promise._withInput (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/kew/kew.js:333:25)
    at Promise.resolve (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/kew/kew.js:105:27)
    at resolver (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/kew/kew.js:409:17)
    at next (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:70:7)
    at CB (/vagrant/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:106:9)
    at Object.oncomplete (fs.js:108:15)

npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-23-generic-pae
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "karma-phantomjs-launcher" "--no-bin-links"
npm ERR! cwd /vagrant
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

Thanks
-Nathan

Custom launcher flags in wrong position

In my karma.conf.js, I am trying to pass a time zone flag to the launcher.

  customLaunchers: {
      'PhantomJS_custom': {
        base: 'PhantomJS',
        flags: ['TZ=UTC']
      }
    }

This generates a command like
/path/to/phantomjs TZ=UTC /path/to/test-script.js

But that command is invalid. The valid order of flags is:
/path/to/phantomjs /path/to/test-script.js TZ=UTC

Can't load PhantomJS, tried to create a capture at boot

When I started karma here's what I have:

INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Linux)]: Connected on socket K_OSnmGdWVL6vX8zpTq5 with id 86692022
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start PhantomJS again (1/2).

If I look at my processes it seems to capture a page :

tests/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs /tmp/karma-15286258/capture.js

Any idea what's happening here?
Version:

Npm: 1.4.21
Node: 0.10.25
PhantomJS 1.9.8
Karma v0.12.31

Karma cannot start PhantomJS on Windows Server 2012

Hi all,

I have a project that is working on all of the development workstations cross-platform, but not on my Jenkins server. If I remote in with the same account Jenkins uses and run grunt karma, I get a number of Cannot start PhantomJS errors, with no useful debug information aside from the exit code 3221225477 (see below, whereby I have the karma config set to DEBUG).

I have tracked down the phantomJS exe that is being used to the appropriate lib folder beneath karma-phantomjs-launcher in the project's node modules, and verified that it is running that exe.

Is there anything someone can suggest I try?

DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-jade-preprocessor.
DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-ng-html2js-preprocessor.
DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-ng-jade2js-preprocessor.
DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-ng-scenario.
DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-phantomjs-launcher.
DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-requirejs.
DEBUG [plugin]: Loading plugin D:\Jenkins\workspace\...\n
ode_modules/karma-script-launcher.
WARN [karma]: Port 8080 in use
INFO [karma]: Karma v0.12.31 server started at http://localhost:8081/
INFO [launcher]: Starting browser PhantomJS
DEBUG [temp-dir]: Creating temp dir at C:\Users\Jenkins\AppData\Local\Temp\karma
-89315879
DEBUG [launcher]: D:\Jenkins\workspace\...\node_modules\k
arma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe C:\User
s\Jenkins\AppData\Local\Temp\karma-89315879/capture.js
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
bower_components/angular-route/angular-route.js" does not match any file.
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
app/app.coffee" does not match any file.
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
components/**/*.js" does not match any file.
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
components/**/*.coffee" does not match any file.
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
components/**/*.jade" does not match any file.
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
components/**/*.html" does not match any file.
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
app/**/*.coffee" does not match any file.
WARN [watcher]: Pattern "D:/Jenkins/workspace/.../client/
app/**/*.jade" does not match any file.
DEBUG [preprocessor.html2js]: Processing "D:/Jenkins/workspace/...my files...
DEBUG [watcher]: Resolved files: ...my files...
DEBUG [launcher]: Process PhantomJS exited with code 3221225477
ERROR [launcher]: Cannot start PhantomJS

DEBUG [temp-dir]: Cleaning temp dir C:\Users\Jenkins\AppData\Local\Temp\karma-89
315879
INFO [launcher]: Trying to start PhantomJS again (1/2).
DEBUG [launcher]: Restarting PhantomJS
DEBUG [temp-dir]: Creating temp dir at C:\Users\Jenkins\AppData\Local\Temp\karma
-89315879
DEBUG [launcher]: D:\Jenkins\workspace\...\node_modules\k
arma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe C:\User
s\Jenkins\AppData\Local\Temp\karma-89315879/capture.js C:\Users\Jenkins\AppData\
Local\Temp\karma-89315879/capture.js
DEBUG [launcher]: Process PhantomJS exited with code 3221225477
ERROR [launcher]: Cannot start PhantomJS

DEBUG [temp-dir]: Cleaning temp dir C:\Users\Jenkins\AppData\Local\Temp\karma-89
315879
INFO [launcher]: Trying to start PhantomJS again (2/2).
DEBUG [launcher]: Restarting PhantomJS
DEBUG [temp-dir]: Creating temp dir at C:\Users\Jenkins\AppData\Local\Temp\karma
-89315879
DEBUG [launcher]: D:\Jenkins\workspace\...\node_modules\k
arma-phantomjs-launcher\node_modules\phantomjs\lib\phantom\phantomjs.exe C:\User
s\Jenkins\AppData\Local\Temp\karma-89315879/capture.js C:\Users\Jenkins\AppData\
Local\Temp\karma-89315879/capture.js C:\Users\Jenkins\AppData\Local\Temp\karma-8
9315879/capture.js
DEBUG [launcher]: Process PhantomJS exited with code 3221225477
ERROR [launcher]: Cannot start PhantomJS

DEBUG [temp-dir]: Cleaning temp dir C:\Users\Jenkins\AppData\Local\Temp\karma-89
315879
ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
DEBUG [karma]: Run complete, exiting.
DEBUG [launcher]: Disconnecting all browsers
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.

Tests are executed multiple times

Executing the tests in Chrome shows Executed 2 of 2, running in PhantomJS results in

PhantomJS 1.9.7 (Mac OS X): Executed 3 of 2 SUCCESS (0.113 secs / 0.038 secs)

    ✓ exists
    ✓ exists
LOG LOG: 'ROUTER (entry):', '/context.html', Object{path: '/context.html', oldPath: undefined, params: Object{username: 'context.html'}, urlParams: Object{}}
    start
      ✓ calls intercom
LOG LOG: 'ROUTER (entry):', '/context.html', Object{path: '/context.html', oldPath: undefined, params: Object{username: 'context.html'}, urlParams: Object{}}
      ✓ calls intercom
    ✓ exists

sometimes even more duplicates.

Please set env variable PHANTOMJS_BIN

Can't get phantomjs to launch. I have installed karma and karma-phantomjs-launcher both locally and globally. I've tried reverting the versions and manually setting the environment variable but it still doesn't work. I can launch karma-chrome-launcher no problem but would prefer to use phantomjs. Is this a problem with phantomjs itself?

Windows 7, node 0.12, karma 12.31, karma-phantomjs-launcher 0.1.4, phantomjs 1.9.16

Any help is appreciated!

Unable to install v.0.1.4

@vojtajina

I tried installing 0.1.4 with:

$ npm install karma-phantomjs-launcher --save-dev

But got error:

npm WARN package.json [email protected] No README data
npm ERR! Error: EACCES, mkdir '/Users/n/.npm/npmconf/0.0.24'
npm ERR!  { [Error: EACCES, mkdir '/Users/n/.npm/npmconf/0.0.24']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/n/.npm/npmconf/0.0.24',
npm ERR!   parent: 'phantomjs' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "karma-phantomjs-launcher" "--save-dev"
npm ERR! cwd /Users/n/code/learn-karma
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/n/.npm/npmconf/0.0.24
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/n/.npm/npmconf/0.0.24'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/n/code/learn-karma/npm-debug.log
npm ERR! not ok code 0

Do I need to _sudo_ npm install...?

I already have the latest PhantomJS installed. Why am I being forced to re-install it?

Task Breaks when Unit Testing File Named polyfill.js

I have a file named polyfills.js in my project. When I test it using karma-phantomjs-launcher, it breaks with this error:

ReferenceError: Can't find variable: require
at .../src/node_modules/gulp-docco/node_modules/docco/node_modules/fs-extra/node_modules/graceful-fs/polyfills.js:1

It looks like its loading the wrong file.

Renaming my polyfill file fixes the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.