Skip to content

Installation

Creating a new project via create-codeceptjs installer is the simplest way to start

Install CodeceptJS + Playwright into current directory

npx create-codeceptjs .

Install CodeceptJS + Puppeteer into current directory

npx create-codeceptjs . --puppeteer

Install CodeceptJS + webdriverio into current directory

npx create-codeceptjs . --webdriverio

Install CodeceptJS + webdriverio into e2e-tests directory:

npx create-codeceptjs e2e-tests --webdriverio

If you plan to use CodeceptJS for API testing only proceed to standard installation

Open a directory where you want to install CodeceptJS tests. If it is an empty directory - create a new NPM package with

npm init -y

Install CodeceptJS with NPM:

Terminal window
npx codeceptjs init

After choosing default helper (Playwright, Puppeteer, WebDriver, etc) a corresponding package should be installed automatically.

If you face issues installing additional packages while running npx codeceptjs init command, install required packages manually using npm

Unless you are using WebDriver - CodeceptJS is ready to go! For WebDriver installation Selenium Server is required 👇

CodeceptJS v4.x supports ECMAScript Modules (ESM) format. To use ESM:

  1. Add "type": "module" to your package.json
  2. Update import syntax in configuration files to use ESM format

For detailed migration instructions and important behavioral changes, see the 3.x → 4.x Migration Guide.

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

We recommend to install them manually or use NPM packages:

Selenium Standalone to install and run Selenium, ChromeDriver, Firefox Driver with one package.

Alternatively, you can execute headless Selenium in Docker for headless browser testing.

Launch Selenium with Chrome browser inside a Docker container:

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