CodeceptJS

Modern Era Acceptance Testing for NodeJS

Scenario Driven

Write acceptance tests from user's perspective. Every command is described as an action of a user visiting a site.

Backend Agnostic

CodeceptJS provides a general high-level API which can easily be executed using one of popular test runner libraries:

Interactive shell

Control browser in realtime with API of CodeceptJS. Click buttons, fill fields, try different locators inside a running test!

INSTALL npm install -g codeceptjs   Quickstart »

In Action

Feature('CodeceptJS Demonstration');

Scenario('submit form successfully', (I) => {
  I.amOnPage('/documentation')
  I.fillField('Email', '[email protected]')
  I.fillField('Password', '123456')
  I.checkOption('Active')
  I.checkOption('Male');
  I.click('Create User')
  I.see('User is valid')
  I.dontSeeInCurrentUrl('/documentation')
});

Features

  • Synchronous Tests API. You don't need to care about callbacks, or promises, test scenarios are linear, your test should be to.
  • Written from user's perspective. Every action is a method of I. That makes test easy to read, write and maintain even for non-tech persons.
  • Backend agnostic. We don't know which WebDriver implementation is running this test. We can easily switch from WebDriverIO to Protractor or PhantomJS.
  • PageObjects and StepObjects are supported out of the box. They can be generated and used in tests through dependency injection.
  • Web & Mobile Testing supported .
  • Written in ES6 without transpilers. This allows to use latest features of ES6 and NodeJS natively and makes source code modern and easy to extend.

Voice of Developers

Comparisons

Learn what makes CodeceptJS different from current solutions

vs Mocha + WebDriver

CodeceptJS is based on Mocha and uses WebDriverIO library behind the scene. However, complexity of WebDriver libraries are hidden inside DSL for you to concentrate on test scenarios. That also makes CodeceptJS easy to maintain and read.

vs Puppeteer

CodeceptJS has built-in Puppeteer support. However, if you face limitation of Puppeteer library you can easily switch back to Selenium with one config change.

vs Protractor

CodeceptJS is a high-level testing system which incorporates Protractor as a test execution backend. You can write tests in a simple and readable DSL and make them be executed with Protractor for your AngularJS application

vs CucumberJS

CodeceptJS has built in support for Cucumber-style feature files. You can use full power of CodeceptJS (multiple backends, flexible DSL) to write step definitions for your feature files. However, if a real BDD is an overhead for you and you need just testing - CodeceptJS has nice JavaScript DSL with predefined steps so you can focus on testing.

Powered By