@serenity-js/core 3.2.0 → 3.3.0
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 +24 -0
- package/lib/Serenity.d.ts +2 -2
- package/lib/Serenity.d.ts.map +1 -1
- package/lib/events/EmitsDomainEvents.d.ts +11 -0
- package/lib/events/EmitsDomainEvents.d.ts.map +1 -0
- package/lib/events/EmitsDomainEvents.js +3 -0
- package/lib/events/EmitsDomainEvents.js.map +1 -0
- package/lib/events/index.d.ts +1 -0
- package/lib/events/index.d.ts.map +1 -1
- package/lib/events/index.js +1 -0
- package/lib/events/index.js.map +1 -1
- package/lib/io/asyncMap.js +2 -2
- package/lib/io/asyncMap.js.map +1 -1
- package/lib/screenplay/Actor.d.ts +3 -3
- package/lib/screenplay/Actor.d.ts.map +1 -1
- package/lib/screenplay/Actor.js +14 -86
- package/lib/screenplay/Actor.js.map +1 -1
- package/lib/screenplay/abilities/AnswerQuestions.d.ts +21 -0
- package/lib/screenplay/abilities/AnswerQuestions.d.ts.map +1 -0
- package/lib/screenplay/abilities/AnswerQuestions.js +37 -0
- package/lib/screenplay/abilities/AnswerQuestions.js.map +1 -0
- package/lib/screenplay/abilities/PerformActivities.d.ts +28 -0
- package/lib/screenplay/abilities/PerformActivities.d.ts.map +1 -0
- package/lib/screenplay/abilities/PerformActivities.js +66 -0
- package/lib/screenplay/abilities/PerformActivities.js.map +1 -0
- package/lib/screenplay/abilities/index.d.ts +2 -0
- package/lib/screenplay/abilities/index.d.ts.map +1 -1
- package/lib/screenplay/abilities/index.js +2 -0
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/time/abilities/ScheduleWork.d.ts +2 -4
- package/lib/screenplay/time/abilities/ScheduleWork.d.ts.map +1 -1
- package/lib/screenplay/time/abilities/ScheduleWork.js +0 -6
- package/lib/screenplay/time/abilities/ScheduleWork.js.map +1 -1
- package/lib/screenplay/time/models/Clock.d.ts +24 -0
- package/lib/screenplay/time/models/Clock.d.ts.map +1 -1
- package/lib/screenplay/time/models/Clock.js +41 -1
- package/lib/screenplay/time/models/Clock.js.map +1 -1
- package/lib/screenplay/time/models/Scheduler.d.ts +1 -10
- package/lib/screenplay/time/models/Scheduler.d.ts.map +1 -1
- package/lib/screenplay/time/models/Scheduler.js +65 -103
- package/lib/screenplay/time/models/Scheduler.js.map +1 -1
- package/lib/stage/Stage.d.ts +2 -2
- package/lib/stage/Stage.d.ts.map +1 -1
- package/lib/stage/Stage.js +4 -2
- package/lib/stage/Stage.js.map +1 -1
- package/package.json +6 -6
- package/src/Serenity.ts +2 -2
- package/src/events/EmitsDomainEvents.ts +11 -0
- package/src/events/index.ts +1 -0
- package/src/io/asyncMap.ts +2 -2
- package/src/screenplay/Actor.ts +32 -131
- package/src/screenplay/abilities/AnswerQuestions.ts +41 -0
- package/src/screenplay/abilities/PerformActivities.ts +88 -0
- package/src/screenplay/abilities/index.ts +2 -0
- package/src/screenplay/time/abilities/ScheduleWork.ts +2 -10
- package/src/screenplay/time/models/Clock.ts +47 -1
- package/src/screenplay/time/models/Scheduler.ts +89 -136
- package/src/stage/Stage.ts +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.3.0](https://github.com/serenity-js/serenity-js/compare/v3.2.1...v3.3.0) (2023-06-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **core:** ability to ScheduleWork preserves stack traces for better reporting ([c2ce5f7](https://github.com/serenity-js/serenity-js/commit/c2ce5f768732de5b01113c0f2dfa8e98d3e73667)), closes [#1717](https://github.com/serenity-js/serenity-js/issues/1717)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **core:** enabled extending default behaviour of actor.perform and actor.answer APIs ([01bb213](https://github.com/serenity-js/serenity-js/commit/01bb213fa59a03737cd7d0770cd5df737cffcb19)), closes [#1717](https://github.com/serenity-js/serenity-js/issues/1717)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.2.1](https://github.com/serenity-js/serenity-js/compare/v3.2.0...v3.2.1) (2023-05-15)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @serenity-js/core
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [3.2.0](https://github.com/serenity-js/serenity-js/compare/v3.1.6...v3.2.0) (2023-05-05)
|
|
7
31
|
|
|
8
32
|
|
package/lib/Serenity.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SerenityConfig } from './config';
|
|
2
2
|
import { ErrorOptions, RuntimeError } from './errors';
|
|
3
|
-
import { DomainEvent } from './events';
|
|
3
|
+
import { DomainEvent, EmitsDomainEvents } from './events';
|
|
4
4
|
import { Path } from './io';
|
|
5
5
|
import { ActivityDetails, CorrelationId } from './model';
|
|
6
6
|
import { Actor, Clock, Timestamp } from './screenplay';
|
|
@@ -8,7 +8,7 @@ import { Cast } from './stage/Cast';
|
|
|
8
8
|
/**
|
|
9
9
|
* @group Serenity
|
|
10
10
|
*/
|
|
11
|
-
export declare class Serenity {
|
|
11
|
+
export declare class Serenity implements EmitsDomainEvents {
|
|
12
12
|
private readonly clock;
|
|
13
13
|
private static defaultCueTimeout;
|
|
14
14
|
private static defaultInteractionTimeout;
|
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,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAoC,YAAY,EAAqB,YAAY,EAAE,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActivityDetails, CorrelationId } from '../model';
|
|
2
|
+
import { Timestamp } from '../screenplay';
|
|
3
|
+
import { DomainEvent } from './DomainEvent';
|
|
4
|
+
export interface EmitsDomainEvents {
|
|
5
|
+
currentSceneId(): CorrelationId;
|
|
6
|
+
assignNewActivityId(details: ActivityDetails): CorrelationId;
|
|
7
|
+
announce(event: DomainEvent): void;
|
|
8
|
+
currentTime(): Timestamp;
|
|
9
|
+
waitForNextCue(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=EmitsDomainEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmitsDomainEvents.d.ts","sourceRoot":"","sources":["../../src/events/EmitsDomainEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,iBAAiB;IAC9B,cAAc,IAAI,aAAa,CAAC;IAChC,mBAAmB,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC;IAC7D,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,WAAW,IAAI,SAAS,CAAC;IACzB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmitsDomainEvents.js","sourceRoot":"","sources":["../../src/events/EmitsDomainEvents.ts"],"names":[],"mappings":""}
|
package/lib/events/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './AsyncOperationCompleted';
|
|
|
10
10
|
export * from './AsyncOperationFailed';
|
|
11
11
|
export * from './BusinessRuleDetected';
|
|
12
12
|
export * from './DomainEvent';
|
|
13
|
+
export * from './EmitsDomainEvents';
|
|
13
14
|
export * from './FeatureNarrativeDetected';
|
|
14
15
|
export * from './InteractionFinished';
|
|
15
16
|
export * from './InteractionStarts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;A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gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
package/lib/events/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./AsyncOperationCompleted"), exports);
|
|
|
26
26
|
__exportStar(require("./AsyncOperationFailed"), exports);
|
|
27
27
|
__exportStar(require("./BusinessRuleDetected"), exports);
|
|
28
28
|
__exportStar(require("./DomainEvent"), exports);
|
|
29
|
+
__exportStar(require("./EmitsDomainEvents"), exports);
|
|
29
30
|
__exportStar(require("./FeatureNarrativeDetected"), exports);
|
|
30
31
|
__exportStar(require("./InteractionFinished"), exports);
|
|
31
32
|
__exportStar(require("./InteractionStarts"), exports);
|
package/lib/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,oEAAkD;AAClD,qEAAmD;AACnD,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,4DAA0C;AAC1C,4DAA0C;AAC1C,yDAAuC;AACvC,yDAAuC;AACvC,gDAA8B;AAC9B,6DAA2C;AAC3C,wDAAsC;AACtC,sDAAoC;AACpC,2DAAyC;AACzC,4DAA0C;AAC1C,6DAA2C;AAC3C,kDAAgC;AAChC,kDAAgC;AAChC,4DAA0C;AAC1C,0DAAwC;AACxC,gDAA8B;AAC9B,gDAA8B;AAC9B,0DAAwC;AACxC,iDAA+B;AAC/B,+CAA6B;AAC7B,oDAAkC;AAClC,oDAAkC;AAClC,uDAAqC;AACrC,kDAAgC;AAChC,sDAAoC;AACpC,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,oEAAkD;AAClD,qEAAmD;AACnD,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,0DAAwC;AACxC,4DAA0C;AAC1C,4DAA0C;AAC1C,yDAAuC;AACvC,yDAAuC;AACvC,gDAA8B;AAC9B,sDAAoC;AACpC,6DAA2C;AAC3C,wDAAsC;AACtC,sDAAoC;AACpC,2DAAyC;AACzC,4DAA0C;AAC1C,6DAA2C;AAC3C,kDAAgC;AAChC,kDAAgC;AAChC,4DAA0C;AAC1C,0DAAwC;AACxC,gDAA8B;AAC9B,gDAA8B;AAC9B,0DAAwC;AACxC,iDAA+B;AAC/B,+CAA6B;AAC7B,oDAAkC;AAClC,oDAAkC;AAClC,uDAAqC;AACrC,kDAAgC;AAChC,sDAAoC;AACpC,oDAAkC"}
|
package/lib/io/asyncMap.js
CHANGED
|
@@ -8,11 +8,11 @@ exports.asyncMap = void 0;
|
|
|
8
8
|
* @param mappingFunction
|
|
9
9
|
*/
|
|
10
10
|
function asyncMap(items, mappingFunction) {
|
|
11
|
-
return items.reduce((previous, item) => previous.then(async (acc) => {
|
|
11
|
+
return Promise.resolve().then(() => items.reduce((previous, item) => previous.then(async (acc) => {
|
|
12
12
|
const result = await mappingFunction(item);
|
|
13
13
|
acc.push(result);
|
|
14
14
|
return acc;
|
|
15
|
-
}), Promise.resolve([]));
|
|
15
|
+
}), Promise.resolve([])));
|
|
16
16
|
}
|
|
17
17
|
exports.asyncMap = asyncMap;
|
|
18
18
|
//# sourceMappingURL=asyncMap.js.map
|
package/lib/io/asyncMap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncMap.js","sourceRoot":"","sources":["../../src/io/asyncMap.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,QAAQ,CAAyB,KAAkB,EAAE,eAAwE;IACzI,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"asyncMap.js","sourceRoot":"","sources":["../../src/io/asyncMap.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,QAAQ,CAAyB,KAAkB,EAAE,eAAwE;IACzI,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAC5C,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CACf,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;QAE3C,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEhB,OAAO,GAAG,CAAC;IACf,CAAC,CAAC,EACJ,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACxB,CAAC,CAAC;AACP,CAAC;AAZD,4BAYC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Artifact, Name } from '../model';
|
|
2
|
-
import { Ability, AbilityType, Answerable } from '../screenplay';
|
|
3
2
|
import { Stage } from '../stage';
|
|
4
|
-
import { CanHaveAbilities, UsesAbilities } from './abilities';
|
|
3
|
+
import { Ability, AbilityType, CanHaveAbilities, UsesAbilities } from './abilities';
|
|
5
4
|
import { PerformsActivities } from './activities';
|
|
6
5
|
import { Activity } from './Activity';
|
|
6
|
+
import { Answerable } from './Answerable';
|
|
7
7
|
import { CollectsArtifacts } from './artifacts';
|
|
8
8
|
import { AnswersQuestions } from './questions';
|
|
9
9
|
/**
|
|
@@ -69,7 +69,7 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
69
69
|
readonly name: string;
|
|
70
70
|
private readonly stage;
|
|
71
71
|
private readonly abilities;
|
|
72
|
-
constructor(name: string, stage: Stage, abilities?:
|
|
72
|
+
constructor(name: string, stage: Stage, abilities?: Ability[]);
|
|
73
73
|
/**
|
|
74
74
|
* Retrieves actor's {@apilink Ability} of `abilityType`, or one that extends `abilityType`.
|
|
75
75
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actor.d.ts","sourceRoot":"","sources":["../../src/screenplay/Actor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actor.d.ts","sourceRoot":"","sources":["../../src/screenplay/Actor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAG,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EACH,OAAO,EACP,WAAW,EAEX,gBAAgB,EAIhB,aAAa,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,qBAAa,KAAM,YAAW,kBAAkB,EAC5C,aAAa,EACb,gBAAgB,CAAC,KAAK,CAAC,EACvB,gBAAgB,EAChB,iBAAiB;aAIG,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJ1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgF;gBAGtF,IAAI,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EAC7B,SAAS,GAAE,OAAO,EAAO;IAS7B;;;;;;;;;;OAUG;IACH,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAc5D;;;;;;OAMG;IACH,UAAU,CAAC,GAAG,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpD;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK;IAMtC;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhD;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUvD;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IASxB;;;;OAIG;IACH,QAAQ,IAAI,MAAM;IAMlB,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,iBAAiB;IASzB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CAKnB"}
|
package/lib/screenplay/Actor.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Actor = void 0;
|
|
4
|
-
const tiny_types_1 = require("tiny-types");
|
|
5
4
|
const errors_1 = require("../errors");
|
|
6
5
|
const events_1 = require("../events");
|
|
7
6
|
const io_1 = require("../io");
|
|
8
7
|
const model_1 = require("../model");
|
|
9
|
-
const
|
|
10
|
-
const Activity_1 = require("./Activity");
|
|
11
|
-
const Question_1 = require("./Question");
|
|
8
|
+
const abilities_1 = require("./abilities");
|
|
12
9
|
/**
|
|
13
10
|
* **Actors** represent **people** and **external systems** interacting with the system under test.
|
|
14
11
|
* Their role is to perform {@apilink Activity|activities} that demonstrate how to accomplish a given goal.
|
|
@@ -69,10 +66,15 @@ const Question_1 = require("./Question");
|
|
|
69
66
|
* @group Screenplay Pattern
|
|
70
67
|
*/
|
|
71
68
|
class Actor {
|
|
72
|
-
constructor(name, stage, abilities =
|
|
69
|
+
constructor(name, stage, abilities = []) {
|
|
73
70
|
this.name = name;
|
|
74
71
|
this.stage = stage;
|
|
75
|
-
this.abilities =
|
|
72
|
+
this.abilities = new Map();
|
|
73
|
+
[
|
|
74
|
+
new abilities_1.PerformActivities(this, stage),
|
|
75
|
+
new abilities_1.AnswerQuestions(this),
|
|
76
|
+
...abilities
|
|
77
|
+
].forEach(ability => this.acquireAbility(ability));
|
|
76
78
|
}
|
|
77
79
|
/**
|
|
78
80
|
* Retrieves actor's {@apilink Ability} of `abilityType`, or one that extends `abilityType`.
|
|
@@ -88,12 +90,8 @@ class Actor {
|
|
|
88
90
|
abilityTo(abilityType) {
|
|
89
91
|
const found = this.findAbilityTo(abilityType);
|
|
90
92
|
if (!found) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
`They can't, however, ${abilityType.name} yet. ` +
|
|
94
|
-
`Did you give them the ability to do so?`);
|
|
95
|
-
}
|
|
96
|
-
throw new errors_1.ConfigurationError(`${this.name} can't ${abilityType.name} yet. ` +
|
|
93
|
+
throw new errors_1.ConfigurationError(`${this.name} can ${Array.from(this.abilities.keys()).map(type => type.name).join(', ')}. ` +
|
|
94
|
+
`They can't, however, ${abilityType.name} yet. ` +
|
|
97
95
|
`Did you give them the ability to do so?`);
|
|
98
96
|
}
|
|
99
97
|
return found;
|
|
@@ -107,15 +105,9 @@ class Actor {
|
|
|
107
105
|
*/
|
|
108
106
|
attemptsTo(...activities) {
|
|
109
107
|
return activities
|
|
110
|
-
.map(activity => new TrackedActivity(activity, this.stage))
|
|
111
108
|
.reduce((previous, current) => {
|
|
112
109
|
return previous
|
|
113
|
-
|
|
114
|
-
.then(() => this.stage.waitForNextCue())
|
|
115
|
-
.then(() => {
|
|
116
|
-
/* todo: add an execution strategy */
|
|
117
|
-
return current.performAs(this);
|
|
118
|
-
});
|
|
110
|
+
.then(() => abilities_1.PerformActivities.as(this).perform(current));
|
|
119
111
|
}, this.initialiseAbilities());
|
|
120
112
|
}
|
|
121
113
|
/**
|
|
@@ -143,19 +135,7 @@ class Actor {
|
|
|
143
135
|
* The answer to the Answerable
|
|
144
136
|
*/
|
|
145
137
|
answer(answerable) {
|
|
146
|
-
|
|
147
|
-
return Object.prototype.hasOwnProperty.call(v, 'then');
|
|
148
|
-
}
|
|
149
|
-
function isDefined(v) {
|
|
150
|
-
return !(v === undefined || v === null);
|
|
151
|
-
}
|
|
152
|
-
if (isDefined(answerable) && isAPromise(answerable)) {
|
|
153
|
-
return answerable;
|
|
154
|
-
}
|
|
155
|
-
if (isDefined(answerable) && Question_1.Question.isAQuestion(answerable)) {
|
|
156
|
-
return this.answer(answerable.answeredBy(this));
|
|
157
|
-
}
|
|
158
|
-
return Promise.resolve(answerable);
|
|
138
|
+
return abilities_1.AnswerQuestions.as(this).answer(answerable);
|
|
159
139
|
}
|
|
160
140
|
/**
|
|
161
141
|
* Announce collection of an {@apilink Artifact} so that it can be picked up by a {@apilink StageCrewMember}.
|
|
@@ -203,7 +183,7 @@ class Actor {
|
|
|
203
183
|
return this.abilities.get(abilityType);
|
|
204
184
|
}
|
|
205
185
|
acquireAbility(ability) {
|
|
206
|
-
if (!(ability instanceof
|
|
186
|
+
if (!(ability instanceof abilities_1.Ability)) {
|
|
207
187
|
throw new errors_1.ConfigurationError(`Custom abilities must extend Ability from '@serenity-js/core'. Received ${(0, io_1.typeOf)(ability)}`);
|
|
208
188
|
}
|
|
209
189
|
const abilityType = this.mostGenericTypeOf(ability.constructor);
|
|
@@ -211,7 +191,7 @@ class Actor {
|
|
|
211
191
|
}
|
|
212
192
|
mostGenericTypeOf(abilityType) {
|
|
213
193
|
const parentType = Object.getPrototypeOf(abilityType);
|
|
214
|
-
return !parentType || parentType ===
|
|
194
|
+
return !parentType || parentType === abilities_1.Ability
|
|
215
195
|
? abilityType
|
|
216
196
|
: this.mostGenericTypeOf(parentType);
|
|
217
197
|
}
|
|
@@ -228,56 +208,4 @@ class Actor {
|
|
|
228
208
|
}
|
|
229
209
|
}
|
|
230
210
|
exports.Actor = Actor;
|
|
231
|
-
class ActivityDescriber {
|
|
232
|
-
describe(activity, actor) {
|
|
233
|
-
const template = activity.toString() === ({}).toString()
|
|
234
|
-
? `#actor performs ${activity.constructor.name}`
|
|
235
|
-
: activity.toString();
|
|
236
|
-
return new model_1.Name(this.includeActorName(template, actor));
|
|
237
|
-
}
|
|
238
|
-
includeActorName(template, actor) {
|
|
239
|
-
return template.replace('#actor', actor.name);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
class OutcomeMatcher {
|
|
243
|
-
outcomeFor(error) {
|
|
244
|
-
return (0, tiny_types_1.match)(error)
|
|
245
|
-
.when(errors_1.ImplementationPendingError, _ => new model_1.ImplementationPending(error))
|
|
246
|
-
.when(errors_1.TestCompromisedError, _ => new model_1.ExecutionCompromised(error))
|
|
247
|
-
.when(errors_1.AssertionError, _ => new model_1.ExecutionFailedWithAssertionError(error))
|
|
248
|
-
.when(Error, _ => /AssertionError/.test(error.constructor.name) // mocha
|
|
249
|
-
? new model_1.ExecutionFailedWithAssertionError(error)
|
|
250
|
-
: new model_1.ExecutionFailedWithError(error))
|
|
251
|
-
.else(_ => new model_1.ExecutionFailedWithError(error));
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
class TrackedActivity extends Activity_1.Activity {
|
|
255
|
-
constructor(activity, stage) {
|
|
256
|
-
super(activity.toString(), activity.instantiationLocation());
|
|
257
|
-
this.activity = activity;
|
|
258
|
-
this.stage = stage;
|
|
259
|
-
}
|
|
260
|
-
performAs(actor) {
|
|
261
|
-
const sceneId = this.stage.currentSceneId();
|
|
262
|
-
const details = new model_1.ActivityDetails(TrackedActivity.describer.describe(this.activity, actor), this.activity.instantiationLocation());
|
|
263
|
-
const activityId = this.stage.assignNewActivityId(details);
|
|
264
|
-
const [activityStarts, activityFinished] = this.activity instanceof screenplay_1.Interaction
|
|
265
|
-
? [events_1.InteractionStarts, events_1.InteractionFinished]
|
|
266
|
-
: [events_1.TaskStarts, events_1.TaskFinished];
|
|
267
|
-
return Promise.resolve()
|
|
268
|
-
.then(() => this.stage.announce(new activityStarts(sceneId, activityId, details, this.stage.currentTime())))
|
|
269
|
-
.then(() => this.activity.performAs(actor))
|
|
270
|
-
.then(() => {
|
|
271
|
-
const outcome = new model_1.ExecutionSuccessful();
|
|
272
|
-
this.stage.announce(new activityFinished(sceneId, activityId, details, outcome, this.stage.currentTime()));
|
|
273
|
-
})
|
|
274
|
-
.catch(error => {
|
|
275
|
-
const outcome = TrackedActivity.outcomes.outcomeFor(error);
|
|
276
|
-
this.stage.announce(new activityFinished(sceneId, activityId, details, outcome, this.stage.currentTime()));
|
|
277
|
-
throw error;
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
TrackedActivity.describer = new ActivityDescriber();
|
|
282
|
-
TrackedActivity.outcomes = new OutcomeMatcher();
|
|
283
211
|
//# sourceMappingURL=Actor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actor.js","sourceRoot":"","sources":["../../src/screenplay/Actor.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Actor.js","sourceRoot":"","sources":["../../src/screenplay/Actor.ts"],"names":[],"mappings":";;;AAAA,sCAAqE;AACrE,sCAA6D;AAC7D,8BAA+B;AAC/B,oCAA2C;AAE3C,2CASqB;AAOrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,MAAa,KAAK;IAOd,YACoB,IAAY,EACX,KAAY,EAC7B,YAAuB,EAAE;QAFT,SAAI,GAAJ,IAAI,CAAQ;QACX,UAAK,GAAL,KAAK,CAAO;QAJhB,cAAS,GAAuC,IAAI,GAAG,EAAiC,CAAC;QAOtG;YACI,IAAI,6BAAiB,CAAC,IAAI,EAAE,KAAK,CAAC;YAClC,IAAI,2BAAe,CAAC,IAA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AAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEO,iBAAiB,CACrB,WAA0C;QAE1C,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACtD,OAAO,CAAC,UAAU,IAAI,UAAU,KAAK,mBAAO;YACxC,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;IAC5C,CAAC;IAED;;;;;OAKG;IACK,QAAQ,CAAC,SAAwB;QACrC,OAAO,OAAO,SAAS,KAAK,QAAQ;YAChC,CAAC,CAAC,IAAI,YAAI,CAAC,SAAS,CAAC;YACrB,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;CACJ;AA9LD,sBA8LC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Answerable } from '../Answerable';
|
|
2
|
+
import { AnswersQuestions } from '../questions';
|
|
3
|
+
import { Ability } from './Ability';
|
|
4
|
+
import { UsesAbilities } from './UsesAbilities';
|
|
5
|
+
/**
|
|
6
|
+
* This {@apilink Ability} enables an {@apilink Actor} to resolve the value of a given {@apilink Answerable}.
|
|
7
|
+
*
|
|
8
|
+
* {@apilink AnswerQuestions} is used internally by {@apilink Actor.answer}, and it is unlikely you'll ever need to use it directly in your code.
|
|
9
|
+
* That is, unless you're building a custom Serenity/JS extension and want to override the default behaviour of the framework,
|
|
10
|
+
* in which case you should check out the [Contributor's Guide](/contributing).
|
|
11
|
+
*
|
|
12
|
+
* @group Abilities
|
|
13
|
+
*/
|
|
14
|
+
export declare class AnswerQuestions extends Ability {
|
|
15
|
+
protected readonly actor: AnswersQuestions & UsesAbilities;
|
|
16
|
+
constructor(actor: AnswersQuestions & UsesAbilities);
|
|
17
|
+
answer<T>(answerable: Answerable<T>): Promise<T>;
|
|
18
|
+
private static isAPromise;
|
|
19
|
+
private static isDefined;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=AnswerQuestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnswerQuestions.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/AnswerQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;GAQG;AACH,qBAAa,eAAgB,SAAQ,OAAO;IAC5B,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,GAAG,aAAa;gBAAvC,KAAK,EAAE,gBAAgB,GAAG,aAAa;IAItE,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAahD,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB,OAAO,CAAC,MAAM,CAAC,SAAS;CAG3B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnswerQuestions = void 0;
|
|
4
|
+
const Question_1 = require("../Question");
|
|
5
|
+
const Ability_1 = require("./Ability");
|
|
6
|
+
/**
|
|
7
|
+
* This {@apilink Ability} enables an {@apilink Actor} to resolve the value of a given {@apilink Answerable}.
|
|
8
|
+
*
|
|
9
|
+
* {@apilink AnswerQuestions} is used internally by {@apilink Actor.answer}, and it is unlikely you'll ever need to use it directly in your code.
|
|
10
|
+
* That is, unless you're building a custom Serenity/JS extension and want to override the default behaviour of the framework,
|
|
11
|
+
* in which case you should check out the [Contributor's Guide](/contributing).
|
|
12
|
+
*
|
|
13
|
+
* @group Abilities
|
|
14
|
+
*/
|
|
15
|
+
class AnswerQuestions extends Ability_1.Ability {
|
|
16
|
+
constructor(actor) {
|
|
17
|
+
super();
|
|
18
|
+
this.actor = actor;
|
|
19
|
+
}
|
|
20
|
+
answer(answerable) {
|
|
21
|
+
if (AnswerQuestions.isDefined(answerable) && AnswerQuestions.isAPromise(answerable)) {
|
|
22
|
+
return answerable;
|
|
23
|
+
}
|
|
24
|
+
if (AnswerQuestions.isDefined(answerable) && Question_1.Question.isAQuestion(answerable)) {
|
|
25
|
+
return this.answer(answerable.answeredBy(this.actor));
|
|
26
|
+
}
|
|
27
|
+
return Promise.resolve(answerable);
|
|
28
|
+
}
|
|
29
|
+
static isAPromise(v) {
|
|
30
|
+
return Object.prototype.hasOwnProperty.call(v, 'then');
|
|
31
|
+
}
|
|
32
|
+
static isDefined(v) {
|
|
33
|
+
return !(v === undefined || v === null);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.AnswerQuestions = AnswerQuestions;
|
|
37
|
+
//# sourceMappingURL=AnswerQuestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnswerQuestions.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/AnswerQuestions.ts"],"names":[],"mappings":";;;AACA,0CAAuC;AAEvC,uCAAoC;AAGpC;;;;;;;;GAQG;AACH,MAAa,eAAgB,SAAQ,iBAAO;IACxC,YAA+B,KAAuC;QAClE,KAAK,EAAE,CAAC;QADmB,UAAK,GAAL,KAAK,CAAkC;IAEtE,CAAC;IAED,MAAM,CAAI,UAAyB;QAE/B,IAAI,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,eAAe,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;YACjF,OAAO,UAAU,CAAC;SACrB;QAED,IAAI,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,mBAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;YAC3E,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SACzD;QAED,OAAO,OAAO,CAAC,OAAO,CAAC,UAAe,CAAC,CAAC;IAC5C,CAAC;IAEO,MAAM,CAAC,UAAU,CAAI,CAAgB;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAEO,MAAM,CAAC,SAAS,CAAI,CAAgB;QACxC,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;IAC5C,CAAC;CACJ;AAzBD,0CAyBC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EmitsDomainEvents } from '../../events';
|
|
2
|
+
import { Outcome } from '../../model';
|
|
3
|
+
import { PerformsActivities } from '../activities/PerformsActivities';
|
|
4
|
+
import { Activity } from '../Activity';
|
|
5
|
+
import { Ability } from './index';
|
|
6
|
+
/**
|
|
7
|
+
* An {@apilink Ability} that enables an {@apilink Actor} to perform a given {@apilink Activity}.
|
|
8
|
+
*
|
|
9
|
+
* {@apilink PerformActivities} is used internally by {@apilink Actor.perform}, and it is unlikely you'll ever need to use it directly in your code.
|
|
10
|
+
* That is, unless you're building a custom Serenity/JS extension and want to override the default behaviour of the framework,
|
|
11
|
+
* in which case you should check out the [Contributor's Guide](/contributing).
|
|
12
|
+
*
|
|
13
|
+
* @group Abilities
|
|
14
|
+
*/
|
|
15
|
+
export declare class PerformActivities extends Ability {
|
|
16
|
+
protected readonly actor: PerformsActivities & {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
protected readonly stage: EmitsDomainEvents;
|
|
20
|
+
constructor(actor: PerformsActivities & {
|
|
21
|
+
name: string;
|
|
22
|
+
}, stage: EmitsDomainEvents);
|
|
23
|
+
perform(activity: Activity): Promise<void>;
|
|
24
|
+
protected outcomeFor(error: Error | any): Outcome;
|
|
25
|
+
private detailsOf;
|
|
26
|
+
protected nameOf(activity: Activity): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=PerformActivities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerformActivities.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/PerformActivities.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAoE,MAAM,cAAc,CAAC;AACnH,OAAO,EAQH,OAAO,EAEV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,OAAO;IAEtC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;IAC/D,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,iBAAiB;gBADxB,KAAK,EAAE,kBAAkB,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAC5C,KAAK,EAAE,iBAAiB;IAKzC,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBhD,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,OAAO;IAYjD,OAAO,CAAC,SAAS;IAOjB,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;CAO/C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PerformActivities = void 0;
|
|
4
|
+
const tiny_types_1 = require("tiny-types");
|
|
5
|
+
const errors_1 = require("../../errors");
|
|
6
|
+
const events_1 = require("../../events");
|
|
7
|
+
const model_1 = require("../../model");
|
|
8
|
+
const Interaction_1 = require("../Interaction");
|
|
9
|
+
const index_1 = require("./index");
|
|
10
|
+
/**
|
|
11
|
+
* An {@apilink Ability} that enables an {@apilink Actor} to perform a given {@apilink Activity}.
|
|
12
|
+
*
|
|
13
|
+
* {@apilink PerformActivities} is used internally by {@apilink Actor.perform}, and it is unlikely you'll ever need to use it directly in your code.
|
|
14
|
+
* That is, unless you're building a custom Serenity/JS extension and want to override the default behaviour of the framework,
|
|
15
|
+
* in which case you should check out the [Contributor's Guide](/contributing).
|
|
16
|
+
*
|
|
17
|
+
* @group Abilities
|
|
18
|
+
*/
|
|
19
|
+
class PerformActivities extends index_1.Ability {
|
|
20
|
+
constructor(actor, stage) {
|
|
21
|
+
super();
|
|
22
|
+
this.actor = actor;
|
|
23
|
+
this.stage = stage;
|
|
24
|
+
}
|
|
25
|
+
async perform(activity) {
|
|
26
|
+
const sceneId = this.stage.currentSceneId();
|
|
27
|
+
const details = this.detailsOf(activity);
|
|
28
|
+
const activityId = this.stage.assignNewActivityId(details);
|
|
29
|
+
const [activityStarts, activityFinished] = activity instanceof Interaction_1.Interaction
|
|
30
|
+
? [events_1.InteractionStarts, events_1.InteractionFinished]
|
|
31
|
+
: [events_1.TaskStarts, events_1.TaskFinished];
|
|
32
|
+
try {
|
|
33
|
+
this.stage.announce(new activityStarts(sceneId, activityId, details, this.stage.currentTime()));
|
|
34
|
+
await activity.performAs(this.actor);
|
|
35
|
+
this.stage.announce(new activityFinished(sceneId, activityId, details, new model_1.ExecutionSuccessful(), this.stage.currentTime()));
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
this.stage.announce(new activityFinished(sceneId, activityId, details, this.outcomeFor(error), this.stage.currentTime()));
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
await this.stage.waitForNextCue();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
outcomeFor(error) {
|
|
46
|
+
return (0, tiny_types_1.match)(error)
|
|
47
|
+
.when(errors_1.ImplementationPendingError, _ => new model_1.ImplementationPending(error))
|
|
48
|
+
.when(errors_1.TestCompromisedError, _ => new model_1.ExecutionCompromised(error))
|
|
49
|
+
.when(errors_1.AssertionError, _ => new model_1.ExecutionFailedWithAssertionError(error))
|
|
50
|
+
.when(Error, _ => /AssertionError/.test(error.constructor.name) // mocha
|
|
51
|
+
? new model_1.ExecutionFailedWithAssertionError(error)
|
|
52
|
+
: new model_1.ExecutionFailedWithError(error))
|
|
53
|
+
.else(_ => new model_1.ExecutionFailedWithError(error));
|
|
54
|
+
}
|
|
55
|
+
detailsOf(activity) {
|
|
56
|
+
return new model_1.ActivityDetails(new model_1.Name(this.nameOf(activity)), activity.instantiationLocation());
|
|
57
|
+
}
|
|
58
|
+
nameOf(activity) {
|
|
59
|
+
const template = activity.toString() === ({}).toString()
|
|
60
|
+
? `#actor performs ${activity.constructor.name}`
|
|
61
|
+
: activity.toString();
|
|
62
|
+
return template.replace('#actor', this.actor.name);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.PerformActivities = PerformActivities;
|
|
66
|
+
//# sourceMappingURL=PerformActivities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerformActivities.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/PerformActivities.ts"],"names":[],"mappings":";;;AAAA,2CAAmC;AAEnC,yCAAgG;AAChG,yCAAmH;AACnH,uCAUqB;AAGrB,gDAA6C;AAC7C,mCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAa,iBAAkB,SAAQ,eAAO;IAC1C,YACuB,KAA4C,EAC5C,KAAwB;QAE3C,KAAK,EAAE,CAAC;QAHW,UAAK,GAAL,KAAK,CAAuC;QAC5C,UAAK,GAAL,KAAK,CAAmB;IAG/C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAkB;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC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C,IAAI,4BAAoB,CAAC,KAAK,CAAC,CAAC;aAChE,IAAI,CAAC,uBAAc,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,yCAAiC,CAAC,KAAK,CAAC,CAAC;aACvE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CACb,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ;YAClD,CAAC,CAAC,IAAI,yCAAiC,CAAC,KAAK,CAAC;YAC9C,CAAC,CAAC,IAAI,gCAAwB,CAAC,KAAK,CAAC,CAAC;aAC7C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,gCAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,CAAC;IAEO,SAAS,CAAC,QAAkB;QAChC,OAAO,IAAI,uBAAe,CACtB,IAAI,YAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAC/B,QAAQ,CAAC,qBAAqB,EAAE,CACnC,CAAA;IACL,CAAC;IAES,MAAM,CAAC,QAAkB;QAC/B,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;YACpD,CAAC,CAAC,mBAAoB,QAAQ,CAAC,WAAW,CAAC,IAAK,EAAE;YAClD,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAE1B,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;CACJ;AA1DD,8CA0DC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './Ability';
|
|
2
2
|
export * from './AbilityType';
|
|
3
|
+
export * from './AnswerQuestions';
|
|
3
4
|
export * from './CanHaveAbilities';
|
|
4
5
|
export * from './Discardable';
|
|
5
6
|
export * from './Initialisable';
|
|
7
|
+
export * from './PerformActivities';
|
|
6
8
|
export * from './UsesAbilities';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
@@ -16,8 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Ability"), exports);
|
|
18
18
|
__exportStar(require("./AbilityType"), exports);
|
|
19
|
+
__exportStar(require("./AnswerQuestions"), exports);
|
|
19
20
|
__exportStar(require("./CanHaveAbilities"), exports);
|
|
20
21
|
__exportStar(require("./Discardable"), exports);
|
|
21
22
|
__exportStar(require("./Initialisable"), exports);
|
|
23
|
+
__exportStar(require("./PerformActivities"), exports);
|
|
22
24
|
__exportStar(require("./UsesAbilities"), exports);
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,gDAA8B;AAC9B,qDAAmC;AACnC,gDAA8B;AAC9B,kDAAgC;AAChC,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,gDAA8B;AAC9B,oDAAkC;AAClC,qDAAmC;AACnC,gDAA8B;AAC9B,kDAAgC;AAChC,sDAAoC;AACpC,kDAAgC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ability, Discardable
|
|
1
|
+
import { Ability, Discardable } from '../../abilities';
|
|
2
2
|
import { Clock, DelayedCallback, Duration, RepeatUntilLimits } from '../models';
|
|
3
3
|
/**
|
|
4
4
|
* An {@apilink Ability} that enables an {@apilink Actor} to schedule a callback function
|
|
@@ -10,11 +10,9 @@ import { Clock, DelayedCallback, Duration, RepeatUntilLimits } from '../models';
|
|
|
10
10
|
*
|
|
11
11
|
* @group Time
|
|
12
12
|
*/
|
|
13
|
-
export declare class ScheduleWork extends Ability implements
|
|
13
|
+
export declare class ScheduleWork extends Ability implements Discardable {
|
|
14
14
|
private readonly scheduler;
|
|
15
15
|
constructor(clock: Clock, interactionTimeout: Duration);
|
|
16
|
-
initialise(): void;
|
|
17
|
-
isInitialised(): boolean;
|
|
18
16
|
/**
|
|
19
17
|
* @param callback
|
|
20
18
|
* @param limits
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleWork.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/time/abilities/ScheduleWork.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"ScheduleWork.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/time/abilities/ScheduleWork.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAa,MAAM,WAAW,CAAC;AAE3F;;;;;;;;;GASG;AACH,qBAAa,YAAa,SAAQ,OAAQ,YAAW,WAAW;IAE5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAE1B,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ;IAKtD;;;OAGG;IACH,WAAW,CAAC,MAAM,EACd,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,EACjC,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,GACnC,OAAO,CAAC,MAAM,CAAC;IAIlB,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC,OAAO,IAAI,IAAI;CAGlB"}
|
|
@@ -18,12 +18,6 @@ class ScheduleWork extends abilities_1.Ability {
|
|
|
18
18
|
super();
|
|
19
19
|
this.scheduler = new models_1.Scheduler(clock, interactionTimeout);
|
|
20
20
|
}
|
|
21
|
-
initialise() {
|
|
22
|
-
this.scheduler.start();
|
|
23
|
-
}
|
|
24
|
-
isInitialised() {
|
|
25
|
-
return this.scheduler.isRunning();
|
|
26
|
-
}
|
|
27
21
|
/**
|
|
28
22
|
* @param callback
|
|
29
23
|
* @param limits
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleWork.js","sourceRoot":"","sources":["../../../../src/screenplay/time/abilities/ScheduleWork.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"ScheduleWork.js","sourceRoot":"","sources":["../../../../src/screenplay/time/abilities/ScheduleWork.ts"],"names":[],"mappings":";;;AAAA,+CAAuD;AACvD,sCAA2F;AAE3F;;;;;;;;;GASG;AACH,MAAa,YAAa,SAAQ,mBAAO;IAIrC,YAAY,KAAY,EAAE,kBAA4B;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,IAAI,kBAAS,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACH,WAAW,CACP,QAAiC,EACjC,MAAkC;QAElC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,CAAC,KAAe;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;CACJ;AA3BD,oCA2BC"}
|