Skip to content

Running tests in PhantomJS

Marius edited this page Aug 10, 2016 · 5 revisions

Running tests in PhantomJS is possible with the aid of GhostDriver.

Getting started

  1. Download the latest stable PhantomJS.

  2. Configure the path; set the location to the binary in desiredCapabilities in nightwatch.json, such as:

"desiredCapabilities" : {
  "browserName" : "phantomjs",
  "javascriptEnabled" : true,
  "acceptSslCerts" : true,
  "phantomjs.binary.path" : "/path/to/phantomjs",
  "phantomjs.cli.args" : []
}

Use phantomjs.cli.args array to pass arguments directly. E.g. '--ignore-ssl-errors=true'.

More Info

For more info about GhostDriver and its specific capabilities, please refer to the official GhostDriver Project.