Events API¶
screenwright.events
¶
Event definitions -- Shared Kernel.
AbilityGranted
dataclass
¶
Bases: Event
An Ability has been granted to an Actor.
Source code in src/screenwright/events/screenplay.py
ActorEnteredStage
dataclass
¶
Bases: Event
An Actor has been placed on the Stage.
Source code in src/screenwright/events/screenplay.py
ActorExitedStage
dataclass
¶
Event
dataclass
¶
Base class for all domain events.
Every event is immutable (frozen dataclass), has a unique ID, and a UTC timestamp. The event_type class variable is a string identifier used for serialization dispatch.
Source code in src/screenwright/events/base.py
to_dict()
¶
Serialize this event to a dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
A dict with all fields, including event_type from the class. |
Source code in src/screenwright/events/base.py
FactRemembered
dataclass
¶
Bases: Event
A Fact has been stored by an Actor.
Source code in src/screenwright/events/screenplay.py
FeatureEnded
dataclass
¶
Bases: Event
A BDD Feature file has completed execution.
Source code in src/screenwright/events/bdd.py
FeatureStarted
dataclass
¶
InteractionCompleted
dataclass
¶
Bases: Event
An Interaction has completed successfully.
Source code in src/screenwright/events/screenplay.py
InteractionFailed
dataclass
¶
Bases: Event
An Interaction has failed with an error.
Source code in src/screenwright/events/screenplay.py
InteractionStarted
dataclass
¶
Bases: Event
An Actor has begun executing an Interaction.
Source code in src/screenwright/events/screenplay.py
Outcome
¶
QuestionAnswered
dataclass
¶
Bases: Event
A Question has been answered with a value.
Source code in src/screenwright/events/screenplay.py
QuestionAsked
dataclass
¶
SceneEnded
dataclass
¶
Bases: Event
A BDD Scenario (Scene) has completed execution.
Source code in src/screenwright/events/bdd.py
SceneStarted
dataclass
¶
Bases: Event
A BDD Scenario (Scene) has begun execution.
Source code in src/screenwright/events/bdd.py
SpotlightChanged
dataclass
¶
Bases: Event
The Spotlight has shifted to a different Actor.
Source code in src/screenwright/events/screenplay.py
TaskCompleted
dataclass
¶
Bases: Event
An Actor has finished performing a Task successfully.
Source code in src/screenwright/events/screenplay.py
TaskFailed
dataclass
¶
TaskStarted
dataclass
¶
Bases: Event
An Actor has begun performing a Task.
Source code in src/screenwright/events/screenplay.py
base
¶
Base Event class and Outcome enum for domain events.
Event
dataclass
¶
Base class for all domain events.
Every event is immutable (frozen dataclass), has a unique ID, and a UTC timestamp. The event_type class variable is a string identifier used for serialization dispatch.
Source code in src/screenwright/events/base.py
to_dict()
¶
Serialize this event to a dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
A dict with all fields, including event_type from the class. |
Source code in src/screenwright/events/base.py
bdd
¶
BDD Integration events -- emitted during feature and scenario lifecycle.
FeatureEnded
dataclass
¶
Bases: Event
A BDD Feature file has completed execution.
Source code in src/screenwright/events/bdd.py
FeatureStarted
dataclass
¶
SceneEnded
dataclass
¶
Bases: Event
A BDD Scenario (Scene) has completed execution.
Source code in src/screenwright/events/bdd.py
screenplay
¶
Screenplay Engine events -- emitted by the core domain during test execution.
AbilityGranted
dataclass
¶
Bases: Event
An Ability has been granted to an Actor.
Source code in src/screenwright/events/screenplay.py
ActorEnteredStage
dataclass
¶
Bases: Event
An Actor has been placed on the Stage.
Source code in src/screenwright/events/screenplay.py
ActorExitedStage
dataclass
¶
FactRemembered
dataclass
¶
Bases: Event
A Fact has been stored by an Actor.
Source code in src/screenwright/events/screenplay.py
InteractionCompleted
dataclass
¶
Bases: Event
An Interaction has completed successfully.
Source code in src/screenwright/events/screenplay.py
InteractionFailed
dataclass
¶
Bases: Event
An Interaction has failed with an error.
Source code in src/screenwright/events/screenplay.py
InteractionStarted
dataclass
¶
Bases: Event
An Actor has begun executing an Interaction.
Source code in src/screenwright/events/screenplay.py
QuestionAnswered
dataclass
¶
Bases: Event
A Question has been answered with a value.
Source code in src/screenwright/events/screenplay.py
QuestionAsked
dataclass
¶
SpotlightChanged
dataclass
¶
Bases: Event
The Spotlight has shifted to a different Actor.
Source code in src/screenwright/events/screenplay.py
TaskCompleted
dataclass
¶
Bases: Event
An Actor has finished performing a Task successfully.