externalStage
Implements
Index
Constructors
externalconstructor
Parameters
externalcast: Cast
externalmanager: StageManager
externalerrors: ErrorFactory
externalclock: Clock
externalinteractionTimeout: Duration
Returns Stage
Properties
publicstaticexternalreadonlyunknownSceneId
Methods
externaltheActorCalled
An alias for
Stage.actor
Parameters
externalname: string
Returns Actor
externalactor
externaltheActorInTheSpotlight
Returns the last
Actor
instantiated viaStage.actor
. Useful when you don't can't or choose not to reference the actor by their name.Returns Actor
externaltheShowHasStarted
Returns
true
if there is anActor
in the spotlight,false
otherwise.Returns boolean
externalengage
Configures the Stage to prepare actors instantiated via
Stage.actor
using the provided cast.Parameters
externalactors: Cast
Returns void
externalassign
Assigns listeners to be notified of Serenity/JS domain events emitted via
Stage.announce
.sParameters
externalrest...listeners: ListensToDomainEvents[]
Returns void
externalannounce
Notifies all the assigned listeners of the events, emitting them one by one.
Parameters
externalrest...events: DomainEvent[]
Returns void
externalcurrentTime
Returns current time. This method should be used whenever
DomainEvent
objects are instantiated by you programmatically.Returns Timestamp
externalassignNewSceneId
Generates and remembers a
CorrelationId
for the current scene.This method should be used in custom test runner adapters when instantiating a SceneStarts event.
Learn more
Returns CorrelationId
externalcurrentSceneId
Returns CorrelationId
externalassignNewActivityId
Generates and remembers a
CorrelationId
for the currentActivity
.This method should be used in custom test runner adapters when instantiating the ActivityStarts event.
Learn more
Parameters
externalactivityDetails: ActivityDetails
Returns CorrelationId
externalcurrentActivityId
Returns CorrelationId
externalwaitForNextCue
Returns a Promise that will be resolved when any asynchronous post-processing activities performed by Serenity/JS are completed.
Invoked in Serenity/JS test runner adapters to inform the test runner when the scenario has finished and when it's safe for the test runner to proceed with the next test, or finish execution.
Returns Promise<void>
externalcreateError
Type parameters
- RE: RuntimeError
Parameters
externalerrorType: new (...args: any[]) => RE
externaloptions: ErrorOptions
Returns RE
Stage is the place where actors perform.
In more technical terms, the Stage is the main event bus propagating Serenity/JS domain events to actors it instantiates and stage crew members that have been registered with it.
It is unlikely that you'll ever need to interact with the
Stage
directly in your tests. Instead, you'll use functions likeactorCalled
andactorInTheSpotlight
.Learn more
configure
engage
StageCrewMember