@serenity-js/core 3.0.0-rc.41 → 3.0.0-rc.43

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +6 -1
  3. package/lib/Serenity.d.ts +4 -1
  4. package/lib/Serenity.d.ts.map +1 -1
  5. package/lib/Serenity.js +6 -2
  6. package/lib/Serenity.js.map +1 -1
  7. package/lib/errors/ErrorOptions.d.ts +3 -0
  8. package/lib/errors/ErrorOptions.d.ts.map +1 -1
  9. package/lib/events/TestRunFinished.d.ts +5 -3
  10. package/lib/events/TestRunFinished.d.ts.map +1 -1
  11. package/lib/events/TestRunFinished.js +4 -3
  12. package/lib/events/TestRunFinished.js.map +1 -1
  13. package/lib/instance.d.ts +48 -4
  14. package/lib/instance.d.ts.map +1 -1
  15. package/lib/instance.js +48 -4
  16. package/lib/instance.js.map +1 -1
  17. package/lib/io/Path.d.ts +1 -0
  18. package/lib/io/Path.d.ts.map +1 -1
  19. package/lib/io/Path.js +3 -0
  20. package/lib/io/Path.js.map +1 -1
  21. package/lib/model/ScenarioDetails.d.ts.map +1 -1
  22. package/lib/model/ScenarioDetails.js +3 -0
  23. package/lib/model/ScenarioDetails.js.map +1 -1
  24. package/lib/screenplay/Activity.d.ts +4 -4
  25. package/lib/screenplay/Activity.js +4 -4
  26. package/lib/screenplay/Actor.d.ts +52 -4
  27. package/lib/screenplay/Actor.d.ts.map +1 -1
  28. package/lib/screenplay/Actor.js +52 -4
  29. package/lib/screenplay/Actor.js.map +1 -1
  30. package/lib/screenplay/Interaction.d.ts +27 -6
  31. package/lib/screenplay/Interaction.d.ts.map +1 -1
  32. package/lib/screenplay/Interaction.js +27 -6
  33. package/lib/screenplay/Interaction.js.map +1 -1
  34. package/lib/screenplay/Question.d.ts +14 -11
  35. package/lib/screenplay/Question.d.ts.map +1 -1
  36. package/lib/screenplay/Question.js +14 -11
  37. package/lib/screenplay/Question.js.map +1 -1
  38. package/lib/screenplay/Task.d.ts +128 -12
  39. package/lib/screenplay/Task.d.ts.map +1 -1
  40. package/lib/screenplay/Task.js +128 -12
  41. package/lib/screenplay/Task.js.map +1 -1
  42. package/lib/screenplay/abilities/Ability.d.ts +241 -7
  43. package/lib/screenplay/abilities/Ability.d.ts.map +1 -1
  44. package/lib/screenplay/abilities/Ability.js +241 -7
  45. package/lib/screenplay/abilities/Ability.js.map +1 -1
  46. package/lib/screenplay/interactions/Log.d.ts +1 -1
  47. package/lib/screenplay/interactions/Log.js +1 -1
  48. package/lib/screenplay/interactions/Wait.d.ts +2 -2
  49. package/lib/screenplay/interactions/Wait.js +2 -2
  50. package/lib/screenplay/interactions/debug/Debug.d.ts +1 -1
  51. package/lib/screenplay/interactions/debug/Debug.js +1 -1
  52. package/lib/screenplay/notes/TakeNotes.d.ts +1 -1
  53. package/lib/screenplay/notes/TakeNotes.js +1 -1
  54. package/lib/screenplay/questions/Check.d.ts +1 -1
  55. package/lib/screenplay/questions/Check.js +1 -1
  56. package/lib/stage/Cast.d.ts +97 -22
  57. package/lib/stage/Cast.d.ts.map +1 -1
  58. package/lib/stage/Cast.js +105 -24
  59. package/lib/stage/Cast.js.map +1 -1
  60. package/lib/stage/Stage.d.ts +5 -3
  61. package/lib/stage/Stage.d.ts.map +1 -1
  62. package/lib/stage/Stage.js +9 -3
  63. package/lib/stage/Stage.js.map +1 -1
  64. package/package.json +4 -4
  65. package/src/Serenity.ts +10 -3
  66. package/src/errors/ErrorOptions.ts +3 -0
  67. package/src/events/TestRunFinished.ts +10 -4
  68. package/src/instance.ts +48 -4
  69. package/src/io/Path.ts +4 -0
  70. package/src/model/ScenarioDetails.ts +4 -1
  71. package/src/screenplay/Activity.ts +4 -4
  72. package/src/screenplay/Actor.ts +52 -4
  73. package/src/screenplay/Interaction.ts +27 -6
  74. package/src/screenplay/Question.ts +14 -11
  75. package/src/screenplay/Task.ts +128 -12
  76. package/src/screenplay/abilities/Ability.ts +241 -7
  77. package/src/screenplay/interactions/Log.ts +1 -1
  78. package/src/screenplay/interactions/Wait.ts +2 -2
  79. package/src/screenplay/interactions/debug/Debug.ts +1 -1
  80. package/src/screenplay/notes/TakeNotes.ts +1 -1
  81. package/src/screenplay/questions/Check.ts +1 -1
  82. package/src/stage/Cast.ts +106 -24
  83. package/src/stage/Stage.ts +10 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
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.0.0-rc.43](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.42...v3.0.0-rc.43) (2023-03-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **core:** introduced Cast.where factory method to make it easier to generate custom casts of actors ([26637f1](https://github.com/serenity-js/serenity-js/commit/26637f10746bbd264ab73ab14b43eaf11dea5652)), closes [#1523](https://github.com/serenity-js/serenity-js/issues/1523)
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-rc.42](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.41...v3.0.0-rc.42) (2023-02-12)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **core:** allow for multiple events to be announced using a single call to Stage ([2bcae80](https://github.com/serenity-js/serenity-js/commit/2bcae809075fd9ef4f77f41714c78a4da5643acd))
23
+ * **core:** event TestRunFinished now incidates the Outcome of the test suite ([a941056](https://github.com/serenity-js/serenity-js/commit/a9410566891e543101b935a80db9c7daea0c9944)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
24
+ * **mocha:** default to using file name as feature name when describe blocks are absent ([1ca81ef](https://github.com/serenity-js/serenity-js/commit/1ca81efe5fe5547bea3e4fd9abe7712f2e775b5d)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
25
+ * **playwright-test:** default to using file name as feature name when describe blocks are absent ([1295b04](https://github.com/serenity-js/serenity-js/commit/1295b04adcd12a9d7eaef795e1080bb1c5a9056d)), closes [#1495](https://github.com/serenity-js/serenity-js/issues/1495)
26
+
27
+
28
+
29
+
30
+
6
31
  # [3.0.0-rc.41](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.40...v3.0.0-rc.41) (2023-02-07)
7
32
 
8
33
 
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Serenity/JS
2
2
 
3
+ [![Follow Serenity/JS on LinkedIn](https://img.shields.io/badge/Follow-Serenity%2FJS%20-0077B5?logo=linkedin)](https://www.linkedin.com/company/serenity-js)
4
+ [![Watch Serenity/JS on YouTube](https://img.shields.io/badge/Watch-@serenity--js-E62117?logo=youtube)](https://www.youtube.com/@serenity-js)
5
+ [![Join Serenity/JS Community Chat](https://img.shields.io/badge/Chat-Serenity%2FJS%20Community-FBD30B?logo=matrix)](https://matrix.to/#/#serenity-js:gitter.im)
6
+ [![Support Serenity/JS on GitHub](https://img.shields.io/badge/Support-@serenity--js-703EC8?logo=github)](https://matrix.to/#/#serenity-js:gitter.im)
7
+
3
8
  [Serenity/JS](https://serenity-js.org) is a framework designed to make acceptance and regression testing
4
9
  of modern full-stack applications faster, more collaborative and easier to scale.
5
10
 
@@ -10,7 +15,7 @@ and [API docs](https://serenity-js.org/modules/), and follow [@SerenityJS](https
10
15
 
11
16
  To learn more about Serenity/JS, check out the video below, read the [tutorial](https://serenity-js.org/handbook/thinking-in-serenity-js/index.html), review the [examples](https://github.com/serenity-js/serenity-js/tree/main/examples), and create your own test suite with [Serenity/JS template projects](https://github.com/serenity-js).
12
17
 
13
- If you have any questions, join us on [Serenity/JS Community Chat](https://gitter.im/serenity-js/Lobby).
18
+ If you have any questions, join us on the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im).
14
19
 
15
20
  [![Full-Stack Acceptance Testing with Serenity/JS and the Screenplay Pattern](https://img.youtube.com/vi/djPMf-n93Rw/0.jpg)](https://www.youtube.com/watch?v=djPMf-n93Rw)
16
21
 
package/lib/Serenity.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { SerenityConfig } from './config';
2
2
  import { ErrorOptions, RuntimeError } from './errors';
3
3
  import { DomainEvent } from './events';
4
+ import { Path } from './io';
4
5
  import { ActivityDetails, CorrelationId, Timestamp } from './model';
5
6
  import { Actor } from './screenplay';
6
7
  import { Cast } from './stage/Cast';
@@ -15,6 +16,7 @@ export declare class Serenity {
15
16
  private stage;
16
17
  private outputStream;
17
18
  private readonly classLoader;
19
+ private readonly workingDirectory;
18
20
  /**
19
21
  * @param clock
20
22
  */
@@ -189,7 +191,7 @@ export declare class Serenity {
189
191
  * - {@apilink Cast}
190
192
  */
191
193
  theActorInTheSpotlight(): Actor;
192
- announce(event: DomainEvent): void;
194
+ announce(...events: Array<DomainEvent>): void;
193
195
  currentTime(): Timestamp;
194
196
  assignNewSceneId(): CorrelationId;
195
197
  currentSceneId(): CorrelationId;
@@ -199,5 +201,6 @@ export declare class Serenity {
199
201
  * @package
200
202
  */
201
203
  waitForNextCue(): Promise<void>;
204
+ cwd(): Path;
202
205
  }
203
206
  //# sourceMappingURL=Serenity.d.ts.map
@@ -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,MAAM,UAAU,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAY,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAKtC;;GAEG;AACH,qBAAa,QAAQ;IAab,OAAO,CAAC,QAAQ,CAAC,KAAK;IAZ1B,OAAO,CAAC,MAA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a;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
@@ -21,6 +21,7 @@ class Serenity {
21
21
  this.outputStream = process.stdout;
22
22
  this.stage = new Stage_1.Stage(Serenity.defaultActors, new StageManager_1.StageManager(Serenity.defaultCueTimeout, clock), new errors_1.ErrorFactory());
23
23
  this.classLoader = new io_1.ClassLoader(new io_1.ModuleLoader(cwd), new io_1.ClassDescriptionParser());
24
+ this.workingDirectory = new io_1.Path(cwd);
24
25
  }
25
26
  /**
26
27
  * Configures Serenity/JS. Every call to this function
@@ -226,8 +227,8 @@ class Serenity {
226
227
  theActorInTheSpotlight() {
227
228
  return this.stage.theActorInTheSpotlight();
228
229
  }
229
- announce(event) {
230
- this.stage.announce(event);
230
+ announce(...events) {
231
+ this.stage.announce(...events);
231
232
  }
232
233
  currentTime() {
233
234
  return this.stage.currentTime();
@@ -250,6 +251,9 @@ class Serenity {
250
251
  waitForNextCue() {
251
252
  return this.stage.waitForNextCue();
252
253
  }
254
+ cwd() {
255
+ return this.workingDirectory;
256
+ }
253
257
  }
254
258
  exports.Serenity = Serenity;
255
259
  Serenity.defaultCueTimeout = model_1.Duration.ofSeconds(5);
@@ -1 +1 @@
1
- {"version":3,"file":"Serenity.js","sourceRoot":"","sources":["../src/Serenity.ts"],"names":[],"mappings":";;;AAAA,2CAAuE;AAIvE,qCAA2G;AAE3G,6BAAiF;AACjF,mCAA8E;AAI9E,yCAAsC;AACtC,2CAAwC;AACxC,yCAAsC;AACtC,uDAAoD;AAEpD;;GAEG;AACH,MAA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AC,CAAC,CAAC;AAC7C,sBAAa,GAAU,IAAI,eAAM,EAAE,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import { FileSystemLocation } from '../io';
2
2
  import { ExpectationDetails } from '../screenplay';
3
+ /**
4
+ * @group Errors
5
+ */
3
6
  export interface ErrorOptions {
4
7
  message: string;
5
8
  location?: FileSystemLocation;
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorOptions.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,IAAI,CAAC,EAAE;QACH,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB"}
1
+ {"version":3,"file":"ErrorOptions.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,IAAI,CAAC,EAAE;QACH,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB"}
@@ -1,4 +1,5 @@
1
- import { Timestamp } from '../model';
1
+ import { JSONObject } from 'tiny-types';
2
+ import { Outcome, Timestamp } from '../model';
2
3
  import { DomainEvent } from './DomainEvent';
3
4
  /**
4
5
  * Emitted when all the test scenarios have finished running.
@@ -6,7 +7,8 @@ import { DomainEvent } from './DomainEvent';
6
7
  * @group Events
7
8
  */
8
9
  export declare class TestRunFinished extends DomainEvent {
9
- static fromJSON(v: string): TestRunFinished;
10
- constructor(timestamp?: Timestamp);
10
+ readonly outcome: Outcome;
11
+ static fromJSON(o: JSONObject): TestRunFinished;
12
+ constructor(outcome: Outcome, timestamp?: Timestamp);
11
13
  }
12
14
  //# sourceMappingURL=TestRunFinished.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TestRunFinished.d.ts","sourceRoot":"","sources":["../../src/events/TestRunFinished.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC5C,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe;gBAM/B,SAAS,CAAC,EAAE,SAAS;CAGpC"}
1
+ {"version":3,"file":"TestRunFinished.d.ts","sourceRoot":"","sources":["../../src/events/TestRunFinished.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,OAAO,EAAqB,SAAS,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,WAAW;aASxB,OAAO,EAAE,OAAO;IARpC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe;gBAQ3B,OAAO,EAAE,OAAO,EAChC,SAAS,CAAC,EAAE,SAAS;CAI5B"}
@@ -9,11 +9,12 @@ const DomainEvent_1 = require("./DomainEvent");
9
9
  * @group Events
10
10
  */
11
11
  class TestRunFinished extends DomainEvent_1.DomainEvent {
12
- static fromJSON(v) {
13
- return new TestRunFinished(model_1.Timestamp.fromJSON(v));
12
+ static fromJSON(o) {
13
+ return new TestRunFinished(model_1.Outcome.fromJSON(o.outcome), model_1.Timestamp.fromJSON(o.timestamp));
14
14
  }
15
- constructor(timestamp) {
15
+ constructor(outcome, timestamp) {
16
16
  super(timestamp);
17
+ this.outcome = outcome;
17
18
  }
18
19
  }
19
20
  exports.TestRunFinished = TestRunFinished;
@@ -1 +1 @@
1
- {"version":3,"file":"TestRunFinished.js","sourceRoot":"","sources":["../../src/events/TestRunFinished.ts"],"names":[],"mappings":";;;AAAA,oCAAqC;AACrC,+CAA4C;AAE5C;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,yBAAW;IAC5C,MAAM,CAAC,QAAQ,CAAC,CAAS;QACrB,OAAO,IAAI,eAAe,CACtB,iBAAS,CAAC,QAAQ,CAAC,CAAW,CAAC,CAClC,CAAC;IACN,CAAC;IAED,YAAY,SAAqB;QAC7B,KAAK,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;CACJ;AAVD,0CAUC"}
1
+ {"version":3,"file":"TestRunFinished.js","sourceRoot":"","sources":["../../src/events/TestRunFinished.ts"],"names":[],"mappings":";;;AAEA,oCAAiE;AACjE,+CAA4C;AAE5C;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,yBAAW;IAC5C,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,eAAe,CACtB,eAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAA4B,CAAC,EAChD,iBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAmB,CAAC,CAC5C,CAAC;IACN,CAAC;IAED,YACoB,OAAgB,EAChC,SAAqB;QAErB,KAAK,CAAC,SAAS,CAAC,CAAC;QAHD,YAAO,GAAP,OAAO,CAAS;IAIpC,CAAC;CACJ;AAdD,0CAcC"}
package/lib/instance.d.ts CHANGED
@@ -16,6 +16,10 @@ export declare const serenity: Serenity;
16
16
  *
17
17
  * This function is an alias for {@apilink Serenity.configure}.
18
18
  *
19
+ * :::tip configure vs engage
20
+ * If you want to retain the configuration but reset the {@apilink Cast|cast of actors}, use {@apilink engage} instead.
21
+ * :::
22
+ *
19
23
  * @param config
20
24
  *
21
25
  * @group Serenity
@@ -29,6 +33,12 @@ export declare function configure(config: SerenityConfig): void;
29
33
  * which provides an alternative to calling {@apilink Actor.whoCan} directly in your tests
30
34
  * and is typically invoked in a "before all" or "before each" hook of your test runner of choice.
31
35
  *
36
+ * :::tip configure vs engage
37
+ * Calling {@apilink engage} replaces the currently configured {@apilink Cast|cast of actors},
38
+ * but doesn't affect any other configuration.
39
+ * If you want to reset the Serenity/JS configuration completely, use {@apilink configure} instead.
40
+ * :::
41
+ *
32
42
  * If your implementation of the {@apilink Cast} interface is stateless,
33
43
  * you can invoke this function just once before your entire test suite is executed, see
34
44
  * - [`beforeAll`](https://jasmine.github.io/api/3.6/global.html#beforeAll) in Jasmine,
@@ -67,20 +77,54 @@ export declare function configure(config: SerenityConfig): void;
67
77
  *
68
78
  * ### Using with Jasmine test runner
69
79
  *
70
- * ```ts
80
+ * ```typescript
71
81
  * import 'jasmine'
72
82
  *
73
- * beforeEach(() => engage(new Actors()))
83
+ * describe('My feature', () => {
84
+ * beforeEach(() => engage(new Actors()))
85
+ *
86
+ *
87
+ * })
74
88
  * ```
75
89
  *
76
90
  * ### Using with Cucumber.js test runner
77
91
  *
78
- * ```ts
92
+ * Engage `Actors` [before](https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/hooks.md)
93
+ * each test scenario:
94
+ *
95
+ * ```typescript
79
96
  * import { Before } from '@cucumber/cucumber'
80
97
  *
81
98
  * Before(() => engage(new Actors()))
82
99
  * ```
83
100
  *
101
+ * Engage `Actors` before scenarios with [specific tags](https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/hooks.md#tagged-hooks):
102
+ *
103
+ * ```typescript
104
+ * import { Before } from '@cucumber/cucumber'
105
+ *
106
+ * Before('@web', () => engage(new Actors()))
107
+ * ```
108
+ *
109
+ * ### Using with Playwright Test runner
110
+ *
111
+ * [Serenity/JS Playwright Test module](/api/playwright-test) will configure the cast on your behalf,
112
+ * so you don't need to call {@apilink engage}.
113
+ *
114
+ * ```ts
115
+ * import { describe, it, test } from '@serenity-js/playwright-test'
116
+ *
117
+ * describe('My feature', () => {
118
+ *
119
+ * this.use({
120
+ * actors: new Actors()
121
+ * })
122
+ *
123
+ * // test scenarios
124
+ *
125
+ * })
126
+ * ```
127
+ *
84
128
  * ## Learn more
85
129
  * - {@apilink Actor}
86
130
  * - {@apilink Cast}
@@ -88,7 +132,7 @@ export declare function configure(config: SerenityConfig): void;
88
132
  *
89
133
  * @param actors
90
134
  *
91
- * @group Stage
135
+ * @group Serenity
92
136
  */
93
137
  export declare function engage(actors: Cast): void;
94
138
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAS,MAAM,SAAS,CAAC;AAItC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAsB,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAEtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAEzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAE/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,mBAAmB,IAAI,KAAK,CAE3C"}
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAS,MAAM,SAAS,CAAC;AAItC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAsB,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAEtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAEzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAE/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,mBAAmB,IAAI,KAAK,CAE3C"}
package/lib/instance.js CHANGED
@@ -18,6 +18,10 @@ exports.serenity = new Serenity_1.Serenity(clock);
18
18
  *
19
19
  * This function is an alias for {@apilink Serenity.configure}.
20
20
  *
21
+ * :::tip configure vs engage
22
+ * If you want to retain the configuration but reset the {@apilink Cast|cast of actors}, use {@apilink engage} instead.
23
+ * :::
24
+ *
21
25
  * @param config
22
26
  *
23
27
  * @group Serenity
@@ -34,6 +38,12 @@ exports.configure = configure;
34
38
  * which provides an alternative to calling {@apilink Actor.whoCan} directly in your tests
35
39
  * and is typically invoked in a "before all" or "before each" hook of your test runner of choice.
36
40
  *
41
+ * :::tip configure vs engage
42
+ * Calling {@apilink engage} replaces the currently configured {@apilink Cast|cast of actors},
43
+ * but doesn't affect any other configuration.
44
+ * If you want to reset the Serenity/JS configuration completely, use {@apilink configure} instead.
45
+ * :::
46
+ *
37
47
  * If your implementation of the {@apilink Cast} interface is stateless,
38
48
  * you can invoke this function just once before your entire test suite is executed, see
39
49
  * - [`beforeAll`](https://jasmine.github.io/api/3.6/global.html#beforeAll) in Jasmine,
@@ -72,20 +82,54 @@ exports.configure = configure;
72
82
  *
73
83
  * ### Using with Jasmine test runner
74
84
  *
75
- * ```ts
85
+ * ```typescript
76
86
  * import 'jasmine'
77
87
  *
78
- * beforeEach(() => engage(new Actors()))
88
+ * describe('My feature', () => {
89
+ * beforeEach(() => engage(new Actors()))
90
+ *
91
+ *
92
+ * })
79
93
  * ```
80
94
  *
81
95
  * ### Using with Cucumber.js test runner
82
96
  *
83
- * ```ts
97
+ * Engage `Actors` [before](https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/hooks.md)
98
+ * each test scenario:
99
+ *
100
+ * ```typescript
84
101
  * import { Before } from '@cucumber/cucumber'
85
102
  *
86
103
  * Before(() => engage(new Actors()))
87
104
  * ```
88
105
  *
106
+ * Engage `Actors` before scenarios with [specific tags](https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/hooks.md#tagged-hooks):
107
+ *
108
+ * ```typescript
109
+ * import { Before } from '@cucumber/cucumber'
110
+ *
111
+ * Before('@web', () => engage(new Actors()))
112
+ * ```
113
+ *
114
+ * ### Using with Playwright Test runner
115
+ *
116
+ * [Serenity/JS Playwright Test module](/api/playwright-test) will configure the cast on your behalf,
117
+ * so you don't need to call {@apilink engage}.
118
+ *
119
+ * ```ts
120
+ * import { describe, it, test } from '@serenity-js/playwright-test'
121
+ *
122
+ * describe('My feature', () => {
123
+ *
124
+ * this.use({
125
+ * actors: new Actors()
126
+ * })
127
+ *
128
+ * // test scenarios
129
+ *
130
+ * })
131
+ * ```
132
+ *
89
133
  * ## Learn more
90
134
  * - {@apilink Actor}
91
135
  * - {@apilink Cast}
@@ -93,7 +137,7 @@ exports.configure = configure;
93
137
  *
94
138
  * @param actors
95
139
  *
96
- * @group Stage
140
+ * @group Serenity
97
141
  */
98
142
  function engage(actors) {
99
143
  exports.serenity.engage(actors);
@@ -1 +1 @@
1
- {"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":";;;AAEA,yCAAsC;AACtC,mCAAsC;AAEtC,MAAM,KAAK,GAAG,IAAI,aAAK,EAAE,CAAC;AAE1B;;;;GAIG;AACU,QAAA,QAAQ,GAAG,IAAI,mBAAQ,CAAC,KAAK,CAAC,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,SAAgB,SAAS,CAAC,MAAsB;IAC5C,gBAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAFD,8BAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,SAAgB,MAAM,CAAC,MAAY;IAC/B,gBAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAFD,wBAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,SAAgB,WAAW,CAAC,IAAY;IACpC,OAAO,gBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAFD,kCAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,mBAAmB;IAC/B,OAAO,gBAAQ,CAAC,sBAAsB,EAAE,CAAC;AAC7C,CAAC;AAFD,kDAEC"}
1
+ {"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":";;;AAEA,yCAAsC;AACtC,mCAAsC;AAEtC,MAAM,KAAK,GAAG,IAAI,aAAK,EAAE,CAAC;AAE1B;;;;GAIG;AACU,QAAA,QAAQ,GAAG,IAAI,mBAAQ,CAAC,KAAK,CAAC,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,SAAS,CAAC,MAAsB;IAC5C,gBAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAFD,8BAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AACH,SAAgB,MAAM,CAAC,MAAY;IAC/B,gBAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAFD,wBAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,SAAgB,WAAW,CAAC,IAAY;IACpC,OAAO,gBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAFD,kCAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,mBAAmB;IAC/B,OAAO,gBAAQ,CAAC,sBAAsB,EAAE,CAAC;AAC7C,CAAC;AAFD,kDAEC"}
package/lib/io/Path.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare class Path extends TinyType {
9
9
  join(another: Path): Path;
10
10
  split(): string[];
11
11
  resolve(another: Path): Path;
12
+ relative(another: Path): Path;
12
13
  directory(): Path;
13
14
  basename(): string;
14
15
  isAbsolute(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/io/Path.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,Q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AI5B,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI;IAI7B,SAAS,IAAI,IAAI;IAIjB,QAAQ,IAAI,MAAM;IAIlB,UAAU,IAAI,OAAO;IAIrB,IAAI,IAAI,IAAI;CAGf"}
package/lib/io/Path.js CHANGED
@@ -36,6 +36,9 @@ class Path extends tiny_types_1.TinyType {
36
36
  resolve(another) {
37
37
  return new Path(upath_1.default.resolve(this.value, another.value));
38
38
  }
39
+ relative(another) {
40
+ return new Path(upath_1.default.relative(this.value, another.value));
41
+ }
39
42
  directory() {
40
43
  return new Path(upath_1.default.dirname(this.value));
41
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Path.js","sourceRoot":"","sources":["../../src/io/Path.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAoC;AACpC,2CAAkF;AAClF,kDAAyB;AAEzB,MAAa,IAAK,SAAQ,qBAAQ;IAI9B,MAAM,CAAC,QAAQ,CAAC,CAAS;QACrB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,QAAkB;QAC7B,OAAO,IAAI,IAAI,CAAC,eAAI,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,KAAa;QACpC,MACI,UAAU,GAAG,eAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,EAC5D,SAAS,GAAI,eAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EACrC,QAAQ,GAAK,eAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,EACjD,QAAQ,GAAK,IAAA,oBAAU,EAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;aAClE,IAAI,EAAE;aACN,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC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C,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;;AAlEL,oBAmEC;AAlE2B,cAAS,GAAG,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScenarioDetails.d.ts","sourceRoot":"","sources":["../../src/model/ScenarioDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,eAAgB,SAAQ,QAAQ;aAUrB,IAAI,EAAE,IAAI;aACV,QAAQ,EAAE,QAAQ;aAClB,QAAQ,EAAE,kBAAkB;IAXhD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe;gBAS3B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,kBAAkB;CAInD"}
1
+ {"version":3,"file":"ScenarioDetails.d.ts","sourceRoot":"","sources":["../../src/model/ScenarioDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,eAAgB,SAAQ,QAAQ;aAUrB,IAAI,EAAE,IAAI;aACV,QAAQ,EAAE,QAAQ;aAClB,QAAQ,EAAE,kBAAkB;IAXhD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe;gBAS3B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,kBAAkB;CAOnD"}
@@ -14,6 +14,9 @@ class ScenarioDetails extends tiny_types_1.TinyType {
14
14
  this.name = name;
15
15
  this.category = category;
16
16
  this.location = location;
17
+ (0, tiny_types_1.ensure)('scenario name', name, (0, tiny_types_1.isDefined)());
18
+ (0, tiny_types_1.ensure)('scenario category', category, (0, tiny_types_1.isDefined)());
19
+ (0, tiny_types_1.ensure)('scenario location', location, (0, tiny_types_1.isDefined)());
17
20
  }
18
21
  }
19
22
  exports.ScenarioDetails = ScenarioDetails;
@@ -1 +1 @@
1
- {"version":3,"file":"ScenarioDetails.js","sourceRoot":"","sources":["../../src/model/ScenarioDetails.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAElD,8BAA2C;AAC3C,yCAAsC;AACtC,iCAA8B;AAE9B,MAAa,eAAgB,SAAQ,qBAAQ;IACzC,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,eAAe,CACtB,WAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAc,CAAC,EAC/B,mBAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAkB,CAAC,EACvC,uBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAsB,CAAC,CACxD,CAAC;IACN,CAAC;IAED,YACoB,IAAU,EACV,QAAkB,EAClB,QAA4B;QAE5C,KAAK,EAAE,CAAC;QAJQ,SAAI,GAAJ,IAAI,CAAM;QACV,aAAQ,GAAR,QAAQ,CAAU;QAClB,aAAQ,GAAR,QAAQ,CAAoB;IAGhD,CAAC;CACJ;AAhBD,0CAgBC"}
1
+ {"version":3,"file":"ScenarioDetails.js","sourceRoot":"","sources":["../../src/model/ScenarioDetails.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AAErE,8BAA2C;AAC3C,yCAAsC;AACtC,iCAA8B;AAE9B,MAAa,eAAgB,SAAQ,qBAAQ;IACzC,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,eAAe,CACtB,WAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAc,CAAC,EAC/B,mBAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAkB,CAAC,EACvC,uBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAsB,CAAC,CACxD,CAAC;IACN,CAAC;IAED,YACoB,IAAU,EACV,QAAkB,EAClB,QAA4B;QAE5C,KAAK,EAAE,CAAC;QAJQ,SAAI,GAAJ,IAAI,CAAM;QACV,aAAQ,GAAR,QAAQ,CAAU;QAClB,aAAQ,GAAR,QAAQ,CAAoB;QAG5C,IAAA,mBAAM,EAAC,eAAe,EAAE,IAAI,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QAC3C,IAAA,mBAAM,EAAC,mBAAmB,EAAE,QAAQ,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QACnD,IAAA,mBAAM,EAAC,mBAAmB,EAAE,QAAQ,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;IACvD,CAAC;CACJ;AAnBD,0CAmBC"}
@@ -3,15 +3,15 @@ import { UsesAbilities } from './abilities';
3
3
  import { PerformsActivities } from './activities';
4
4
  import { AnswersQuestions } from './questions';
5
5
  /**
6
- * Serenity/JS Screenplay Pattern `Activity` represents
7
- * a {@apilink Task} or an {@apilink Interaction} to be performed by an {@apilink Actor}.
6
+ * **Activities** represents {@apilink Task|tasks} and {@apilink Interaction|interactions} to be performed by an {@apilink Actor|actor}.
8
7
  *
9
- * ## Learn more
8
+ * Learn more about:
9
+ * - [Performing activities at multiple levels](/handbook/design/screenplay-pattern#performing-activities-at-multiple-levels)
10
10
  * - {@apilink Actor}
11
11
  * - {@apilink PerformsActivities}
12
12
  * - [Command design pattern on Wikipedia](https://en.wikipedia.org/wiki/Command_pattern)
13
13
  *
14
- * @group Activities
14
+ * @group Screenplay Pattern
15
15
  */
16
16
  export declare abstract class Activity {
17
17
  #private;
@@ -20,15 +20,15 @@ const path_1 = __importDefault(require("path"));
20
20
  const errors_1 = require("../errors");
21
21
  const io_1 = require("../io");
22
22
  /**
23
- * Serenity/JS Screenplay Pattern `Activity` represents
24
- * a {@apilink Task} or an {@apilink Interaction} to be performed by an {@apilink Actor}.
23
+ * **Activities** represents {@apilink Task|tasks} and {@apilink Interaction|interactions} to be performed by an {@apilink Actor|actor}.
25
24
  *
26
- * ## Learn more
25
+ * Learn more about:
26
+ * - [Performing activities at multiple levels](/handbook/design/screenplay-pattern#performing-activities-at-multiple-levels)
27
27
  * - {@apilink Actor}
28
28
  * - {@apilink PerformsActivities}
29
29
  * - [Command design pattern on Wikipedia](https://en.wikipedia.org/wiki/Command_pattern)
30
30
  *
31
- * @group Activities
31
+ * @group Screenplay Pattern
32
32
  */
33
33
  class Activity {
34
34
  constructor(description, location = Activity.callerLocation(5)) {
@@ -7,15 +7,63 @@ import { Activity } from './Activity';
7
7
  import { CollectsArtifacts } from './artifacts';
8
8
  import { AnswersQuestions } from './questions';
9
9
  /**
10
- * Core element of the Screenplay Pattern,
11
- * an {@apilink Actor} represents a user or an external system interacting with the system under test.
10
+ * **Actors** represent **people** and **external systems** interacting with the system under test.
11
+ * Their role is to perform {@apilink Activity|activities} that demonstrate how to accomplish a given goal.
12
12
  *
13
- * ## Learn more
13
+ * Actors are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
14
+ * along with {@apilink Ability|Abilities}, {@apilink Interaction|Interactions}, {@apilink Task|Tasks}, and {@apilink Question|Questions}.
15
+ * Actors are also the first thing you see in a typical Serenity/JS test scenario.
14
16
  *
17
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
18
+ *
19
+ * Learn more about:
15
20
  * - {@apilink Cast}
16
21
  * - {@apilink Stage}
22
+ * - {@apilink Ability|Abilities}
23
+ * - {@apilink Activity|Activities}
24
+ * - {@apilink Interaction|Interactions}
25
+ * - {@apilink Task|Tasks}
26
+ * - {@apilink Question|Questions}
27
+ *
28
+ * ## Representing people and systems as actors
29
+ *
30
+ * To use a Serenity/JS {@apilink Actor}, all you need is to say their name:
31
+ *
32
+ * ```typescript
33
+ * import { actorCalled } from '@serenity-js/core'
34
+ *
35
+ * actorCalled('Alice')
36
+ * // returns: Actor
37
+ * ```
38
+ *
39
+ * Serenity/JS actors perform within the scope of a test scenario, so the first time you invoke {@apilink actorCalled},
40
+ * Serenity/JS instantiates a new actor from the default {@apilink Cast} of actors (or any custom cast you might have {@apilink configured|configured}).
41
+ * Any subsequent invocations of this function within the scope of the same test scenario retrieve the already instantiated actor, identified by their name.
42
+ *
43
+ * ```typescript
44
+ * import { actorCalled } from '@serenity-js/core'
45
+ *
46
+ * actorCalled('Alice') // instantiates Alice
47
+ * actorCalled('Bob') // instantiates Bob
48
+ * actorCalled('Alice') // retrieves Alice, since she's already been instantiated
49
+ * ```
50
+ *
51
+ * Serenity/JS scenarios can involve as many or as few actors as you need to model the given business workflow.
52
+ * For example, you might want to use **multiple actors** in test scenarios that model how **different people** perform different parts of a larger business process, such as reviewing and approving a loan application.
53
+ * It is also quite common to introduce **supporting actors** to perform **administrative tasks**, like setting up test data and environment, or **audit tasks**, like checking the logs or messages emitted to a message queue
54
+ * by the system under test.
55
+ *
56
+ * :::info The Stan Lee naming convention
57
+ * Actor names can be much more than just simple identifiers like `Alice` or `Bob`. While you can give your actors any names you like, a good convention to follow is to give them
58
+ * names indicating the [personae](https://articles.uie.com/goodwin_interview/) they represent or the role they play in the system.
59
+ *
60
+ * Just like the characters in [Stan Lee](https://en.wikipedia.org/wiki/Stan_Lee) graphic novels,
61
+ * actors in Serenity/JS test scenarios are often given alliterate names as a mnemonic device.
62
+ * Names like "Adam the Admin", "Edna the Editor", "Trevor the Traveller", are far more memorable than a generic "UI user" or "API user".
63
+ * They're also much easier for people to associate with the context, constraints, and affordances of the given actor.
64
+ * :::
17
65
  *
18
- * @group Actors
66
+ * @group Screenplay Pattern
19
67
  */
20
68
  export declare class Actor implements PerformsActivities, UsesAbilities, CanHaveAbilities<Actor>, AnswersQuestions, CollectsArtifacts {
21
69
  readonly name: string;
@@ -1 +1 @@
1
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