@serenity-js/core 3.42.2 → 3.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/esm/Serenity.d.ts +3 -1
- package/esm/Serenity.d.ts.map +1 -1
- package/esm/Serenity.js +4 -3
- package/esm/Serenity.js.map +1 -1
- package/esm/config/SerenityConfig.d.ts +1 -1
- package/esm/config/SerenityConfig.js +1 -1
- package/esm/events/SceneFinishes.d.ts +1 -1
- package/esm/events/SceneFinishes.js +1 -1
- package/esm/events/actor/ActorStageExitCompleted.d.ts +1 -1
- package/esm/events/actor/ActorStageExitCompleted.js +1 -1
- package/esm/events/actor/ActorStageExitFailed.d.ts +1 -1
- package/esm/events/actor/ActorStageExitFailed.js +1 -1
- package/esm/events/actor/ActorStageExitStarts.d.ts +1 -1
- package/esm/events/actor/ActorStageExitStarts.js +1 -1
- package/esm/screenplay/Actor.d.ts +3 -3
- package/esm/screenplay/Actor.d.ts.map +1 -1
- package/esm/screenplay/Actor.js +7 -8
- package/esm/screenplay/Actor.js.map +1 -1
- package/esm/screenplay/abilities/Ability.d.ts +6 -6
- package/esm/screenplay/abilities/Ability.js +6 -6
- package/esm/screenplay/abilities/Discardable.d.ts +5 -4
- package/esm/screenplay/abilities/Discardable.d.ts.map +1 -1
- package/esm/screenplay/abilities/Discardable.js +25 -1
- package/esm/screenplay/abilities/Discardable.js.map +1 -1
- package/esm/screenplay/abilities/Initialisable.d.ts +9 -8
- package/esm/screenplay/abilities/Initialisable.d.ts.map +1 -1
- package/esm/screenplay/abilities/Initialisable.js +22 -1
- package/esm/screenplay/abilities/Initialisable.js.map +1 -1
- package/esm/stage/ActorLifecycleManager.d.ts +191 -0
- package/esm/stage/ActorLifecycleManager.d.ts.map +1 -0
- package/esm/stage/ActorLifecycleManager.js +255 -0
- package/esm/stage/ActorLifecycleManager.js.map +1 -0
- package/esm/stage/Stage.d.ts +22 -38
- package/esm/stage/Stage.d.ts.map +1 -1
- package/esm/stage/Stage.js +61 -117
- package/esm/stage/Stage.js.map +1 -1
- package/esm/stage/StageManager.d.ts +2 -4
- package/esm/stage/StageManager.d.ts.map +1 -1
- package/esm/stage/StageManager.js +0 -5
- package/esm/stage/StageManager.js.map +1 -1
- package/esm/stage/index.d.ts +1 -0
- package/esm/stage/index.d.ts.map +1 -1
- package/esm/stage/index.js +1 -0
- package/esm/stage/index.js.map +1 -1
- package/lib/Serenity.d.ts +3 -1
- package/lib/Serenity.d.ts.map +1 -1
- package/lib/Serenity.js +4 -3
- package/lib/Serenity.js.map +1 -1
- package/lib/config/SerenityConfig.d.ts +1 -1
- package/lib/config/SerenityConfig.js +1 -1
- package/lib/events/SceneFinishes.d.ts +1 -1
- package/lib/events/SceneFinishes.js +1 -1
- package/lib/events/actor/ActorStageExitCompleted.d.ts +1 -1
- package/lib/events/actor/ActorStageExitCompleted.js +1 -1
- package/lib/events/actor/ActorStageExitFailed.d.ts +1 -1
- package/lib/events/actor/ActorStageExitFailed.js +1 -1
- package/lib/events/actor/ActorStageExitStarts.d.ts +1 -1
- package/lib/events/actor/ActorStageExitStarts.js +1 -1
- package/lib/screenplay/Actor.d.ts +3 -3
- package/lib/screenplay/Actor.d.ts.map +1 -1
- package/lib/screenplay/Actor.js +6 -7
- package/lib/screenplay/Actor.js.map +1 -1
- package/lib/screenplay/abilities/Ability.d.ts +6 -6
- package/lib/screenplay/abilities/Ability.js +6 -6
- package/lib/screenplay/abilities/Discardable.d.ts +5 -4
- package/lib/screenplay/abilities/Discardable.d.ts.map +1 -1
- package/lib/screenplay/abilities/Discardable.js +27 -0
- package/lib/screenplay/abilities/Discardable.js.map +1 -1
- package/lib/screenplay/abilities/Initialisable.d.ts +9 -8
- package/lib/screenplay/abilities/Initialisable.d.ts.map +1 -1
- package/lib/screenplay/abilities/Initialisable.js +24 -0
- package/lib/screenplay/abilities/Initialisable.js.map +1 -1
- package/lib/stage/ActorLifecycleManager.d.ts +191 -0
- package/lib/stage/ActorLifecycleManager.d.ts.map +1 -0
- package/lib/stage/ActorLifecycleManager.js +259 -0
- package/lib/stage/ActorLifecycleManager.js.map +1 -0
- package/lib/stage/Stage.d.ts +22 -38
- package/lib/stage/Stage.d.ts.map +1 -1
- package/lib/stage/Stage.js +57 -113
- package/lib/stage/Stage.js.map +1 -1
- package/lib/stage/StageManager.d.ts +2 -4
- package/lib/stage/StageManager.d.ts.map +1 -1
- package/lib/stage/StageManager.js +0 -5
- package/lib/stage/StageManager.js.map +1 -1
- package/lib/stage/index.d.ts +1 -0
- package/lib/stage/index.d.ts.map +1 -1
- package/lib/stage/index.js +1 -0
- package/lib/stage/index.js.map +1 -1
- package/package.json +3 -3
- package/src/Serenity.ts +5 -2
- package/src/config/SerenityConfig.ts +1 -1
- package/src/events/SceneFinishes.ts +1 -1
- package/src/events/actor/ActorStageExitCompleted.ts +1 -1
- package/src/events/actor/ActorStageExitFailed.ts +1 -1
- package/src/events/actor/ActorStageExitStarts.ts +1 -1
- package/src/screenplay/Actor.ts +8 -11
- package/src/screenplay/abilities/Ability.ts +6 -6
- package/src/screenplay/abilities/Discardable.ts +9 -4
- package/src/screenplay/abilities/Initialisable.ts +15 -8
- package/src/stage/ActorLifecycleManager.ts +314 -0
- package/src/stage/Stage.ts +87 -165
- package/src/stage/StageManager.ts +3 -7
- package/src/stage/index.ts +1 -0
package/esm/stage/Stage.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ensure, isDefined
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ensure, isDefined } from 'tiny-types';
|
|
2
|
+
import { ErrorFactory, LogicError } from '../errors/index.js';
|
|
3
|
+
import { ActorStageExitAttempted, ActorStageExitCompleted, ActorStageExitFailed, ActorStageExitStarts, SceneFinishes, SceneStarts, TestRunFinishes } from '../events/index.js';
|
|
4
4
|
import { CorrelationId, Name } from '../model/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ActorLifecycleManager } from './ActorLifecycleManager.js';
|
|
6
6
|
/**
|
|
7
7
|
* Stage is the place where [actors](https://serenity-js.org/api/core/class/Actor/) perform.
|
|
8
8
|
*
|
|
@@ -20,49 +20,31 @@ import { Actor, ScheduleWork } from '../screenplay/index.js';
|
|
|
20
20
|
* @group Stage
|
|
21
21
|
*/
|
|
22
22
|
export class Stage {
|
|
23
|
-
cast;
|
|
24
23
|
manager;
|
|
25
24
|
errors;
|
|
26
25
|
clock;
|
|
27
|
-
interactionTimeout;
|
|
28
26
|
sceneIdFactory;
|
|
29
27
|
static unknownSceneId = new CorrelationId('unknown');
|
|
30
|
-
/**
|
|
31
|
-
* Actors instantiated after the scene has started,
|
|
32
|
-
* who will be dismissed when the scene finishes.
|
|
33
|
-
*/
|
|
34
|
-
actorsOnFrontStage = new Map();
|
|
35
|
-
/**
|
|
36
|
-
* Actors instantiated before the scene has started,
|
|
37
|
-
* who will be dismissed when the test run finishes.
|
|
38
|
-
*/
|
|
39
|
-
actorsOnBackstage = new Map();
|
|
40
|
-
actorsOnStage = this.actorsOnBackstage;
|
|
41
|
-
/**
|
|
42
|
-
* The most recent actor referenced via the [`Actor`](https://serenity-js.org/api/core/class/Actor/) method
|
|
43
|
-
*/
|
|
44
|
-
actorInTheSpotlight = undefined;
|
|
45
|
-
/**
|
|
46
|
-
* The scene in which the spotlight was last set.
|
|
47
|
-
* Used to detect when the spotlight shifts to a different scene context.
|
|
48
|
-
*/
|
|
49
|
-
sceneOfSpotlightedActor = undefined;
|
|
50
28
|
currentActivity = undefined;
|
|
51
29
|
currentScene = Stage.unknownSceneId;
|
|
30
|
+
actorLifecycleManager;
|
|
52
31
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
* Creates a new Stage instance.
|
|
33
|
+
*
|
|
34
|
+
* @param cast - The default cast to use for preparing actors
|
|
35
|
+
* @param manager - The stage manager responsible for notifying listeners of domain events
|
|
36
|
+
* @param errors - Factory for creating runtime errors with proper context
|
|
37
|
+
* @param clock - Clock used for timestamping domain events
|
|
38
|
+
* @param interactionTimeout - Default timeout for actor interactions
|
|
39
|
+
* @param sceneIdFactory - Factory for creating scene correlation IDs
|
|
40
|
+
* @param actorLifecycleManager - Optional custom ActorLifecycleManager instance.
|
|
41
|
+
* When provided, allows test runner adapters to control actor lifecycle programmatically.
|
|
42
|
+
* If not provided, a default manager is created.
|
|
43
|
+
*/
|
|
44
|
+
constructor(cast, manager, errors, clock, interactionTimeout, sceneIdFactory = CorrelationId, actorLifecycleManager) {
|
|
62
45
|
this.manager = manager;
|
|
63
46
|
this.errors = errors;
|
|
64
47
|
this.clock = clock;
|
|
65
|
-
this.interactionTimeout = interactionTimeout;
|
|
66
48
|
this.sceneIdFactory = sceneIdFactory;
|
|
67
49
|
ensure('Cast', cast, isDefined());
|
|
68
50
|
ensure('StageManager', manager, isDefined());
|
|
@@ -70,11 +52,15 @@ export class Stage {
|
|
|
70
52
|
ensure('Clock', clock, isDefined());
|
|
71
53
|
ensure('interactionTimeout', interactionTimeout, isDefined());
|
|
72
54
|
ensure('sceneIdFactory', sceneIdFactory, isDefined());
|
|
55
|
+
this.actorLifecycleManager = actorLifecycleManager ?? new ActorLifecycleManager(cast, this.clock, interactionTimeout);
|
|
56
|
+
this.actorLifecycleManager.assignTo(this);
|
|
73
57
|
}
|
|
74
58
|
configure(options) {
|
|
75
|
-
|
|
59
|
+
if (options.interactionTimeout) {
|
|
60
|
+
this.actorLifecycleManager.configure({ interactionTimeout: options.interactionTimeout });
|
|
61
|
+
}
|
|
76
62
|
if (options.actors) {
|
|
77
|
-
this.engage(options.actors);
|
|
63
|
+
this.actorLifecycleManager.engage(options.actors);
|
|
78
64
|
}
|
|
79
65
|
if (options.cueTimeout) {
|
|
80
66
|
this.manager.configure({ cueTimeout: options.cueTimeout });
|
|
@@ -99,34 +85,7 @@ export class Stage {
|
|
|
99
85
|
* Case-sensitive name of the Actor, e.g. `Alice`
|
|
100
86
|
*/
|
|
101
87
|
actor(name) {
|
|
102
|
-
|
|
103
|
-
let actor;
|
|
104
|
-
try {
|
|
105
|
-
const newActor = new Actor(name, this, [
|
|
106
|
-
new RaiseErrors(this),
|
|
107
|
-
new ScheduleWork(this.clock, this.interactionTimeout)
|
|
108
|
-
]);
|
|
109
|
-
actor = this.cast.prepare(newActor);
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
throw new ConfigurationError(`${this.typeOf(this.cast)} encountered a problem when preparing actor "${name}" for stage`, error);
|
|
113
|
-
}
|
|
114
|
-
if (!(actor instanceof Actor)) {
|
|
115
|
-
throw new ConfigurationError(`Instead of a new instance of actor "${name}", ${this.typeOf(this.cast)} returned ${actor}`);
|
|
116
|
-
}
|
|
117
|
-
this.actorsOnStage.set(name, actor);
|
|
118
|
-
this.announce(new ActorEntersStage(this.currentScene, actor.toJSON()));
|
|
119
|
-
}
|
|
120
|
-
const previousActorInSpotlight = this.actorInTheSpotlight;
|
|
121
|
-
const previousSceneOfSpotlightedActor = this.sceneOfSpotlightedActor;
|
|
122
|
-
this.actorInTheSpotlight = this.instantiatedActorCalled(name);
|
|
123
|
-
this.sceneOfSpotlightedActor = this.currentScene;
|
|
124
|
-
const spotlightShifted = this.actorInTheSpotlight !== previousActorInSpotlight
|
|
125
|
-
|| !this.currentScene.equals(previousSceneOfSpotlightedActor);
|
|
126
|
-
if (spotlightShifted) {
|
|
127
|
-
this.announce(new ActorSpotlighted(this.currentScene, this.actorInTheSpotlight.toJSON()));
|
|
128
|
-
}
|
|
129
|
-
return this.actorInTheSpotlight;
|
|
88
|
+
return this.actorLifecycleManager.actor(name);
|
|
130
89
|
}
|
|
131
90
|
/**
|
|
132
91
|
* Returns the last [`Actor`](https://serenity-js.org/api/core/class/Actor/) instantiated via [`Stage.actor`](https://serenity-js.org/api/core/class/Stage/#actor).
|
|
@@ -136,16 +95,13 @@ export class Stage {
|
|
|
136
95
|
* If no [`Actor`](https://serenity-js.org/api/core/class/Actor/) has been activated yet
|
|
137
96
|
*/
|
|
138
97
|
theActorInTheSpotlight() {
|
|
139
|
-
|
|
140
|
-
throw new LogicError(`There is no actor in the spotlight yet. Make sure you instantiate one with stage.actor(actorName) before calling this method.`);
|
|
141
|
-
}
|
|
142
|
-
return this.actorInTheSpotlight;
|
|
98
|
+
return this.actorLifecycleManager.actorInTheSpotlight();
|
|
143
99
|
}
|
|
144
100
|
/**
|
|
145
101
|
* Returns `true` if there is an [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the spotlight, `false` otherwise.
|
|
146
102
|
*/
|
|
147
103
|
theShowHasStarted() {
|
|
148
|
-
return
|
|
104
|
+
return this.actorLifecycleManager.hasActorInTheSpotlight();
|
|
149
105
|
}
|
|
150
106
|
/**
|
|
151
107
|
* Configures the Stage to prepare [actors](https://serenity-js.org/api/core/class/Actor/)
|
|
@@ -154,11 +110,11 @@ export class Stage {
|
|
|
154
110
|
* @param actors
|
|
155
111
|
*/
|
|
156
112
|
engage(actors) {
|
|
157
|
-
this.
|
|
113
|
+
this.actorLifecycleManager.engage(actors);
|
|
158
114
|
}
|
|
159
115
|
/**
|
|
160
116
|
* Assigns listeners to be notified of [Serenity/JS domain events](https://serenity-js.org/api/core-events/class/DomainEvent/)
|
|
161
|
-
* emitted via [`Stage.announce`](https://serenity-js.org/api/core/class/Stage/#announce).
|
|
117
|
+
* emitted via [`Stage.announce`](https://serenity-js.org/api/core/class/Stage/#announce).
|
|
162
118
|
*
|
|
163
119
|
* @param listeners
|
|
164
120
|
*/
|
|
@@ -178,26 +134,52 @@ export class Stage {
|
|
|
178
134
|
}
|
|
179
135
|
announceSingle(event) {
|
|
180
136
|
if (event instanceof SceneStarts) {
|
|
181
|
-
this.
|
|
137
|
+
this.actorLifecycleManager.switchFocus('foreground');
|
|
182
138
|
}
|
|
183
139
|
if (event instanceof SceneFinishes || event instanceof TestRunFinishes) {
|
|
184
|
-
this.notifyOfStageExit(this.
|
|
140
|
+
this.notifyOfStageExit(this.actorLifecycleManager.currentFocus());
|
|
185
141
|
}
|
|
186
142
|
this.manager.notifyOf(event);
|
|
187
143
|
if (event instanceof SceneFinishes) {
|
|
188
|
-
this.
|
|
189
|
-
this.
|
|
144
|
+
this.dismissActorsIn('foreground');
|
|
145
|
+
this.actorLifecycleManager.switchFocus('background');
|
|
190
146
|
}
|
|
191
147
|
if (event instanceof TestRunFinishes) {
|
|
192
|
-
this.
|
|
148
|
+
this.dismissActorsIn('background');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
notifyOfStageExit(focus) {
|
|
152
|
+
for (const actor of this.actorLifecycleManager.actorsIn(focus)) {
|
|
153
|
+
this.announce(new ActorStageExitStarts(this.currentSceneId(), actor.toJSON(), this.currentTime()));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async dismissActorsIn(focus) {
|
|
157
|
+
const actors = this.actorLifecycleManager.actorsIn(focus);
|
|
158
|
+
this.actorLifecycleManager.clearSpotlightIfIn(focus);
|
|
159
|
+
// Wait for the Photographer to finish taking any screenshots
|
|
160
|
+
await this.manager.waitForAsyncOperationsToComplete();
|
|
161
|
+
const actorsToDismiss = new Map(actors.map(actor => [actor, CorrelationId.create()]));
|
|
162
|
+
for (const [actor, correlationId] of actorsToDismiss) {
|
|
163
|
+
this.announce(new ActorStageExitAttempted(correlationId, new Name(actor.name), this.currentTime()));
|
|
164
|
+
}
|
|
165
|
+
// Try to dismiss each actor
|
|
166
|
+
for (const [actor, correlationId] of actorsToDismiss) {
|
|
167
|
+
try {
|
|
168
|
+
await actor.dismiss();
|
|
169
|
+
this.announce(new ActorStageExitCompleted(correlationId, new Name(actor.name), this.currentTime()));
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
this.announce(new ActorStageExitFailed(error, correlationId, this.currentTime()));
|
|
173
|
+
}
|
|
193
174
|
}
|
|
175
|
+
this.actorLifecycleManager.clearActorsIn(focus);
|
|
194
176
|
}
|
|
195
177
|
/**
|
|
196
178
|
* Returns current time. This method should be used whenever
|
|
197
179
|
* [`DomainEvent`](https://serenity-js.org/api/core-events/class/DomainEvent/) objects are instantiated by you programmatically.
|
|
198
180
|
*/
|
|
199
181
|
currentTime() {
|
|
200
|
-
return this.
|
|
182
|
+
return this.clock.now();
|
|
201
183
|
}
|
|
202
184
|
/**
|
|
203
185
|
* Generates and remembers a `CorrelationId`
|
|
@@ -268,43 +250,5 @@ export class Stage {
|
|
|
268
250
|
...options,
|
|
269
251
|
});
|
|
270
252
|
}
|
|
271
|
-
instantiatedActorCalled(name) {
|
|
272
|
-
return this.actorsOnBackstage.has(name)
|
|
273
|
-
? this.actorsOnBackstage.get(name)
|
|
274
|
-
: this.actorsOnFrontStage.get(name);
|
|
275
|
-
}
|
|
276
|
-
notifyOfStageExit(sceneId) {
|
|
277
|
-
for (const actor of this.actorsOnStage.values()) {
|
|
278
|
-
this.announce(new ActorStageExitStarts(sceneId, actor.toJSON(), this.currentTime()));
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
async dismiss(activeActors) {
|
|
282
|
-
const actors = Array.from(activeActors.values());
|
|
283
|
-
if (actors.includes(this.actorInTheSpotlight)) {
|
|
284
|
-
this.actorInTheSpotlight = undefined;
|
|
285
|
-
}
|
|
286
|
-
// Wait for the Photographer to finish taking any screenshots
|
|
287
|
-
await this.manager.waitForAsyncOperationsToComplete();
|
|
288
|
-
const actorsToDismiss = new Map(actors.map(actor => [actor, CorrelationId.create()]));
|
|
289
|
-
for (const [actor, correlationId] of actorsToDismiss) {
|
|
290
|
-
this.announce(new ActorStageExitAttempted(correlationId, new Name(actor.name), this.currentTime()));
|
|
291
|
-
}
|
|
292
|
-
// Try to dismiss each actor
|
|
293
|
-
for (const [actor, correlationId] of actorsToDismiss) {
|
|
294
|
-
try {
|
|
295
|
-
await actor.dismiss();
|
|
296
|
-
this.announce(new ActorStageExitCompleted(correlationId, new Name(actor.name), this.currentTime()));
|
|
297
|
-
}
|
|
298
|
-
catch (error) {
|
|
299
|
-
this.announce(new ActorStageExitFailed(error, correlationId, this.currentTime()));
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
activeActors.clear();
|
|
303
|
-
}
|
|
304
|
-
typeOf(cast) {
|
|
305
|
-
return cast.constructor === Object
|
|
306
|
-
? 'Cast'
|
|
307
|
-
: cast.constructor.name;
|
|
308
|
-
}
|
|
309
253
|
}
|
|
310
254
|
//# sourceMappingURL=Stage.js.map
|
package/esm/stage/Stage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stage.js","sourceRoot":"","sources":["../../src/stage/Stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Stage.js","sourceRoot":"","sources":["../../src/stage/Stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACH,YAAY,EAEZ,UAAU,EAEb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EAGpB,aAAa,EACb,WAAW,EACX,eAAe,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwB,aAAa,EAA6B,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzG,OAAO,EAAE,qBAAqB,EAAmB,MAAM,4BAA4B,CAAC;AAKpF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,KAAK;IAyBO;IACT;IACS;IAEA;IA3Bd,MAAM,CAAU,cAAc,GAAG,IAAI,aAAa,CAAC,SAAS,CAAC,CAAA;IAE5D,eAAe,GAAoD,SAAS,CAAC;IAE7E,YAAY,GAAkB,KAAK,CAAC,cAAc,CAAC;IAE1C,qBAAqB,CAAuB;IAE7D;;;;;;;;;;;;OAYG;IACH,YACI,IAAU,EACO,OAAqB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AC;IACnC,CAAC;IAED;;;;;OAKG;IACH,iBAAiB;QACb,IAAI,CAAE,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,MAAM,IAAI,UAAU,CAAC,qGAAqG,CAAC,CAAC;QAChI,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;IACnC,CAAC;IAED;;;;;;;OAOG;IACH,cAAc;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;IACzC,CAAC;IAED,WAAW,CAA0B,SAAqC,EAAE,OAAqB;QAC7F,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;YACjC,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,QAAQ;YAChD,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { DomainEvent } from '../events/index.js';
|
|
2
|
-
import type { Clock, Duration
|
|
2
|
+
import type { Clock, Duration } from '../screenplay/index.js';
|
|
3
3
|
import type { ListensToDomainEvents } from '../stage/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* @group Stage
|
|
6
6
|
*/
|
|
7
|
-
export declare class StageManager
|
|
7
|
+
export declare class StageManager {
|
|
8
8
|
private cueTimeout;
|
|
9
|
-
private readonly clock;
|
|
10
9
|
private readonly subscribers;
|
|
11
10
|
private readonly wip;
|
|
12
11
|
constructor(cueTimeout: Duration, clock: Clock);
|
|
@@ -18,6 +17,5 @@ export declare class StageManager implements TellsTime {
|
|
|
18
17
|
notifyOf(event: DomainEvent): void;
|
|
19
18
|
waitForAsyncOperationsToComplete(): Promise<void>;
|
|
20
19
|
waitForNextCue(): Promise<void>;
|
|
21
|
-
currentTime(): Timestamp;
|
|
22
20
|
}
|
|
23
21
|
//# sourceMappingURL=StageManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageManager.d.ts","sourceRoot":"","sources":["../../src/stage/StageManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"StageManager.d.ts","sourceRoot":"","sources":["../../src/stage/StageManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAa,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;GAEG;AACH,qBAAa,YAAY;IAIT,OAAO,CAAC,UAAU;IAH9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAC3D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBAEN,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK;IAItD,SAAS,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,QAAQ,CAAA;KAAE,GAAG,IAAI;IAKlD,QAAQ,CAAC,GAAG,WAAW,EAAE,qBAAqB,EAAE,GAAG,IAAI;IAIvD,UAAU,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI;IAInD,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAMlC,gCAAgC,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB3C,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAgBxC"}
|
|
@@ -4,12 +4,10 @@ import { AsyncOperationAttempted, AsyncOperationCompleted, AsyncOperationFailed
|
|
|
4
4
|
*/
|
|
5
5
|
export class StageManager {
|
|
6
6
|
cueTimeout;
|
|
7
|
-
clock;
|
|
8
7
|
subscribers = [];
|
|
9
8
|
wip;
|
|
10
9
|
constructor(cueTimeout, clock) {
|
|
11
10
|
this.cueTimeout = cueTimeout;
|
|
12
|
-
this.clock = clock;
|
|
13
11
|
this.wip = new WIP(cueTimeout, clock);
|
|
14
12
|
}
|
|
15
13
|
configure(options) {
|
|
@@ -52,9 +50,6 @@ export class StageManager {
|
|
|
52
50
|
throw new Error(this.wip.descriptionOfTimedOutOperations());
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
|
-
currentTime() {
|
|
56
|
-
return this.clock.now();
|
|
57
|
-
}
|
|
58
53
|
}
|
|
59
54
|
/**
|
|
60
55
|
* @package
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageManager.js","sourceRoot":"","sources":["../../src/stage/StageManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAK5G;;GAEG;AACH,MAAM,OAAO,YAAY;IAID;
|
|
1
|
+
{"version":3,"file":"StageManager.js","sourceRoot":"","sources":["../../src/stage/StageManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAK5G;;GAEG;AACH,MAAM,OAAO,YAAY;IAID;IAHH,WAAW,GAA4B,EAAE,CAAC;IAC1C,GAAG,CAAM;IAE1B,YAAoB,UAAoB,EAAE,KAAY;QAAlC,eAAU,GAAV,UAAU,CAAU;QACpC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,SAAS,CAAC,OAAiC;QACvC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,QAAQ,CAAC,GAAG,WAAoC;QAC5C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,UAAiC;QACxC,IAAI,CAAC,WAAW,CAAC,MAAM,CA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AAO,CAAC;IACnB,CAAC;IAED,qBAAqB;QACjB,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,CAAC;IAEO,gBAAgB;QACpB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,CAAC;IAEO,MAAM,CAAC,gBAAwB;QACnC,OAAO,gBAAgB,KAAK,CAAC;YACzB,CAAC,CAAC,0CAA0C;YAC5C,CAAC,CAAC,GAAI,gBAAiB,2CAA2C,CAAC;IAC3E,CAAC;IAEO,GAAG,CAAC,aAA4B,EAAE,OAA8B;QACpE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAEO,GAAG,CAAC,aAA4B;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;IACzD,CAAC;IAEO,MAAM,CAAC,aAA4B;QACvC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;IACpD,CAAC;IAEO,WAAW,CAAC,GAAkB;QAClC,KAAK,MAAM,CAAE,CAAC,EAAE,EAAE,CAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;YACzC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChB,OAAO,CAAC,CAAC;YACb,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ"}
|
package/esm/stage/index.d.ts
CHANGED
package/esm/stage/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stage/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stage/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mBAAmB,CAAC"}
|
package/esm/stage/index.js
CHANGED
package/esm/stage/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stage/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stage/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mBAAmB,CAAC"}
|
package/lib/Serenity.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type ActivityDetails, CorrelationId, type CorrelationIdFactory } from '
|
|
|
6
6
|
import type { Actor, Timestamp } from './screenplay/index.js';
|
|
7
7
|
import { Clock } from './screenplay/index.js';
|
|
8
8
|
import type { Cast } from './stage/Cast.js';
|
|
9
|
+
import type { ActorLifecycleManager } from './stage/index.js';
|
|
9
10
|
/**
|
|
10
11
|
* @group Serenity
|
|
11
12
|
*/
|
|
@@ -22,8 +23,9 @@ export declare class Serenity implements EmitsDomainEvents {
|
|
|
22
23
|
* @param clock
|
|
23
24
|
* @param cwd
|
|
24
25
|
* @param sceneIdFactory
|
|
26
|
+
* @param actorLifecycleManager - Optional custom ActorLifecycleManager instance
|
|
25
27
|
*/
|
|
26
|
-
constructor(clock?: Clock, cwd?: string, sceneIdFactory?: CorrelationIdFactory);
|
|
28
|
+
constructor(clock?: Clock, cwd?: string, sceneIdFactory?: CorrelationIdFactory, actorLifecycleManager?: ActorLifecycleManager);
|
|
27
29
|
/**
|
|
28
30
|
* Configures Serenity/JS. Every call to this function
|
|
29
31
|
* replaces the previous configuration provided,
|
package/lib/Serenity.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Serenity.d.ts","sourceRoot":"","sources":["../src/Serenity.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAyE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,K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CAAC,WAAW,CAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAO;IAExC;;;;;OAKG;gBAEC,KAAK,GAAE,KAAmB,EAC1B,GAAG,GAAE,MAAsB,EAC3B,cAAc,GAAE,oBAAoC,EACpD,qBAAqB,CAAC,EAAE,qBAAqB;IAsBjD;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAmDvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkEG;IACH,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyDG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAInC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,sBAAsB,IAAI,KAAK;IAI/B,QAAQ,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,IAAI;IAI7C,WAAW,IAAI,SAAS;IAIxB,gBAAgB,IAAI,aAAa;IAIjC,cAAc,IAAI,aAAa;IAI/B,mBAAmB,CAAC,eAAe,EAAE,eAAe,GAAG,aAAa;IAIpE,WAAW,CAAC,EAAE,SAAS,YAAY,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,EAAE;IAItG;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,GAAG,IAAI,IAAI;CAGd"}
|
package/lib/Serenity.js
CHANGED
|
@@ -7,8 +7,8 @@ const index_js_2 = require("./io/index.js");
|
|
|
7
7
|
const index_js_3 = require("./model/index.js");
|
|
8
8
|
const index_js_4 = require("./screenplay/index.js");
|
|
9
9
|
const Extras_js_1 = require("./stage/Extras.js");
|
|
10
|
+
const index_js_5 = require("./stage/index.js");
|
|
10
11
|
const Stage_js_1 = require("./stage/Stage.js");
|
|
11
|
-
const StageManager_js_1 = require("./stage/StageManager.js");
|
|
12
12
|
/**
|
|
13
13
|
* @group Serenity
|
|
14
14
|
*/
|
|
@@ -25,9 +25,10 @@ class Serenity {
|
|
|
25
25
|
* @param clock
|
|
26
26
|
* @param cwd
|
|
27
27
|
* @param sceneIdFactory
|
|
28
|
+
* @param actorLifecycleManager - Optional custom ActorLifecycleManager instance
|
|
28
29
|
*/
|
|
29
|
-
constructor(clock = new index_js_4.Clock(), cwd = process.cwd(), sceneIdFactory = index_js_3.CorrelationId) {
|
|
30
|
-
this.stage = new Stage_js_1.Stage(Serenity.defaultActors, new
|
|
30
|
+
constructor(clock = new index_js_4.Clock(), cwd = process.cwd(), sceneIdFactory = index_js_3.CorrelationId, actorLifecycleManager) {
|
|
31
|
+
this.stage = new Stage_js_1.Stage(Serenity.defaultActors, new index_js_5.StageManager(Serenity.defaultCueTimeout, clock), new index_js_1.ErrorFactory(), clock, Serenity.defaultInteractionTimeout, sceneIdFactory, actorLifecycleManager);
|
|
31
32
|
this.classLoader = new index_js_2.ClassLoader(new index_js_2.ModuleLoader(cwd), new index_js_2.ClassDescriptionParser());
|
|
32
33
|
this.workingDirectory = new index_js_2.Path(cwd);
|
|
33
34
|
this.fileSystem = new index_js_2.FileSystem(this.workingDirectory);
|
package/lib/Serenity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Serenity.js","sourceRoot":"","sources":["../src/Serenity.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAKlD,gDAAwF;AAExF,4CAA4G;AAC5G,+CAAkG;AAElG,oDAAwD;AAExD,iDAA2C;AAE3C,+CAAyC;
|
|
1
|
+
{"version":3,"file":"Serenity.js","sourceRoot":"","sources":["../src/Serenity.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAKlD,gDAAwF;AAExF,4CAA4G;AAC5G,+CAAk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AAC;IACzC,CAAC;IAED,cAAc;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;IACvC,CAAC;IAED,mBAAmB,CAAC,eAAgC;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW,CAA0B,SAAqC,EAAE,OAAqB;QAC7F,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,cAAc;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;IACvC,CAAC;IAED,GAAG;QACC,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;;AAlTL,4BAmTC"}
|
|
@@ -35,7 +35,7 @@ export declare abstract class SerenityConfig {
|
|
|
35
35
|
* The maximum amount of time between [SceneFinishes](https://serenity-js.org/api/core-events/class/SceneFinishes/) and [SceneFinished](https://serenity-js.org/api/core-events/class/SceneFinished/) events
|
|
36
36
|
* that Serenity/JS should wait for any post-scenario
|
|
37
37
|
* async operations to complete. Those include generating the screenshots,
|
|
38
|
-
* saving reports to disk, [dismissing the actors](https://serenity-js.org/api/core/
|
|
38
|
+
* saving reports to disk, [dismissing the actors](https://serenity-js.org/api/core/class/Discardable/), and so on.
|
|
39
39
|
*
|
|
40
40
|
* Defaults to 5 seconds.
|
|
41
41
|
*
|
|
@@ -33,7 +33,7 @@ class SerenityConfig {
|
|
|
33
33
|
* The maximum amount of time between [SceneFinishes](https://serenity-js.org/api/core-events/class/SceneFinishes/) and [SceneFinished](https://serenity-js.org/api/core-events/class/SceneFinished/) events
|
|
34
34
|
* that Serenity/JS should wait for any post-scenario
|
|
35
35
|
* async operations to complete. Those include generating the screenshots,
|
|
36
|
-
* saving reports to disk, [dismissing the actors](https://serenity-js.org/api/core/
|
|
36
|
+
* saving reports to disk, [dismissing the actors](https://serenity-js.org/api/core/class/Discardable/), and so on.
|
|
37
37
|
*
|
|
38
38
|
* Defaults to 5 seconds.
|
|
39
39
|
*
|
|
@@ -5,7 +5,7 @@ import { DomainEvent } from './DomainEvent.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Emitted by a Serenity/JS test runner adapter, right before a test and all its associated test hooks finish.
|
|
7
7
|
* Triggers any clean-up operations that might be required, such as discarding of
|
|
8
|
-
* the [discardable](https://serenity-js.org/api/core/
|
|
8
|
+
* the [discardable](https://serenity-js.org/api/core/class/Discardable/) abilities.
|
|
9
9
|
*
|
|
10
10
|
* The `outcome` property contains the test outcome determined so far, before any cleanup operations.
|
|
11
11
|
* This allows stage crew members like the WebdriverIO notifier to invoke hooks with the test result
|
|
@@ -8,7 +8,7 @@ const DomainEvent_js_1 = require("./DomainEvent.js");
|
|
|
8
8
|
/**
|
|
9
9
|
* Emitted by a Serenity/JS test runner adapter, right before a test and all its associated test hooks finish.
|
|
10
10
|
* Triggers any clean-up operations that might be required, such as discarding of
|
|
11
|
-
* the [discardable](https://serenity-js.org/api/core/
|
|
11
|
+
* the [discardable](https://serenity-js.org/api/core/class/Discardable/) abilities.
|
|
12
12
|
*
|
|
13
13
|
* The `outcome` property contains the test outcome determined so far, before any cleanup operations.
|
|
14
14
|
* This allows stage crew members like the WebdriverIO notifier to invoke hooks with the test result
|
|
@@ -4,7 +4,7 @@ import { Timestamp } from '../../screenplay/index.js';
|
|
|
4
4
|
import { AsyncOperationCompleted } from '../AsyncOperationCompleted.js';
|
|
5
5
|
/**
|
|
6
6
|
* Emitted when an [`Actor`](https://serenity-js.org/api/core/class/Actor/) and its abilities
|
|
7
|
-
* are correctly [released](https://serenity-js.org/api/core/
|
|
7
|
+
* are correctly [released](https://serenity-js.org/api/core/class/Discardable/) either
|
|
8
8
|
* upon the [`SceneFinishes`](https://serenity-js.org/api/core-events/class/SceneFinishes/) event
|
|
9
9
|
* for actors initialised within the scope of a test scenario,
|
|
10
10
|
* or upon the [`TestRunFinishes`](https://serenity-js.org/api/core-events/class/TestRunFinishes/) event
|
|
@@ -7,7 +7,7 @@ const index_js_2 = require("../../screenplay/index.js");
|
|
|
7
7
|
const AsyncOperationCompleted_js_1 = require("../AsyncOperationCompleted.js");
|
|
8
8
|
/**
|
|
9
9
|
* Emitted when an [`Actor`](https://serenity-js.org/api/core/class/Actor/) and its abilities
|
|
10
|
-
* are correctly [released](https://serenity-js.org/api/core/
|
|
10
|
+
* are correctly [released](https://serenity-js.org/api/core/class/Discardable/) either
|
|
11
11
|
* upon the [`SceneFinishes`](https://serenity-js.org/api/core-events/class/SceneFinishes/) event
|
|
12
12
|
* for actors initialised within the scope of a test scenario,
|
|
13
13
|
* or upon the [`TestRunFinishes`](https://serenity-js.org/api/core-events/class/TestRunFinishes/) event
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSONObject } from 'tiny-types';
|
|
2
2
|
import { AsyncOperationFailed } from '../AsyncOperationFailed.js';
|
|
3
3
|
/**
|
|
4
|
-
* Emitted when [releasing](https://serenity-js.org/api/core/
|
|
4
|
+
* Emitted when [releasing](https://serenity-js.org/api/core/class/Discardable/) an
|
|
5
5
|
* [`Actor`](https://serenity-js.org/api/core/class/Actor/) or its abilities
|
|
6
6
|
* resulted in an error either
|
|
7
7
|
* upon the [`SceneFinishes`](https://serenity-js.org/api/core-events/class/SceneFinishes/) event
|
|
@@ -6,7 +6,7 @@ const index_js_2 = require("../../model/index.js");
|
|
|
6
6
|
const index_js_3 = require("../../screenplay/index.js");
|
|
7
7
|
const AsyncOperationFailed_js_1 = require("../AsyncOperationFailed.js");
|
|
8
8
|
/**
|
|
9
|
-
* Emitted when [releasing](https://serenity-js.org/api/core/
|
|
9
|
+
* Emitted when [releasing](https://serenity-js.org/api/core/class/Discardable/) an
|
|
10
10
|
* [`Actor`](https://serenity-js.org/api/core/class/Actor/) or its abilities
|
|
11
11
|
* resulted in an error either
|
|
12
12
|
* upon the [`SceneFinishes`](https://serenity-js.org/api/core-events/class/SceneFinishes/) event
|
|
@@ -7,7 +7,7 @@ import { DomainEvent } from '../DomainEvent.js';
|
|
|
7
7
|
* [`TestRunFinishes`](https://serenity-js.org/api/core-events/class/TestRunFinishes/) events
|
|
8
8
|
* to notify the [stage crew members](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
9
9
|
* about the final state of the [actors](https://serenity-js.org/api/core/class/Actor/) and their abilities
|
|
10
|
-
* before they're [released](https://serenity-js.org/api/core/
|
|
10
|
+
* before they're [released](https://serenity-js.org/api/core/class/Discardable/).
|
|
11
11
|
*
|
|
12
12
|
* @group Events
|
|
13
13
|
*/
|
|
@@ -10,7 +10,7 @@ const DomainEvent_js_1 = require("../DomainEvent.js");
|
|
|
10
10
|
* [`TestRunFinishes`](https://serenity-js.org/api/core-events/class/TestRunFinishes/) events
|
|
11
11
|
* to notify the [stage crew members](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
12
12
|
* about the final state of the [actors](https://serenity-js.org/api/core/class/Actor/) and their abilities
|
|
13
|
-
* before they're [released](https://serenity-js.org/api/core/
|
|
13
|
+
* before they're [released](https://serenity-js.org/api/core/class/Discardable/).
|
|
14
14
|
*
|
|
15
15
|
* @group Events
|
|
16
16
|
*/
|
|
@@ -130,8 +130,8 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
130
130
|
*/
|
|
131
131
|
currentTime(): Timestamp;
|
|
132
132
|
/**
|
|
133
|
-
* Instructs the actor to invoke [`Discardable.discard`](https://serenity-js.org/api/core/
|
|
134
|
-
* [discardable](https://serenity-js.org/api/core/
|
|
133
|
+
* Instructs the actor to invoke [`Discardable.discard`](https://serenity-js.org/api/core/class/Discardable/#discard) method on any
|
|
134
|
+
* [discardable](https://serenity-js.org/api/core/class/Discardable/) [ability](https://serenity-js.org/api/core/class/Ability/) it's been configured with.
|
|
135
135
|
*/
|
|
136
136
|
dismiss(): Promise<void>;
|
|
137
137
|
/**
|
|
@@ -148,7 +148,7 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
148
148
|
*/
|
|
149
149
|
toJSON(): SerialisedActor;
|
|
150
150
|
private initialiseAbilities;
|
|
151
|
-
private
|
|
151
|
+
private findAbilitiesWhere;
|
|
152
152
|
private findAbilityTo;
|
|
153
153
|
private acquireAbility;
|
|
154
154
|
/**
|