Serenity/JS Documentation

website·Indexed 34 days ago

https://serenity-js.org

A framework for acceptance testing that implements the Screenplay Pattern. Serenity/JS integrates with test runners and tools including Playwright Test, WebdriverIO, Cucumber, Mocha, Jasmine, and Protractor. It provides specialized modules for web, mobile, Electron, and REST/HTTP API testing, along with reporting options such as the Serenity BDD reporter, HTML reporter, and ConsoleReporter.

Tokens
240.1K
Snippets
1.6K
Records
2K
Agent score
69%

What's inside Serenity/JS

  1. Overview of the Locator class

    The Locator class is used to locate a single PageElement or multiple PageElements within a Page by utilizing a Selector. It serves as a base for more specific locator implementations like RootLocator.
  2. Overview of @serenity-js/web

    @serenity-js/web is a TypeScript-first library for interacting with web applications using the Screenplay Pattern. It provides a unified API that allows tests to be portable across different automation engines and supports both end-to-end and component-level testing. It integrates with test runners including Playwright Test, WebdriverIO, Mocha, Jasmine, and Cucumber.js, and supports all Serenity/JS reporting features.
  3. Overview of @serenity-js/core

    @serenity-js/core provides the core APIs for implementing the Screenplay Pattern in automated tests. It includes actor lifecycle management, ability management, TypeScript-first strong typing, and integration points for test runners and reporting tools.
  4. Overview of the BrowsingSession class

    The BrowsingSession class represents the pages open in the current browsing context. It is primarily used by developers who are integrating Serenity/JS with a new Web integration tool to manage the lifecycle and state of browser pages.
  5. Overview of Serenity/JS Modular Architecture

    Serenity/JS is a modular, full-stack acceptance testing framework built on Node.js. It uses the Screenplay Pattern to structure automated tests and provides a standardized abstraction layer to ensure portable automation code. The framework is distributed via NPM under the @serenity-js/* namespace.
  6. Overview of Serenity/JS for Electron testing

    Serenity/JS allows developers to test Electron applications using the same Screenplay Pattern APIs used for web testing (such as Click, Enter, and Ensure). It leverages Playwright's Electron support to connect to the app's renderer process, providing expressive tests, reusable interactions, and structured reporting without requiring Electron-specific testing APIs.
  7. Overview of the Serenity/JS web module

    The Serenity/JS web module is an abstraction layer designed to work on top of web integration tools such as WebdriverIO, Playwright, and Protractor. Its primary purpose is to enable the creation of portable test code libraries that can be shared and reused across different projects and teams, regardless of the underlying automation tool used.
  8. Overview of the Stage class

    The Stage is the central event bus in Serenity/JS. It propagates domain events to the actors it instantiates and to registered stage crew members. While it provides the underlying infrastructure for actor management and event distribution, developers typically interact with it indirectly through helper functions like actorCalled and actorInTheSpotlight rather than manipulating the Stage instance directly in tests.
  9. Overview of the List class in Serenity/JS

    The List<Item_Type> class is a Screenplay Pattern-style wrapper around JavaScript Array and array-like structures. It allows developers to treat collections of items as questions that can be answered by an actor, providing a fluent API for filtering, mapping, and extracting specific elements from a list.
  10. Overview of Serenity/JS reporting architecture

    Serenity/JS reporting follows a 'stage crew' metaphor. Reporting services are implemented as StageCrewMembers that observe Actors on a Stage, monitor the Activities they perform, and listen to domain events emitted by the environment. These members use the gathered information to generate artifacts (like test reports), trigger other crew members, or perform side effects such as writing files to disk or making network calls.
  11. Overview of Serenity/JS Abilities

    Abilities are core building blocks of the Screenplay Pattern. They act as wrappers (adapters) around integration libraries required to communicate with a system under test (e.g., web browser drivers, HTTP clients, or database clients). Abilities encapsulate the configuration, initialization, and resource management of these libraries, providing a consistent API that enables test code portability across different integration tools.
  12. Overview of @serenity-js/serenity-bdd

    @serenity-js/serenity-bdd enables Serenity BDD reports and living documentation for Serenity/JS test suites. It generates rich HTML and JSON reports and supports tags, screenshots, and step-level reporting. It integrates with Cucumber, Mocha, Jasmine, Playwright, and WebdriverIO.