Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 2.01 KB

README.md

File metadata and controls

76 lines (51 loc) · 2.01 KB

codeceptjs NPM version

Modern Era Aceptance Testing Framework for NodeJS

CodeceptJS is a new testing framework for end-to-end testing with WebDriver (or others). It abstracts browser interaction to simple steps which is written from a user perspective. A simple test that verifies that "Welcome" text is present on a main page of a site will look like:

Feature('CodeceptJS demo');

Scenario('check Welcome page on site', (I) => {
  I.amOnPage('/');
  I.see('Welcome');
}

Codeception tests are:

  • Synchronous. You don't need to care about callbacks, or promises, test scenarios are linear, your test should be to.
  • Written from user's perspecitve. Every action is a method of I, which emulates user interaction.
  • backend API agnostic. We don't know which WebDriver implementation is running this test. We can easily switch from WebDriverIO to Protractor or PhantomJS.

Install

$ npm install -g codeceptjs

Usage

codeceptjs init

WIP

Examples

var assert = require('assert');
Feature('CodeceptJS Demonstration');

Scenario('test some forms', (I) => {
  I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/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');
});

WIP

License

MIT © DavertMik