PhantomJs
Please note: From June 2019, Wallaby.js no longer uses PhantomJs as its default test runner. Additionally, Wallaby.js will
no longer ship with PhantomJs version 2.1.1. If you would like to use PhantomJs, you must configure to use it
explicitly by providing the env.kind
setting. If you rely on the PhantomJs version that ships with Wallaby.js, you
will need to configure your project to include PhantomJs as a dependency.
While we support the use of PhantomJs, PhantomJs has been deprecated in favor of headless chrome. We recommend changing your Wallaby configuration to use Google Chrome (headless) instead of PhantomJs for browser-based tests.
If you need to use PhantomJs, you can add it to your project using:
After installing PhantomJs in your project, you will need to update your wallaby configuration:
If you have another version of PhantomJs installed in your project’s node_modules
and have specified phantomjs
in your configuration’s env.kind
setting, then no further configuration is required.
If you are not using the latest version of Wallaby, or would like to use a system-level PhantomJs, you may use the
env.runner
setting to specify the path to it.
Relative path is supported, so if you have an NPM module that installs platform-specific PhantomJs version, for example phantomjs-prebuilt), you may just reference PhantomsJs 2 like so:
You may also use absolute path or even just phantomjs
if you have it in PATH
:
PhantomJs 1.9.8
Previously, wallaby.js was using PhantomJs 1.9.8. If you would like to switch back to this version, you may do this:
Or, if you have PhantomJs 1.9.8 path set in your system environment, you may just do:
You may also specify a relative or absolute path to the PhantomJs 1.9.8 executable.
Passing PhantomJs params
You may pass PhantomJs params, for example --local-to-remote-url-access=true
, via env.params.runner.