Installation
QuickStart Via Installer
Section titled “QuickStart Via Installer”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 . --puppeteerInstall CodeceptJS + webdriverio into current directory
npx create-codeceptjs . --webdriverioInstall CodeceptJS + webdriverio into e2e-tests directory:
npx create-codeceptjs e2e-tests --webdriverioIf you plan to use CodeceptJS for API testing only proceed to standard installation
Standard Installation
Section titled “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 -yInstall CodeceptJS with NPM:
npx codeceptjs initAfter 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 initcommand, install required packages manually using npm
Unless you are using WebDriver - CodeceptJS is ready to go! For WebDriver installation Selenium Server is required 👇
ESM Support
Section titled “ESM Support”CodeceptJS v4.x supports ECMAScript Modules (ESM) format. To use ESM:
- Add
"type": "module"to yourpackage.json - 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
Section titled “WebDriver”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:
docker run --net=host selenium/standalone-chrome