Write acceptance tests from user's perspective. Every command is described as an action of a user visiting a site.
CodeceptJS provides a general high-level API which can easily be executed using one of popular test runner libraries:
Control browser in realtime with API of CodeceptJS. Click buttons, fill fields, try different locators inside a running test!
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')
});
Implementing acceptance tests for the massive codebase at @KingdomAdvisors has been a joy, thanks to @CodeceptJS #craftcms
— Selvin Ortiz (@selvinortiz) January 25, 2016
Starting playing around with @CodeceptJS today. Very easy to set-up and loving the interactive shell - very useful #testing
— David Wardlaw (@DaveyBoyWardlaw) February 15, 2016
Learn what makes CodeceptJS different from current solutions
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.
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
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.