Serenity/JS
Serenity/JS is a framework designed to make acceptance and regression testing
of modern full-stack applications faster, more collaborative and easier to scale.
Visit serenity-js.org for the latest tutorials
and API docs, and follow @SerenityJS and @JanMolak on Twitter for project updates.
Subscribe to Serenity/JS YouTube channel to get notified when new demos and video tutorials are available.
Learning Serenity/JS
To learn more about Serenity/JS, follow the tutorial, review the examples, and create your own test suite with Serenity/JS template projects.
If you have any questions, join us on Serenity/JS Community Chat.
Serenity/JS WebdriverIO
@serenity-js/webdriverio
module is a Screenplay Pattern-style adapter
for WebdriverIO, that helps with testing Web-based and mobile apps.
Installation
To install this module, run the following command in your WebdriverIO project directory:
npm install --save-dev @serenity-js/{core,webdriverio}
Next, install one of the below test runner adapters.
Usage with Cucumber.js
To use Serenity/JS WebdriverIO with Cucumber.js, install the following adapter:
npm install --save-dev @serenity-js/cucumber
Please note that Serenity/JS WebdriverIO / Cucumber integration supports both Serenity/JS reporting services and native Cucumber.js reporters.
Usage with Jasmine
To use Serenity/JS WebdriverIO with Jasmine, install the following adapter:
npm install --save-dev @serenity-js/jasmine
Usage with Mocha
To use Serenity/JS WebdriverIO with Mocha, install the following adapter:
npm install --save-dev @serenity-js/mocha
Configuring Webdriverio
import { ArtifactArchiver } from '@serenity-js/core';
import { ConsoleReporter } from '@serenity-js/console-reporter';
import { SerenityBDDReporter } from '@serenity-js/serenity-bdd';
import { Photographer, TakePhotosOfFailures } from '@serenity-js/webdriverio';
export const config = {
framework: '@serenity-js/webdriverio',
serenity: {
runner: 'cucumber',
crew: [
ArtifactArchiver.storingArtifactsAt(process.cwd(), 'target/site/serenity'),
ConsoleReporter.forDarkTerminals(),
new SerenityBDDReporter(),
Photographer.whoWill(TakePhotosOfFailures),
]
},
cucumberOpts: {
},
jasmineOpts: {
},
mochaOpts: {
},
specs: [
'./features/**/*.feature',
],
};
Learn more about:
Interacting with websites and web apps
import { actorCalled } from '@serenity-js/core';
import { Ensure, equals } from '@serenity-js/assertions';
import { by, BrowseTheWeb, Navigate, Target, Text } from '@serenity-js/webdriverio';
class SerenityJSWebsite {
static header = Target.the('header').located(by.css('h1'));
}
actorCalled('Wendy')
.whoCan(
BrowseTheWeb.using(browser)
)
.attemptsTo(
Navigate.to('https://serenity-js.org'),
Ensure.that(
Text.of(SerenityJSWebsite.header),
equals('Next generation acceptance testing')
),
)
To learn more, check out the example projects.
Template Repositories
The easiest way for you to start writing web-based acceptance tests using Serenity/JS, WebdriverIO and either Mocha, Cucumber or Jasmine is by using one of the below template repositories:
More coming soon!
New features, tutorials, and demos are coming soon, so follow us on Twitter and join the Serenity/JS Community chat channel to stay up to date!