CodeceptJS docs | Skip to content

CodeceptJS docs

CodeceptJS

End-to-end testing, written like prose.

Write less. Test more.
Works with Playwright, WebDriver, Puppeteer, and Appium.

v4 · MIT · Node 20+
tests/todo_test.js running…
 

For Humans & Agents

Simple, yet professional.

Architecture and test design applied by default

milestones.test.ts
Feature('Milestones');
Before(({ login }) => {  login();});
Scenario('Create a milestone @smoke', ({ milestonePage }) => {  milestonePage.open();  milestonePage.create({ name: 'Q2 Release', dueDate: '2024-06-30' });  milestonePage.checkVisible('Q2 Release');});
Scenario('Milestone tracks task progress', ({ I, milestonePage }) => {  milestonePage.open();  milestonePage.select('Q2 Release');  I.see('0 / 5 tasks', '.progress');  I.see('0%', '.progress-bar');});
Scenario('Complete a milestone', ({ I, milestonePage }) => {  milestonePage.open();  milestonePage.select('Q2 Release');  I.click('Mark as Complete');  I.see('Completed', '.milestone-status');});

Built to last.

01

Tests that outlive the framework wars

CodeceptJS started in 2015. We watched Protractor, TestCafe, NightmareJS come and go, how WebDriver and CDP tools evolve. But our tests never changed. A test which was running on Protractor back then runs on Playwright today. Whatever comes next: your tests stay.
02

Write what, not how

I.click('Login') finds the button — by text, by label, by ARIA role, by CSS — and clicks it. You describe the action. The framework picks the strategy. The test reads like the spec it came from.
03

The smallest API in browser testing

A dozen commands cover most of what you'll write. Less to learn on day one, a test file a junior can read on the first morning. Simplicity is the feature.
04

Healing, end to end

React to instability. When a selector breaks, AI can rewrite it on the fly. When the network blips, API calls restart. Tests adapt to environment changes instead of failing on them.
05

Designed for agentic testing

Claude or Cursor run a test and can control it live via MCP server. No guessing, running, and retrying loop. Agent can set a breakpoint and debug test in realtime in a browser.
06

Mobile, native, web — one framework

Appium for iOS and Android. The same I.click or I.tap(), I.see, I.swipeLeft you use on the web. Mobile testing works on same princinples.
07

Page Objects you compose, never import

A page object can use any other page object, custom step, or helper by name. The DI container resolves them at runtime. One page object can reference other and vise versa with no more circular import failure.
08

Data declared, not scripted

Declare your API endpoints once, use built-in tools to create and clean up date in each test. A new user needed? Declare it: I.have('user', { role: 'admin' }) this creates one, and removes after a test.
09

Output you can actually read

Steps by step output, useful debug introspections by default. You see how test goes, you see when it goes wrong, screenshots are generated automatically.

No tests yet? Agent can test for you!

Explorbot on GitHub

We also created Explorbot — the world's first open-source self-testing agent. It explores your site, writes tests as it goes, and runs autonomously for hours on CI. Already have a regression suite? Explorbot finds the paths it never touched. Explorbot is powered by CodeceptJS and writes its tests.

Free · Open source · Powered by CodeceptJS

What teams say.

“Test an application like Percona Monitoring and Management with so many dashboards & metric plots.”
Puneet Kala
Frontend QA Automation Engineer · Percona
“CodeceptJS helps us write tests which are good to read and easy to write, run on several browsers.”
Mitko Tschimev
Frontend Tech Lead · My Porsche Core

Trusted by industry leaders

BC logo
Doxy.me logo
Gen3 logo
Isotipo logo
Kiabi logo
Mynd logo
Zenitech logo

Testing can be damn simple

for you and your agent

Click to copy. Then start writing scenarios.

Free. Open source. MIT.