Installation

Global Installation

CodeceptJS can be installed together with a suitable driver via NPM globally:

[sudo] npm install -g codeceptjs webdriverio
# or
[sudo] npm install -g codeceptjs protractor
# or
[sudo] npm install -g codeceptjs puppeteer
# or
[sudo] npm install -g codeceptjs nightmare

then it can be started anywhere using

codeceptjs

Global installations are easier to use on the command-line, but are not registered in the package.json manifest for your project, so they won't be automatically installed for others who download your source code. It also means you need to install these tools on the CI/Build servers before you can run the tests there.

Local Installation

Use NPM install CodeceptJS:

npm install --save-dev codeceptjs
npm install --save-dev codeceptjs webdriver
# or
npm install --save-dev codeceptjs protractor
# or
npm install --save-dev codeceptjs puppeteer
# or
npm install --save-dev codeceptjs nightmare

and started as

./node_modules/.bin/codeceptjs

WebDriver

WebDriver based helpers like WebDriver, Protractor, Selenium WebDriver will require Selenium Server or PhantomJS installed. They will also require ChromeDriver or GeckoDriver to run corresponding browsers.

We recommend to install them manually or use NPM packages:

or use Docker with Selenium for headless browser testing in a container.

Launch Selenium with Chrome browser inside a Docker container:

docker run --net=host selenium/standalone-chrome