Skip to main content

Serenity/JS API

Serenity/JS is a modular, full-stack acceptance testing framework built on Node.js. The official Serenity/JS Node modules are distributed via NPM under the @serenity-js/* namespace and offer comprehensive test authoring, test integration and test reporting capabilities.

For new test automation projects, consider using Serenity/JS Project Templates. These templates combine popular configurations of Serenity/JS modules with essential integration and test automation tools, providing an excellent starting point and a reference implementation for common test automation scenarios.

For existing test automation projects, the modular architecture of Serenity/JS lets you gradually introduce the framework into existing test suites, allowing for progressive modernisation without disrupting ongoing work.

Below, you'll find a list of all the official Serenity/JS modules and their API documentation. These modules are designed to cover a wide range of test automation needs, ensuring you have the necessary tools to build, manage, and scale your test suites effectively.

Core Modules​

Serenity/JS core modules form the foundation of the Serenity/JS framework, providing essential functionality such as the Screenplay Pattern for structuring your automated tests, reporting infrastructure for capturing the activities of your actors and processing test results, and assertion libraries for verifying test outcomes.

For practical examples of writing different kinds of automated tests using Serenity/JS, check out the Serenity/JS Project Templates.

@serenity-js/core3.25.3

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

@serenity-js/assertions3.25.3

Serenity/JS universal assertion library supporting all types of functional tests, including both web and REST API scenarios

Web Testing​

Serenity/JS web modules offer a standardised abstraction layer on top of popular web integration tools, enabling you to write portable web automation code that follows the Screenplay Pattern and works just as well for end-to-end test scenarios as for UI component tests.

For practical examples of writing web-based tests using Serenity/JS, check out the Serenity/JS Project Templates for web testing and the Serenity/JS web testing tutorial.

@serenity-js/web3.25.3

Serenity/JS Screenplay Pattern library offering a flexible, web driver-agnostic approach for interacting with web-based user interfaces and components, suitable for various testing contexts

@serenity-js/playwright3.25.3

Adapter that integrates @serenity-js/web with Playwright, enabling Serenity/JS reporting and using the Screenplay Pattern to write component and end-to-end test scenarios

Compatible with:

@serenity-js/protractor3.25.3

Adapter that integrates @serenity-js/web with Protractor, enabling Serenity/JS reporting and using the Screenplay Pattern to write end-to-end test scenarios

Compatible with:

@serenity-js/webdriverio3.25.3

Adapter that integrates @serenity-js/web with WebdriverIO, enabling Serenity/JS reporting and using the Screenplay Pattern to write web and mobile test scenarios

Compatible with:

REST API Testing​

Serenity/JS REST modules enable you to automate interactions with REST and other HTTP-based APIs, either as part of dedicated API test suites, or as part of web-based test scenarios.

For practical examples of writing API-based tests using Serenity/JS, check out the Serenity/JS Project Templates for API testing and the Serenity/JS API testing tutorial.

@serenity-js/rest3.25.3

Serenity/JS Screenplay Pattern library for interacting with REST and other HTTP-based services, supporting comprehensive API testing and blended testing scenarios

Compatible with:

@serenity-js/local-server3.25.3

Serenity/JS Screenplay Pattern library for managing local Node.js test servers, including Express, Koa, Hapi, and Restify, to support comprehensive integration testing

Compatible with:

Reporting​

Serenity/JS reporting modules capture information about the activities performed by your actors during a test scenario and translate it into test reports and living documentation of your system.

@serenity-js/console-reporter3.25.3

Serenity/JS console reporter that displays test results directly in the standard output

@serenity-js/serenity-bdd3.25.3

Serenity/JS reporting module that produces detailed Serenity BDD test reports and living documentation, enhancing transparency and traceability of test results

Compatible with:

Test Runners​

Serenity/JS test runner adapters enable you to execute your Serenity/JS test scenarios using popular test runners and integrate them with Serenity/JS reporting services.

@serenity-js/cucumber3.25.3

Serenity/JS test runner adapter for seamless integration with any version of Cucumber.js, facilitating BDD-style test automation and leveraging Serenity/JS reporting capabilities

Compatible with:

  • @cucumber/cucumber(optional)^7.3.2 || ^8.5.0 || ^9.1.0 || ^10.0.0
  • cucumber(optional)^1.3.3 || ^2.3.1 || ^3.2.1 || ^4.2.1 || ^5.0.0 || ^6.0.0

@serenity-js/jasmine3.25.3

Serenity/JS test runner adapter for Jasmine, enabling the use of the Screenplay Pattern in Jasmine-based test suites and leveraging Serenity/JS reporting capabilities

Compatible with:

@serenity-js/mocha3.25.3

Serenity/JS test runner adapter for Mocha, enabling the use of the Screenplay Pattern in Mocha-based test suites and leveraging Serenity/JS reporting capabilities

Compatible with:

@serenity-js/playwright-test3.25.3

Serenity/JS test runner adapter for Playwright Test, combining Playwright's developer experience with the advanced reporting and automation capabilities of Serenity/JS

Compatible with: