@serenity-js/core 3.0.0-rc.42 → 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 (59) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +6 -1
  3. package/lib/errors/ErrorOptions.d.ts +3 -0
  4. package/lib/errors/ErrorOptions.d.ts.map +1 -1
  5. package/lib/instance.d.ts +48 -4
  6. package/lib/instance.d.ts.map +1 -1
  7. package/lib/instance.js +48 -4
  8. package/lib/instance.js.map +1 -1
  9. package/lib/screenplay/Activity.d.ts +4 -4
  10. package/lib/screenplay/Activity.js +4 -4
  11. package/lib/screenplay/Actor.d.ts +52 -4
  12. package/lib/screenplay/Actor.d.ts.map +1 -1
  13. package/lib/screenplay/Actor.js +52 -4
  14. package/lib/screenplay/Actor.js.map +1 -1
  15. package/lib/screenplay/Interaction.d.ts +27 -6
  16. package/lib/screenplay/Interaction.d.ts.map +1 -1
  17. package/lib/screenplay/Interaction.js +27 -6
  18. package/lib/screenplay/Interaction.js.map +1 -1
  19. package/lib/screenplay/Question.d.ts +14 -11
  20. package/lib/screenplay/Question.d.ts.map +1 -1
  21. package/lib/screenplay/Question.js +14 -11
  22. package/lib/screenplay/Question.js.map +1 -1
  23. package/lib/screenplay/Task.d.ts +128 -12
  24. package/lib/screenplay/Task.d.ts.map +1 -1
  25. package/lib/screenplay/Task.js +128 -12
  26. package/lib/screenplay/Task.js.map +1 -1
  27. package/lib/screenplay/abilities/Ability.d.ts +241 -7
  28. package/lib/screenplay/abilities/Ability.d.ts.map +1 -1
  29. package/lib/screenplay/abilities/Ability.js +241 -7
  30. package/lib/screenplay/abilities/Ability.js.map +1 -1
  31. package/lib/screenplay/interactions/Log.d.ts +1 -1
  32. package/lib/screenplay/interactions/Log.js +1 -1
  33. package/lib/screenplay/interactions/Wait.d.ts +2 -2
  34. package/lib/screenplay/interactions/Wait.js +2 -2
  35. package/lib/screenplay/interactions/debug/Debug.d.ts +1 -1
  36. package/lib/screenplay/interactions/debug/Debug.js +1 -1
  37. package/lib/screenplay/notes/TakeNotes.d.ts +1 -1
  38. package/lib/screenplay/notes/TakeNotes.js +1 -1
  39. package/lib/screenplay/questions/Check.d.ts +1 -1
  40. package/lib/screenplay/questions/Check.js +1 -1
  41. package/lib/stage/Cast.d.ts +97 -22
  42. package/lib/stage/Cast.d.ts.map +1 -1
  43. package/lib/stage/Cast.js +105 -24
  44. package/lib/stage/Cast.js.map +1 -1
  45. package/package.json +2 -2
  46. package/src/errors/ErrorOptions.ts +3 -0
  47. package/src/instance.ts +48 -4
  48. package/src/screenplay/Activity.ts +4 -4
  49. package/src/screenplay/Actor.ts +52 -4
  50. package/src/screenplay/Interaction.ts +27 -6
  51. package/src/screenplay/Question.ts +14 -11
  52. package/src/screenplay/Task.ts +128 -12
  53. package/src/screenplay/abilities/Ability.ts +241 -7
  54. package/src/screenplay/interactions/Log.ts +1 -1
  55. package/src/screenplay/interactions/Wait.ts +2 -2
  56. package/src/screenplay/interactions/debug/Debug.ts +1 -1
  57. package/src/screenplay/notes/TakeNotes.ts +1 -1
  58. package/src/screenplay/questions/Check.ts +1 -1
  59. package/src/stage/Cast.ts +106 -24
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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
+
6
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)
7
18
 
8
19
 
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
 
@@ -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"}
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"}
@@ -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
- {"version":3,"file":"Actor.d.ts","sourceRoot":"","sources":["../../src/screenplay/Actor.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,QAAQ,EAMR,IAAI,EAEP,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAA2C,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,qBAAa,KAAM,YACf,kBAAkB,EAClB,aAAa,EACb,gBAAgB,CAAC,KAAK,CAAC,EACvB,gBAAgB,EAChB,iBAAiB;aAGG,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAFV,IAAI,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,SAAS,GAAE,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAA4C;IAI7G;;;;;;;;;;OAUG;IACH,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAqB5D;;;;;;OAMG;IACH,UAAU,CAAC,GAAG,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAcpD;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK;IAMtC;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AM;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAFV,IAAI,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,SAAS,GAAE,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAA4C;IAI7G;;;;;;;;;;OAUG;IACH,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;IAqB5D;;;;;;OAMG;IACH,UAAU,CAAC,GAAG,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAcpD;;;;;;;;;;;;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;IAoBhD;;;;;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"}
@@ -10,15 +10,63 @@ const screenplay_1 = require("../screenplay");
10
10
  const Activity_1 = require("./Activity");
11
11
  const Question_1 = require("./Question");
12
12
  /**
13
- * Core element of the Screenplay Pattern,
14
- * an {@apilink Actor} represents a user or an external system interacting with the system under test.
13
+ * **Actors** represent **people** and **external systems** interacting with the system under test.
14
+ * Their role is to perform {@apilink Activity|activities} that demonstrate how to accomplish a given goal.
15
15
  *
16
- * ## Learn more
16
+ * Actors are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
17
+ * along with {@apilink Ability|Abilities}, {@apilink Interaction|Interactions}, {@apilink Task|Tasks}, and {@apilink Question|Questions}.
18
+ * Actors are also the first thing you see in a typical Serenity/JS test scenario.
17
19
  *
20
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
21
+ *
22
+ * Learn more about:
18
23
  * - {@apilink Cast}
19
24
  * - {@apilink Stage}
25
+ * - {@apilink Ability|Abilities}
26
+ * - {@apilink Activity|Activities}
27
+ * - {@apilink Interaction|Interactions}
28
+ * - {@apilink Task|Tasks}
29
+ * - {@apilink Question|Questions}
30
+ *
31
+ * ## Representing people and systems as actors
32
+ *
33
+ * To use a Serenity/JS {@apilink Actor}, all you need is to say their name:
34
+ *
35
+ * ```typescript
36
+ * import { actorCalled } from '@serenity-js/core'
37
+ *
38
+ * actorCalled('Alice')
39
+ * // returns: Actor
40
+ * ```
41
+ *
42
+ * Serenity/JS actors perform within the scope of a test scenario, so the first time you invoke {@apilink actorCalled},
43
+ * Serenity/JS instantiates a new actor from the default {@apilink Cast} of actors (or any custom cast you might have {@apilink configured|configured}).
44
+ * Any subsequent invocations of this function within the scope of the same test scenario retrieve the already instantiated actor, identified by their name.
45
+ *
46
+ * ```typescript
47
+ * import { actorCalled } from '@serenity-js/core'
48
+ *
49
+ * actorCalled('Alice') // instantiates Alice
50
+ * actorCalled('Bob') // instantiates Bob
51
+ * actorCalled('Alice') // retrieves Alice, since she's already been instantiated
52
+ * ```
53
+ *
54
+ * Serenity/JS scenarios can involve as many or as few actors as you need to model the given business workflow.
55
+ * 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.
56
+ * 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
57
+ * by the system under test.
58
+ *
59
+ * :::info The Stan Lee naming convention
60
+ * 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
61
+ * names indicating the [personae](https://articles.uie.com/goodwin_interview/) they represent or the role they play in the system.
62
+ *
63
+ * Just like the characters in [Stan Lee](https://en.wikipedia.org/wiki/Stan_Lee) graphic novels,
64
+ * actors in Serenity/JS test scenarios are often given alliterate names as a mnemonic device.
65
+ * Names like "Adam the Admin", "Edna the Editor", "Trevor the Traveller", are far more memorable than a generic "UI user" or "API user".
66
+ * They're also much easier for people to associate with the context, constraints, and affordances of the given actor.
67
+ * :::
20
68
  *
21
- * @group Actors
69
+ * @group Screenplay Pattern
22
70
  */
23
71
  class Actor {
24
72
  constructor(name, stage, abilities = new Map()) {
@@ -1 +1 @@
1
- {"version":3,"file":"Actor.js","sourceRoot":"","sources":["../../src/screenplay/Actor.ts"],"names":[],"mappings":";;;AAAA,2CAAmC;AAEnC,sCAAiH;AACjH,sCAA+H;AAC/H,8BAA+B;AAC/B,oCAUkB;AAClB,8CAA0G;AAI1G,yCAAsC;AAEtC,yCAAsC;AAGtC;;;;;;;;;;GAUG;AACH,MAAa,KAAK;IAOd,YACoB,IAAY,EACX,KAAY,EACZ,YAAgD,IAAI,GAAG,EAAiC;QAFzF,SAAI,GAAJ,IAAI,CAAQ;QACX,UAAK,GAAL,KAAK,CAAO;QACZ,cAAS,GAAT,SAAS,CAA+E;IAE7G,CAAC;IAED;;;;;;;;;;OAUG;IACH,SAAS,CAAoB,WAA2B;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QAE9C,IAAI,CAAE,KAAK,EAAE;YACT,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,EAAE;gBACzB,MAAM,IAAI,2BAAkB,CACxB,GAAI,IAAI,CAAC,IAAK,QAAS,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,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cAAc,EAAE,CAAC"}
@@ -3,13 +3,34 @@ import { Activity } from './Activity';
3
3
  import { CollectsArtifacts } from './artifacts';
4
4
  import { AnswersQuestions } from './questions';
5
5
  /**
6
- * Serenity/JS Screenplay Pattern `Interaction` is a low-level {@apilink Activity|activity} that directly
7
- * uses the {@apilink Actor|actor's} {@apilink Ability|ability} to interact
8
- * with the system under test.
6
+ * **Interactions** are low-level {@apilink Activity|activities} that encapsulate
7
+ * a handful of instructions for an {@apilink Actor|actor} on how to use their {@apilink Ability|abilities}
8
+ * to perform an individual interaction with the given interface of the system under test.
9
9
  *
10
- * Use the factory method `Interaction.where(description, interactionFunction)` to define custom interactions.
10
+ * :::tip Tasks or interactions?
11
+ * Because of their low-level nature, interactions are named using the vocabulary of the [solution domain](https://blog.mattwynne.net/2013/01/17/the-problem-with-solutions/),
12
+ * and represent an individual interaction with the given interface, e.g. {@apilink Click}, {@apilink Enter}, or {@apilink Send}.
11
13
  *
12
- * ## Defining a custom interaction
14
+ * Interactions follow the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle) which means that they do _one thing and one thing only_.
15
+ * If you're considering implementing an "interaction" that performs more than one logical activity, e.g. checks if the button is visible and then clicks on it if is,
16
+ * consider using separate interactions for separate responsibilities and then composing them using a {@apilink Task|task}.
17
+ * :::
18
+ *
19
+ * Interactions are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
20
+ * along with {@apilink Actor|Actors}, {@apilink Ability|Abilities}, {@apilink Question|Questions}, and {@apilink Task|Tasks}.
21
+ *
22
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
23
+ *
24
+ * Learn more about:
25
+ * - {@apilink Actors|Actor}
26
+ * - {@apilink Ability|Abilities}
27
+ * - {@apilink Activity|Activities}
28
+ *
29
+ * ## Writing a custom interaction
30
+ *
31
+ * [Serenity/JS modules](/handbook/about/architecture) ship with dozens of interactions to help you compose your test scenarios.
32
+ * However, if you need to interact with a non-standard interface, or want to create a flavour of a given interaction that behaves slightly differently than the built-in version,
33
+ * you can easily create your own implementations using the {@apilink Interaction.where} factory method.
13
34
  *
14
35
  * ```ts
15
36
  * import { Actor, Interaction } from '@serenity-js/core'
@@ -42,7 +63,7 @@ import { AnswersQuestions } from './questions';
42
63
  * )
43
64
  * ```
44
65
  *
45
- * @group Activities
66
+ * @group Screenplay Pattern
46
67
  */
47
68
  export declare abstract class Interaction extends Activity {
48
69
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Interaction.d.ts","sourceRoot":"","sources":["../../src/screenplay/Interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,8BAAsB,WAAY,SAAQ,QAAQ;IAE9C;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CACR,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACnG,WAAW;IAId;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAC7E"}
1
+ {"version":3,"file":"Interaction.d.ts","sourceRoot":"","sources":["../../src/screenplay/Interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,8BAAsB,WAAY,SAAQ,QAAQ;IAE9C;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CACR,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACnG,WAAW;IAId;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAC7E"}
@@ -3,13 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Interaction = void 0;
4
4
  const Activity_1 = require("./Activity");
5
5
  /**
6
- * Serenity/JS Screenplay Pattern `Interaction` is a low-level {@apilink Activity|activity} that directly
7
- * uses the {@apilink Actor|actor's} {@apilink Ability|ability} to interact
8
- * with the system under test.
6
+ * **Interactions** are low-level {@apilink Activity|activities} that encapsulate
7
+ * a handful of instructions for an {@apilink Actor|actor} on how to use their {@apilink Ability|abilities}
8
+ * to perform an individual interaction with the given interface of the system under test.
9
9
  *
10
- * Use the factory method `Interaction.where(description, interactionFunction)` to define custom interactions.
10
+ * :::tip Tasks or interactions?
11
+ * Because of their low-level nature, interactions are named using the vocabulary of the [solution domain](https://blog.mattwynne.net/2013/01/17/the-problem-with-solutions/),
12
+ * and represent an individual interaction with the given interface, e.g. {@apilink Click}, {@apilink Enter}, or {@apilink Send}.
11
13
  *
12
- * ## Defining a custom interaction
14
+ * Interactions follow the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle) which means that they do _one thing and one thing only_.
15
+ * If you're considering implementing an "interaction" that performs more than one logical activity, e.g. checks if the button is visible and then clicks on it if is,
16
+ * consider using separate interactions for separate responsibilities and then composing them using a {@apilink Task|task}.
17
+ * :::
18
+ *
19
+ * Interactions are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
20
+ * along with {@apilink Actor|Actors}, {@apilink Ability|Abilities}, {@apilink Question|Questions}, and {@apilink Task|Tasks}.
21
+ *
22
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
23
+ *
24
+ * Learn more about:
25
+ * - {@apilink Actors|Actor}
26
+ * - {@apilink Ability|Abilities}
27
+ * - {@apilink Activity|Activities}
28
+ *
29
+ * ## Writing a custom interaction
30
+ *
31
+ * [Serenity/JS modules](/handbook/about/architecture) ship with dozens of interactions to help you compose your test scenarios.
32
+ * However, if you need to interact with a non-standard interface, or want to create a flavour of a given interaction that behaves slightly differently than the built-in version,
33
+ * you can easily create your own implementations using the {@apilink Interaction.where} factory method.
13
34
  *
14
35
  * ```ts
15
36
  * import { Actor, Interaction } from '@serenity-js/core'
@@ -42,7 +63,7 @@ const Activity_1 = require("./Activity");
42
63
  * )
43
64
  * ```
44
65
  *
45
- * @group Activities
66
+ * @group Screenplay Pattern
46
67
  */
47
68
  class Interaction extends Activity_1.Activity {
48
69
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Interaction.js","sourceRoot":"","sources":["../../src/screenplay/Interaction.ts"],"names":[],"mappings":";;;AACA,yCAAsC;AAItC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAsB,WAAY,SAAQ,mBAAQ;IAE9C;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CACR,WAAmB,EACnB,WAAkG;QAElG,OAAO,IAAI,+BAA+B,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;CAcJ;AA5BD,kCA4BC;AAED;;GAEG;AACH,MAAM,+BAAgC,SAAQ,WAAW;IACrD,YACI,WAAmB,EACF,WAAkG;QAEnH,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;QAFjC,gBAAW,GAAX,WAAW,CAAuF;IAGvH,CAAC;IAED,SAAS,CAAC,KAA2D;QACjE,IAAI;YACA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAChC;IACL,CAAC;CACJ"}
1
+ {"version":3,"file":"Interaction.js","sourceRoot":"","sources":["../../src/screenplay/Interaction.ts"],"names":[],"mappings":";;;AACA,yCAAsC;AAItC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAsB,WAAY,SAAQ,mBAAQ;IAE9C;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CACR,WAAmB,EACnB,WAAkG;QAElG,OAAO,IAAI,+BAA+B,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;CAcJ;AA5BD,kCA4BC;AAED;;GAEG;AACH,MAAM,+BAAgC,SAAQ,WAAW;IACrD,YACI,WAAmB,EACF,WAAkG;QAEnH,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;QAFjC,gBAAW,GAAX,WAAW,CAAuF;IAGvH,CAAC;IAED,SAAS,CAAC,KAA2D;QACjE,IAAI;YACA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAChC;IACL,CAAC;CACJ"}
@@ -8,8 +8,18 @@ import { AnswersQuestions } from './questions/AnswersQuestions';
8
8
  import { RecursivelyAnswered } from './RecursivelyAnswered';
9
9
  import { WithAnswerableProperties } from './WithAnswerableProperties';
10
10
  /**
11
- * Serenity/JS Screenplay Pattern `Question` describes how an {@apilink Actor}
12
- * should query the system under test or the test environment.
11
+ * **Questions** describe how {@apilink Actor|actors} should query the system under test or the test environment to retrieve some information.
12
+ *
13
+ * Questions are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
14
+ * along with {@apilink Actor|Actors}, {@apilink Ability|Abilities}, {@apilink Interaction|Interactions}, and {@apilink Task|Tasks}.
15
+ *
16
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
17
+ *
18
+ * Learn more about:
19
+ * - {@apilink Actor}
20
+ * - {@apilink Ability|Abilities}
21
+ * - {@apilink Interaction}
22
+ * - {@apilink QuestionAdapter}
13
23
  *
14
24
  * ## Implementing a basic custom Question
15
25
  *
@@ -27,7 +37,7 @@ import { WithAnswerableProperties } from './WithAnswerableProperties';
27
37
  * )
28
38
  * ```
29
39
  *
30
- * ## Implementing a Question using an Ability
40
+ * ## Implementing a Question that uses an Ability
31
41
  *
32
42
  * Just like the {@apilink Interaction|interactions}, a {@apilink Question}
33
43
  * also can use {@apilink Actor|actor's} {@apilink Ability|abilities}.
@@ -90,14 +100,7 @@ import { WithAnswerableProperties } from './WithAnswerableProperties';
90
100
  * );
91
101
  * ```
92
102
  *
93
- * ## Learn more
94
- *
95
- * - {@apilink Actor}
96
- * - {@apilink Interaction}
97
- * - {@apilink Ability}
98
- * - {@apilink QuestionAdapter}
99
- *
100
- * @group Questions
103
+ * @group Screenplay Pattern
101
104
  */
102
105
  export declare abstract class Question<T> {
103
106
  /**