API Reference

summary
public
public
public

F actorCalled(name: string): Actor

Instantiates or retrieves an actor Actor called name if one has already been instantiated.

public

Retrieves an actor who was last instantiated or retrieved using actorCalled.

public

F configure(config: SerenityConfig): void

Configures Serenity/JS.

public

F engage(actors: Cast): void

Re-configures Serenity/JS with a new Cast of Actors you'd like to use in any subsequent call to actorCalled.

This function provides an alternative to calling Actor#whoCan directly in your tests and you'd typically us it in a "before each" hook of your test runner of choice.

public

errors

summary
public

Thrown to indicate that an assertion has failed.

public

Thrown to indicate that a test framework or test suite configuration error occurs.

public

Thrown to indicate that the Actor attempted to perform a Task or Interaction that hasn't been implemented yet.

public

Thrown to indicate that an Interaction, a Task or a test scenario can't be executed due to a logical error. For example, it's not possible to assert on the last HTTP Response if the request hasn't been performed yet.

public

Base class for custom errors that may occur during execution of a test scenario.

public

Thrown to indicate that the test can't be performed due to an issue with a downstream dependency. For example, it makes no sense to run a full-stack integration test if we already know that the database server is down.

public

Thrown to indicate that an unknown error has occurred.

events

summary
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public

Emitted when all the tests have finished running.

public

Emitted when the last test in the test suite has finished running and it's time for any last-minute reporting to take place.

public
public
public

io

summary
public
public
public
public
public
public

C Path

public
public
public

F formatted(templates: TemplateStringsArray, placeholders: Array<Answerable<any>>): string

A tag function returning a human-readable description of a template containing one or more Answerables.

public

F inspected(value: Answerable<any>): string

Provides a human-readable description of the {@link Answerable<T>}.

public

F trimmed(templates: TemplateStringsArray, placeholders: Array<string>): string

A tag function trimming the leading and trailing whitespace from multi-line strings.

model

summary
public
public
public
public
public
public
public

C Name

public
public
public
public
public

Indicates a failure due to external events or systems that compromise the validity of the test.

public

Execution of an Activity or Scene has failed due to an assertion error;

public

Indicates a failure due to an error other than recognised external system and assertion failures

public

The result of the scenario should be ignored, most likely because it's going to be retried.

public

The Activity was not executed because a previous one has failed.

public

Scenario or activity ran as expected.

public

A pending Activity is one that has been specified but not yet implemented.

public
public

model/artifacts

summary
public
public

An Artifact describing a HTTP request/response pair.

public
public
public

C Photo

public
public
public

The value of the HTTPRequestResponse Artifact describing a HTTP request/response pair.

model/tags

summary
public

Tagged with an arbitrary tag that doesn't have any special interpretation such as @regression, @wip, etc.

public
public
public
this class was deprecated.

There are a couple of common use-cases for contexts: running the same test in different browsers, and running the same test on different operating systems.

public

Indicates that execution of a given scene has been retried for the currentRetry-th time.

public
public
public
public
public

C Tag

public

screenplay

summary
public

Directly exercises the Actor's Ability to interact with the System Under Test.

public

Enables the Actor to query the system under test.

public

C Task

Aggregates Interactions so that they represents logical steps of a business process an Actor can perform.

public

An Ability enables the Actor to interact with an external interface of the system under test.

public

An interface describing the static access method that every Ability class needs to provide in order to be accessible from within an Interaction.

public

A command object representing an activity that an Actor can perform.

public

An interface to be implemented by any Ability that needs to free up any resources it's using when the test scenario finishes.

public

T Answerable<T>: Question<Promise<T>> | Question<T> | Promise<T> | T

screenplay/abilities

summary
public

Enables the Actor to TakeNote of an answer to a given Question and to retrieve their Note later.

screenplay/actor

summary
public

C Actor

public

Enables the Actor to answer a Question about the system under test

public

Enables the Actor to have an Ability or Abilities to perform some Activity.

public

Enables the Actor to collect Artifacts while the scenario is being executed

public

A StageCrewMember or an Actor that can listen and react to DomainEvents

public

Enables the Actor to perform an Activity, such as a Task or an Interaction

public

Enables the Actor to use an Ability to perform some Activity.

screenplay/interactions

summary
public

C Log

Enables the Actor to log arbitrary static values and answers to Questions, so that they can be printed to the terminal by the ConsoleReporter and attached to the HTML report by the SerenityBDDReporter.

public

C See

this class was deprecated.
public

Enables the Actor to remember an answer to a given Question, and recall it later.

screenplay/questions

summary
public

C Note

Enables the Actor to recall an answer to a given Question, recorded using TakeNote.

public
this class is experimental.

stage

summary
public

C Clock

A Clock tells the time.

public

C Stage

public
public

I Cast

Describes the Actors available to take part in the performance.

public
this class was deprecated. Please use the Cast instead

Prepares the Actor for the performance.

public

You can think of the StageCrewMember as an in-memory micro-service that reacts to DomainEvents from the StageManager.

public
this class was deprecated. Please use serenity.actor() and serenity.actorInTheSpotlight() instead

Makes the Stage object setup in your test runner configuration visible to test steps or test scenarios.

stage/crew/artifact-archiver

summary
public

Stores any Artifacts emitted through ArtifactGenerated events on the FileSystem

stage/crew/stream-reporter

summary
public

Serialises all the DomainEvent objects it receives and streams them as ndjson to the output stream.