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', 'hello@world.com')
  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.
  • 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 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

Like CucumberJS our framework uses scenarios and steps. Unlike CucumberJS, common steps are predefined. That allows you to concentrate on testing and not on building a test framework. We use JavaScript DSL instead of Gherkin, to provide better flexibility in testing.

Powered By