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 for the latest tutorials and API docs, and follow @SerenityJS and @JanMolak on Twitter for project updates.

Learning Serenity/JS

To learn more about Serenity/JS, check out the video below, read 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.

Full-Stack Acceptance Testing with Serenity/JS and the Screenplay Pattern

Serenity/JS REST

@serenity-js/rest module lets your actors interact with and test HTTP REST APIs.


To install this module, as well as axios HTTP client, run the following command in your computer terminal:

npm install --save-dev @serenity-js/{core,rest,assertions} axios

Example test

import { actorCalled } from '@serenity-js/core';
import { CallAnApi, DeleteRequest, GetRequest, LastResponse, PostRequest, Send } from '@serenity-js/rest'
import { Ensure, equals, startsWith } from '@serenity-js/assertions';

const actor = actorCalled('Apisit').whoCan(''));

    // no users present in the system
    Ensure.that(LastResponse.status(), equals(200)),
    Ensure.that(LastResponse.body(), equals([])),

    // create a new test user account
        login: 'tester',
        password: 'P@ssword1',
    Ensure.that(LastResponse.status(), equals(201)),
    Ensure.that(LastResponse.header('Location'), startsWith('/users')),

    // delete the test user account
    Ensure.that(LastResponse.status(), equals(200)),