Question

I'm trying to setup Intern to run with PhantomJS on a Windows 7 machine

Since now my setup is as follows:

demo test root/unit/tests/phantom.js:

define([
    'intern!object',
    'intern/chai!assert'
], function(registerSuite, assert) {

registerSuite({
    name: 'PhantomTest',

    'dummy': function () {
        assert(true, "Works!");
    }

});

});

Configuration file root/unit/intern.config.js:

define({

proxyPort: 9000,

proxyUrl: 'http://localhost:9000/',

capabilities: {
    'selenium-version': '2.30.0'
},

environments: [
    {
      browserName: 'phantom'
    }
],
maxConcurrency: 3,

useSauceConnect: false,

webdriver: {
    host: 'localhost',
    port: 4444
},

// used here
loader: {
},

suites: [ 'unit/tests/phantom.js' ],


functionalSuites: [ /* 'myPackage/tests/functional' */ ],


excludeInstrumentation: /^tests\//
});

By running this test and config in a browser it just works.

To run Intern with PhantomJS i execute:

phantomjs --webdriver=4444

And:

cd root
node node_modules\intern\runner.js config=unit/intern.config

The console running Phantomjs then returns:

[INFO  - 2013-07-01T21:29:07.253Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 42ba5b50-e295-11e2-86f7-e331eb8b922d

While the other one outputs the following message without any further log:

Defaulting to "runner" reporter
Listening on 0.0.0.0:9000
Initialised phantomjs 1.9.1 on windows-7-32bit

Any hint on what i'm missing?

Was it helpful?

Solution

The reason for this is https://github.com/ariya/phantomjs/issues/10522; phantomjs is using an extremely old version of JavaScriptCore that has no Function.prototype.bind. Your best bet at this moment is to switch to using the geezer version of Intern, which should work properly in this older environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top