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.29.2
The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure
@serenity-js/assertions3.29.2
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.29.2
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.29.2
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:
- playwright-core(required)~1.47.2
@serenity-js/protractor3.29.2
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:
- protractor(required)^5.0.0 || ^7.0.0
@serenity-js/webdriverio3.29.2
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:
- @wdio/cli(required)^8.40.5
- webdriverio(required)^8.40.5
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.29.2
Serenity/JS Screenplay Pattern library for interacting with REST and other HTTP-based services, supporting comprehensive API testing and blended testing scenarios
Compatible with:
- axios(direct)1.7.7
@serenity-js/local-server3.29.2
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:
- @hapi/hapi(optional)^21.3.10
- express(optional)^4.21.0
- koa(optional)^2.15.3
- restify(optional)^11.1.0
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.29.2
Serenity/JS console reporter that displays test results directly in the standard output
@serenity-js/serenity-bdd3.29.2
Serenity/JS reporting module that produces detailed Serenity BDD test reports and living documentation, enhancing transparency and traceability of test results
Compatible with:
- axios(direct)1.7.7
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.29.2
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 || ^11.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.29.2
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:
- jasmine(required)^5.3.0
@serenity-js/mocha3.29.2
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:
- mocha(required)^10.7.3
@serenity-js/playwright-test3.29.2
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:
- @playwright/test(required)~1.47.2