Phantomjs page.open fails as undefined
I have a Rails-Ember project that was recently configured for QUnit unit tests and everything works fine in the browser. Now I am trying to run it on our Jenkins server with no problem.
For added fun, our Jenkins server doesn't have access to the outside internet because it's an enterprise.
So I am trying to do this with Phantomjs and PhantomJS Qunit Runner Plugin . This works fine on my local machine.
I'm trying to get it running on a CI server by deploying a rails daemon server and then running the script.
# some environment variables are set up here
$ rails s -p 6000 --daemon
$ phantomjs vendor/assets/javascripts/runner.js http://localhost:6000/qunit
What happened to "Failed to access the network: failed"
$ wget http://localhost:6000/qunit
Load the HTML page with all the appropriate script and QUnit Fixture tags, so everything is ready to run as expected.
I modified the script to get more information ala [this and I am catching the reason on the Error resource:
page.onResouceError = function(resourceError) {
page.reason = resourceError.errorString
}
Then the error appears
"Failed to access network: failed because undefined"
So let's exit the script and just run PhantomJS as a command line utility:
phantomjs > var page = require('webpage').create()
phantomjs > page.open("http://localhost:6000/qunit", function(status) { console.log status })
undefined
So, I'm a little bit at the end of my rope. I'm not sure what else to try.
For reference, the phantomjs binary I am using is 1.9.2
$ ./phantomjs -v
1.9.2
source to share
No one has answered this question yet
Check out similar questions: