@serenity-js/core 3.0.0-rc.10 → 3.0.0-rc.13
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 +304 -0
- package/lib/io/ErrorStackParser.d.ts +2 -2
- package/lib/io/ErrorStackParser.js.map +1 -1
- package/lib/screenplay/actor/Actor.d.ts +19 -6
- package/lib/screenplay/actor/Actor.js +21 -8
- package/lib/screenplay/actor/Actor.js.map +1 -1
- package/lib/screenplay/actor/AnswersQuestions.d.ts +8 -1
- package/lib/screenplay/actor/CanHaveAbilities.d.ts +6 -4
- package/lib/screenplay/actor/CollectsArtifacts.d.ts +6 -4
- package/lib/screenplay/actor/PerformsActivities.d.ts +10 -2
- package/lib/screenplay/actor/UsesAbilities.d.ts +4 -4
- package/lib/screenplay/questions/Expectation.js.map +1 -1
- package/package.json +13 -33
- package/src/io/ErrorStackParser.ts +2 -1
- package/src/screenplay/actor/Actor.ts +21 -8
- package/src/screenplay/actor/AnswersQuestions.ts +9 -1
- package/src/screenplay/actor/CanHaveAbilities.ts +6 -4
- package/src/screenplay/actor/CollectsArtifacts.ts +7 -4
- package/src/screenplay/actor/PerformsActivities.ts +11 -2
- package/src/screenplay/actor/UsesAbilities.ts +4 -4
- package/src/screenplay/questions/Expectation.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,286 @@
|
|
|
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.13](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.12...v3.0.0-rc.13) (2022-03-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.0.0-rc.12](https://github.com/serenity-js/serenity-js/compare/v2.33.2...v3.0.0-rc.12) (2022-02-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [3.0.0-rc.11](https://github.com/serenity-js/serenity-js/compare/v2.33.1...v3.0.0-rc.11) (2022-02-13)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **core:** updated dependency on error-stack-parser ([ea50285](https://github.com/serenity-js/serenity-js/commit/ea502855da40c2f95c893c75061ef6dcf12f669d))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* **web:** isVisible() works with Web elements in Shadow DOM ([cf84fb0](https://github.com/serenity-js/serenity-js/commit/cf84fb072a6b813338b68bb1dec3932ea8709e3e)), closes [#1085](https://github.com/serenity-js/serenity-js/issues/1085)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* **core:** ensure Question.about doesn't expose internal interfaces ([4bfb6bc](https://github.com/serenity-js/serenity-js/commit/4bfb6bca6af81d23ced551f63df5bc9f35d581df)), closes [#1106](https://github.com/serenity-js/serenity-js/issues/1106)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
|
|
55
|
+
* **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
|
|
56
|
+
* **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
* **assertions:** isPresent works with any Optional ([cea75dc](https://github.com/serenity-js/serenity-js/commit/cea75dc1c728e45e06a87aaf9c1573a237334285)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
62
|
+
* **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
|
|
63
|
+
* **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
64
|
+
* **core:** support for Optional chaining, expectation isPresent, refactored Expectations ([1841ee5](https://github.com/serenity-js/serenity-js/commit/1841ee5fc48cfa403ddc53358f75764d9a010c21)), closes [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Bug Fixes
|
|
76
|
+
|
|
77
|
+
* **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Bug Fixes
|
|
85
|
+
|
|
86
|
+
* **core:** you can now retrieve the .length property of an Array wrapped in an Adapter<Array> ([c36e210](https://github.com/serenity-js/serenity-js/commit/c36e210c024052b96ba47e9663c7098e269c5688))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
* **core:** refactored Mappable so that it's easier to implement filters ([176e0cd](https://github.com/serenity-js/serenity-js/commit/176e0cd0303d63271477b2b7a8e7b0572dda99a0)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
96
|
+
* **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
|
|
97
|
+
* **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
|
|
98
|
+
* **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Features
|
|
102
|
+
|
|
103
|
+
* **core:** forEach for List and PageElements ([4592fb7](https://github.com/serenity-js/serenity-js/commit/4592fb7e700bad17fd44d91bd9db169839802d01)), closes [#823](https://github.com/serenity-js/serenity-js/issues/823)
|
|
104
|
+
* **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
|
|
105
|
+
* **core:** new implementation of List.where filters ([45b3c80](https://github.com/serenity-js/serenity-js/commit/45b3c8080ca467ac6362e5217e7899ca36a04cdc)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
106
|
+
* **core:** support for Screenplay-style collection filters and mapping (List.where & .eachMappedTo) ([3d3c02e](https://github.com/serenity-js/serenity-js/commit/3d3c02ebe0ec5c6865f91f1991fd59ef0190a16c)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
107
|
+
* **web:** re-introduced PageElements.where DSL and universal By selectors ([39fe0a1](https://github.com/serenity-js/serenity-js/commit/39fe0a10edf7f652e93911159e4a4689c36d6876)), closes [#1081](https://github.com/serenity-js/serenity-js/issues/1081)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### Bug Fixes
|
|
119
|
+
|
|
120
|
+
* **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
|
|
121
|
+
* **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
|
|
122
|
+
* **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
123
|
+
* **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
|
|
124
|
+
* **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
|
|
125
|
+
* **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
|
|
126
|
+
* **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
|
|
127
|
+
* **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
|
|
128
|
+
* **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
|
|
129
|
+
* **core:** renamed "Model" type to "Adapter" to better reflect its purpose ([b4ea7a1](https://github.com/serenity-js/serenity-js/commit/b4ea7a100fac2c896990bf15cbc906de641196b8)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
130
|
+
* **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
|
|
131
|
+
* **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Features
|
|
135
|
+
|
|
136
|
+
* **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
|
|
137
|
+
* **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
|
|
138
|
+
* **web:** Page.url() and Page.title() replace Website.url() and Website.title() ([49fe009](https://github.com/serenity-js/serenity-js/commit/49fe0094422ab53ec67d4ba303f80c33e382eebd)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
139
|
+
* **web:** removed Target in favour of PageElement ([69496c4](https://github.com/serenity-js/serenity-js/commit/69496c47c4a1ec7b92e7ab6c83da1559e926f28e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
140
|
+
* **web:** support for working with cookies ([39cde6d](https://github.com/serenity-js/serenity-js/commit/39cde6de7a36d27a8b1c596493efbec94900af6b)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### BREAKING CHANGES
|
|
144
|
+
|
|
145
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
146
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
# [3.0.0-rc.11](https://github.com/serenity-js/serenity-js/compare/v2.33.1...v3.0.0-rc.11) (2022-02-13)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### Bug Fixes
|
|
156
|
+
|
|
157
|
+
* **core:** updated dependency on error-stack-parser ([ea50285](https://github.com/serenity-js/serenity-js/commit/ea502855da40c2f95c893c75061ef6dcf12f669d))
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
# [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
# [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### Features
|
|
169
|
+
|
|
170
|
+
* **web:** isVisible() works with Web elements in Shadow DOM ([cf84fb0](https://github.com/serenity-js/serenity-js/commit/cf84fb072a6b813338b68bb1dec3932ea8709e3e)), closes [#1085](https://github.com/serenity-js/serenity-js/issues/1085)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
# [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
### Bug Fixes
|
|
178
|
+
|
|
179
|
+
* **core:** ensure Question.about doesn't expose internal interfaces ([4bfb6bc](https://github.com/serenity-js/serenity-js/commit/4bfb6bca6af81d23ced551f63df5bc9f35d581df)), closes [#1106](https://github.com/serenity-js/serenity-js/issues/1106)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Bug Fixes
|
|
187
|
+
|
|
188
|
+
* **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
|
|
189
|
+
* **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
|
|
190
|
+
* **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
### Features
|
|
194
|
+
|
|
195
|
+
* **assertions:** isPresent works with any Optional ([cea75dc](https://github.com/serenity-js/serenity-js/commit/cea75dc1c728e45e06a87aaf9c1573a237334285)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
196
|
+
* **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
|
|
197
|
+
* **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
198
|
+
* **core:** support for Optional chaining, expectation isPresent, refactored Expectations ([1841ee5](https://github.com/serenity-js/serenity-js/commit/1841ee5fc48cfa403ddc53358f75764d9a010c21)), closes [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
# [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
### Bug Fixes
|
|
210
|
+
|
|
211
|
+
* **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
# [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
### Bug Fixes
|
|
219
|
+
|
|
220
|
+
* **core:** you can now retrieve the .length property of an Array wrapped in an Adapter<Array> ([c36e210](https://github.com/serenity-js/serenity-js/commit/c36e210c024052b96ba47e9663c7098e269c5688))
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
# [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
### Bug Fixes
|
|
228
|
+
|
|
229
|
+
* **core:** refactored Mappable so that it's easier to implement filters ([176e0cd](https://github.com/serenity-js/serenity-js/commit/176e0cd0303d63271477b2b7a8e7b0572dda99a0)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
230
|
+
* **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
|
|
231
|
+
* **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
|
|
232
|
+
* **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
### Features
|
|
236
|
+
|
|
237
|
+
* **core:** forEach for List and PageElements ([4592fb7](https://github.com/serenity-js/serenity-js/commit/4592fb7e700bad17fd44d91bd9db169839802d01)), closes [#823](https://github.com/serenity-js/serenity-js/issues/823)
|
|
238
|
+
* **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
|
|
239
|
+
* **core:** new implementation of List.where filters ([45b3c80](https://github.com/serenity-js/serenity-js/commit/45b3c8080ca467ac6362e5217e7899ca36a04cdc)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
240
|
+
* **core:** support for Screenplay-style collection filters and mapping (List.where & .eachMappedTo) ([3d3c02e](https://github.com/serenity-js/serenity-js/commit/3d3c02ebe0ec5c6865f91f1991fd59ef0190a16c)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
241
|
+
* **web:** re-introduced PageElements.where DSL and universal By selectors ([39fe0a1](https://github.com/serenity-js/serenity-js/commit/39fe0a10edf7f652e93911159e4a4689c36d6876)), closes [#1081](https://github.com/serenity-js/serenity-js/issues/1081)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
# [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
### Bug Fixes
|
|
253
|
+
|
|
254
|
+
* **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
|
|
255
|
+
* **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
|
|
256
|
+
* **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
257
|
+
* **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
|
|
258
|
+
* **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
|
|
259
|
+
* **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
|
|
260
|
+
* **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
|
|
261
|
+
* **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
|
|
262
|
+
* **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
|
|
263
|
+
* **core:** renamed "Model" type to "Adapter" to better reflect its purpose ([b4ea7a1](https://github.com/serenity-js/serenity-js/commit/b4ea7a100fac2c896990bf15cbc906de641196b8)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
264
|
+
* **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
|
|
265
|
+
* **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
### Features
|
|
269
|
+
|
|
270
|
+
* **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
|
|
271
|
+
* **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
|
|
272
|
+
* **web:** Page.url() and Page.title() replace Website.url() and Website.title() ([49fe009](https://github.com/serenity-js/serenity-js/commit/49fe0094422ab53ec67d4ba303f80c33e382eebd)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
273
|
+
* **web:** removed Target in favour of PageElement ([69496c4](https://github.com/serenity-js/serenity-js/commit/69496c47c4a1ec7b92e7ab6c83da1559e926f28e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
274
|
+
* **web:** support for working with cookies ([39cde6d](https://github.com/serenity-js/serenity-js/commit/39cde6de7a36d27a8b1c596493efbec94900af6b)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
### BREAKING CHANGES
|
|
278
|
+
|
|
279
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
280
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
6
286
|
# [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
7
287
|
|
|
8
288
|
|
|
@@ -345,6 +625,30 @@ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped su
|
|
|
345
625
|
|
|
346
626
|
|
|
347
627
|
|
|
628
|
+
## [2.33.2](https://github.com/serenity-js/serenity-js/compare/v2.33.1...v2.33.2) (2022-02-23)
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
### Bug Fixes
|
|
632
|
+
|
|
633
|
+
* **core:** updated error-stack-parser ([d81a8ce](https://github.com/serenity-js/serenity-js/commit/d81a8ce3ae92d3a266f67b1e5118ca947eec0db4))
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
## [2.33.1](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v2.33.1) (2022-02-10)
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
### Bug Fixes
|
|
643
|
+
|
|
644
|
+
* **deps:** update dependency fast-glob to ^3.2.11 ([b980fb1](https://github.com/serenity-js/serenity-js/commit/b980fb10374086f679b7b3584810a74ac5988299))
|
|
645
|
+
* **deps:** update dependency graceful-fs to ^4.2.9 ([c1228bc](https://github.com/serenity-js/serenity-js/commit/c1228bc8b79a0d1a1dbda6906240442ef40f6543))
|
|
646
|
+
* **deps:** update dependency tiny-types to ^1.17.0 ([7b7d6fd](https://github.com/serenity-js/serenity-js/commit/7b7d6fda08f5db7199d8608ff4cf1389a6e84d3c))
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
348
652
|
# [2.33.0](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v2.33.0) (2022-02-03)
|
|
349
653
|
|
|
350
654
|
**Note:** Version bump only for package @serenity-js/core
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import StackFrame = require('stackframe');
|
|
2
2
|
/**
|
|
3
3
|
* @desc
|
|
4
4
|
* A thin wrapper around error-stack-parser module
|
|
@@ -8,5 +8,5 @@ import * as parser from 'error-stack-parser';
|
|
|
8
8
|
* @package
|
|
9
9
|
*/
|
|
10
10
|
export declare class ErrorStackParser {
|
|
11
|
-
parse(error: Error):
|
|
11
|
+
parse(error: Error): StackFrame[];
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorStackParser.js","sourceRoot":"","sources":["../../src/io/ErrorStackParser.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;
|
|
1
|
+
{"version":3,"file":"ErrorStackParser.js","sourceRoot":"","sources":["../../src/io/ErrorStackParser.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAG7C;;;;;;;GAOG;AACH,MAAa,gBAAgB;IACzB,KAAK,CAAC,KAAY;QACd,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACJ;AAJD,4CAIC"}
|
|
@@ -7,6 +7,17 @@ import { CanHaveAbilities } from './CanHaveAbilities';
|
|
|
7
7
|
import { CollectsArtifacts } from './CollectsArtifacts';
|
|
8
8
|
import { PerformsActivities } from './PerformsActivities';
|
|
9
9
|
import { UsesAbilities } from './UsesAbilities';
|
|
10
|
+
/**
|
|
11
|
+
* @desc
|
|
12
|
+
* Core element of the [Screenplay Pattern](/handbook/design/screenplay-pattern.html),
|
|
13
|
+
* an {@link Actor} represents a user or an external system interacting with the system under test.
|
|
14
|
+
*
|
|
15
|
+
* @implements {PerformsActivities}
|
|
16
|
+
* @implements {UsesAbilities}
|
|
17
|
+
* @implements {CanHaveAbilities}
|
|
18
|
+
* @implements {AnswersQuestions}
|
|
19
|
+
* @implements {CollectsArtifacts}
|
|
20
|
+
*/
|
|
10
21
|
export declare class Actor implements PerformsActivities, UsesAbilities, CanHaveAbilities<Actor>, AnswersQuestions, CollectsArtifacts {
|
|
11
22
|
readonly name: string;
|
|
12
23
|
private readonly stage;
|
|
@@ -14,15 +25,17 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
14
25
|
constructor(name: string, stage: Stage, abilities?: Map<AbilityType<Ability>, Ability>);
|
|
15
26
|
/**
|
|
16
27
|
* @desc
|
|
17
|
-
* Retrieves actor's {@link Ability}
|
|
28
|
+
* Retrieves actor's {@link Ability} of `abilityType`, or one that extends `abilityType`.
|
|
18
29
|
*
|
|
19
|
-
* Please note that this method performs an
|
|
20
|
-
*
|
|
21
|
-
* the same check when abilities are assigned to the actor
|
|
30
|
+
* Please note that this method performs an {@link instanceof} check against abilities
|
|
31
|
+
* given to this actor via {@link Actor#whoCan}.
|
|
32
|
+
* Please also note that {@link Actor#whoCan} performs the same check when abilities are assigned to the actor
|
|
33
|
+
* to ensure the actor has at most one instance of a given ability type.
|
|
22
34
|
*
|
|
23
|
-
* @param
|
|
35
|
+
* @param {AbilityType<T>} abilityType
|
|
36
|
+
* @returns {T}
|
|
24
37
|
*/
|
|
25
|
-
abilityTo<T extends Ability>(
|
|
38
|
+
abilityTo<T extends Ability>(abilityType: AbilityType<T>): T;
|
|
26
39
|
/**
|
|
27
40
|
* @desc
|
|
28
41
|
* Instructs the actor to attempt to perform a number of activities
|
|
@@ -6,6 +6,17 @@ const events_1 = require("../../events");
|
|
|
6
6
|
const model_1 = require("../../model");
|
|
7
7
|
const activities_1 = require("../activities");
|
|
8
8
|
const Question_1 = require("../Question");
|
|
9
|
+
/**
|
|
10
|
+
* @desc
|
|
11
|
+
* Core element of the [Screenplay Pattern](/handbook/design/screenplay-pattern.html),
|
|
12
|
+
* an {@link Actor} represents a user or an external system interacting with the system under test.
|
|
13
|
+
*
|
|
14
|
+
* @implements {PerformsActivities}
|
|
15
|
+
* @implements {UsesAbilities}
|
|
16
|
+
* @implements {CanHaveAbilities}
|
|
17
|
+
* @implements {AnswersQuestions}
|
|
18
|
+
* @implements {CollectsArtifacts}
|
|
19
|
+
*/
|
|
9
20
|
class Actor {
|
|
10
21
|
// todo: Actor should have execution strategies
|
|
11
22
|
// todo: the default one executes every activity
|
|
@@ -17,18 +28,20 @@ class Actor {
|
|
|
17
28
|
}
|
|
18
29
|
/**
|
|
19
30
|
* @desc
|
|
20
|
-
* Retrieves actor's {@link Ability}
|
|
31
|
+
* Retrieves actor's {@link Ability} of `abilityType`, or one that extends `abilityType`.
|
|
21
32
|
*
|
|
22
|
-
* Please note that this method performs an
|
|
23
|
-
*
|
|
24
|
-
* the same check when abilities are assigned to the actor
|
|
33
|
+
* Please note that this method performs an {@link instanceof} check against abilities
|
|
34
|
+
* given to this actor via {@link Actor#whoCan}.
|
|
35
|
+
* Please also note that {@link Actor#whoCan} performs the same check when abilities are assigned to the actor
|
|
36
|
+
* to ensure the actor has at most one instance of a given ability type.
|
|
25
37
|
*
|
|
26
|
-
* @param
|
|
38
|
+
* @param {AbilityType<T>} abilityType
|
|
39
|
+
* @returns {T}
|
|
27
40
|
*/
|
|
28
|
-
abilityTo(
|
|
29
|
-
const found = this.findAbilityTo(
|
|
41
|
+
abilityTo(abilityType) {
|
|
42
|
+
const found = this.findAbilityTo(abilityType);
|
|
30
43
|
if (!found) {
|
|
31
|
-
throw new errors_1.ConfigurationError(`${this.name} can't ${
|
|
44
|
+
throw new errors_1.ConfigurationError(`${this.name} can't ${abilityType.name} yet. ` +
|
|
32
45
|
`Did you give them the ability to do so?`);
|
|
33
46
|
}
|
|
34
47
|
return found;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actor.js","sourceRoot":"","sources":["../../../src/screenplay/actor/Actor.ts"],"names":[],"mappings":";;;AAAA,yCAAwE;AACxE,yCAAgE;AAChE,uCAA6C;AAG7C,8CAAgD;AAEhD,0CAAuC;AAOvC,MAAa,KAAK;IAOd,+CAA+C;IAC/C,gDAAgD;IAChD,oEAAoE;IAEpE,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
|
|
1
|
+
{"version":3,"file":"Actor.js","sourceRoot":"","sources":["../../../src/screenplay/actor/Actor.ts"],"names":[],"mappings":";;;AAAA,yCAAwE;AACxE,yCAAgE;AAChE,uCAA6C;AAG7C,8CAAgD;AAEhD,0CAAuC;AAOvC;;;;;;;;;;GAUG;AACH,MAAa,KAAK;IAOd,+CAA+C;IAC/C,gDAAgD;IAChD,oEAAoE;IAEpE,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;;;;;;;;;;;OAWG;IACH,SAAS,CAAoB,WAA2B;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QAE9C,IAAI,CAAE,KAAK,EAAE;YACT,MAAM,IAAI,2BAAkB,CAAC,GAAI,IAAI,CAAC,IAAK,UAAW,WAAW,CAAC,IAAK,QAAQ;gBAC3E,yCAAyC,CAAC,CAAC;SAClD;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;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,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC;QAEhF,OAAO,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC;aAC/B,MAAM,CAAC,2BAA2B,CAAuB,CAAC;IACnE,CAAC;IAED;;;OAGG;IACK,aAAa,CAAoB,WAA2B;QAChE,KAAK,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClD,IAAI,OAAO,YAAY,WAAW,EAAE;gBAChC,OAAO,OAAY,CAAC;aACvB;SACJ;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAED;;;;;;;;;OASG;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;AAtOD,sBAsOC"}
|
|
@@ -6,5 +6,12 @@ import { Answerable } from '../Answerable';
|
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export interface AnswersQuestions {
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @desc
|
|
11
|
+
* Makes the {@link Actor} evaluate an {@link Answerable}
|
|
12
|
+
* and return the value it holds.
|
|
13
|
+
*
|
|
14
|
+
* @type {function<T>>(answerable: Answerable<T>): Promise<T>}
|
|
15
|
+
*/
|
|
16
|
+
answer: <T>(answerable: Answerable<T>) => Promise<T>;
|
|
10
17
|
}
|
|
@@ -2,14 +2,16 @@ import { Ability } from '../Ability';
|
|
|
2
2
|
import { UsesAbilities } from './UsesAbilities';
|
|
3
3
|
/**
|
|
4
4
|
* @desc
|
|
5
|
-
* Enables the {@link Actor} to have an {@link Ability} or
|
|
5
|
+
* Enables the {@link Actor} to have an {@link Ability} or abilities to perform some {@link Activity}.
|
|
6
6
|
*
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
9
|
export interface CanHaveAbilities<Returned_Type = UsesAbilities> {
|
|
10
10
|
/**
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
11
|
+
* @desc
|
|
12
|
+
* Assigns an {@link Ability} or several abilities to the {@link Actor}
|
|
13
|
+
*
|
|
14
|
+
* @type {function(...abilities: Ability[]): Returned_Type}
|
|
13
15
|
*/
|
|
14
|
-
whoCan(...abilities: Ability[])
|
|
16
|
+
whoCan: (...abilities: Ability[]) => Returned_Type;
|
|
15
17
|
}
|
|
@@ -8,10 +8,12 @@ import { Artifact, Name } from '../../model';
|
|
|
8
8
|
export interface CollectsArtifacts {
|
|
9
9
|
/**
|
|
10
10
|
* @desc
|
|
11
|
-
*
|
|
11
|
+
* Makes the {@link Actor} collect an {@link Artifact} so that it can be included in the test report.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
14
|
-
*
|
|
13
|
+
* @type {function(artifact: Artifact, name?: Name): void}
|
|
14
|
+
*
|
|
15
|
+
* @see {@link Artifact} - The artifact to be collected, such as {@link JSONData}
|
|
16
|
+
* @see {@link Name} - The name of the artifact to make it easy to recognise in the test report
|
|
15
17
|
*/
|
|
16
|
-
collect(artifact: Artifact, name?: Name)
|
|
18
|
+
collect: (artifact: Artifact, name?: Name) => void;
|
|
17
19
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { Activity } from '../Activity';
|
|
2
2
|
/**
|
|
3
3
|
* @desc
|
|
4
|
-
* Enables the {@link Actor} to perform an {@link Activity},
|
|
4
|
+
* Enables the {@link Actor} to perform an {@link Activity},
|
|
5
|
+
* such as a {@link Task} or an {@link Interaction}
|
|
5
6
|
*
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
9
|
export interface PerformsActivities {
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @desc
|
|
12
|
+
* Makes the {@link Actor} attempt to perform a sequence of activities.
|
|
13
|
+
*
|
|
14
|
+
* @type {function(...activities: Activity[]): Promise<void>}
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
attemptsTo: (...activities: Activity[]) => Promise<void>;
|
|
10
18
|
}
|
|
@@ -9,10 +9,10 @@ import { AbilityType } from '../AbilityType';
|
|
|
9
9
|
export interface UsesAbilities {
|
|
10
10
|
/**
|
|
11
11
|
* @desc
|
|
12
|
-
*
|
|
12
|
+
* Provides access to the {@link Actor}'s {@link Ability} to do something
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
14
|
+
* @type {function<T extends Ability>(doSomething: AbilityType<T>): T}
|
|
15
|
+
* @public
|
|
16
16
|
*/
|
|
17
|
-
abilityTo<T extends Ability>(doSomething: AbilityType<T>)
|
|
17
|
+
abilityTo: <T extends Ability>(doSomething: AbilityType<T>) => T;
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expectation.js","sourceRoot":"","sources":["../../../src/screenplay/questions/Expectation.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,2BAAiH;
|
|
1
|
+
{"version":3,"file":"Expectation.js","sourceRoot":"","sources":["../../../src/screenplay/questions/Expectation.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,2BAAiH;AAWjH;;;;;;GAMG;AACH,MAAa,WAAW;IA0FpB,YACY,OAAe,EACN,SAA4B;QADrC,YAAO,GAAP,OAAO,CAAQ;QACN,cAAS,GAAT,SAAS,CAAmB;IAEjD,CAAC;IA5FD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,gBAAgB,CAAO,gBAAwB,EAAE,aAA6B;QAGjF,OAAO,CAAC;YACJ,MAAM,EAAE,CAAC,mBAAqF,EAAkB,EAAE;gBAC9G,MAAM,OAAO,GAAG,gBAAgB,GAAG,GAAG,GAAG,IAAA,MAAC,EAAA,GAAG,aAAa,EAAE,CAAC;gBAE7D,OAAO,IAAI,WAAW,CAClB,OAAO,EACP,KAAK,EAAE,KAAuB,EAAE,WAA0B,EAAqC,EAAE;oBAC7F,MAAM,QAA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D,kCA4GC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/core",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.13",
|
|
4
4
|
"description": "Serenity/JS Screenplay, reporting engine and core interfaces.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -29,19 +29,20 @@
|
|
|
29
29
|
"clean": "rimraf .nyc_output lib target",
|
|
30
30
|
"lint": "eslint --ext ts --config ../../.eslintrc.yml .",
|
|
31
31
|
"lint:fix": "npm run lint -- --fix",
|
|
32
|
-
"test": "nyc
|
|
32
|
+
"test": "nyc mocha --config ../../.mocharc.yml 'spec/**/*.spec.*'",
|
|
33
33
|
"compile": "tsc --project tsconfig.json",
|
|
34
34
|
"site": "esdoc -c .esdoc.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"cuid": "^2.1.8",
|
|
38
38
|
"diff": "^5.0.0",
|
|
39
|
-
"error-stack-parser": "^2.0.
|
|
40
|
-
"fast-glob": "^3.2.
|
|
39
|
+
"error-stack-parser": "^2.0.7",
|
|
40
|
+
"fast-glob": "^3.2.11",
|
|
41
41
|
"filenamify": "^4.3.0",
|
|
42
|
-
"graceful-fs": "^4.2.
|
|
42
|
+
"graceful-fs": "^4.2.9",
|
|
43
43
|
"moment": "^2.29.1",
|
|
44
44
|
"semver": "^7.3.5",
|
|
45
|
+
"stackframe": "^1.2.0",
|
|
45
46
|
"tiny-types": "^1.17.0",
|
|
46
47
|
"upath": "^2.0.1"
|
|
47
48
|
},
|
|
@@ -51,17 +52,18 @@
|
|
|
51
52
|
"@types/cuid": "^1.3.1",
|
|
52
53
|
"@types/diff": "^5.0.2",
|
|
53
54
|
"@types/filenamify": "^2.0.2",
|
|
54
|
-
"@types/mocha": "^9.
|
|
55
|
+
"@types/mocha": "^9.1.0",
|
|
55
56
|
"@types/semver": "^7.3.9",
|
|
56
57
|
"assertion-error-formatter": "^3.0.0",
|
|
57
58
|
"memfs": "^3.4.1",
|
|
58
|
-
"mocha": "^9.1
|
|
59
|
-
"ts-node": "^10.
|
|
60
|
-
"typescript": "^4.5.
|
|
59
|
+
"mocha": "^9.2.1",
|
|
60
|
+
"ts-node": "^10.5.0",
|
|
61
|
+
"typescript": "^4.5.5"
|
|
61
62
|
},
|
|
62
63
|
"repository": {
|
|
63
64
|
"type": "git",
|
|
64
|
-
"url": "https://github.com/serenity-js/serenity-js.git"
|
|
65
|
+
"url": "https://github.com/serenity-js/serenity-js.git",
|
|
66
|
+
"directory": "packages/core"
|
|
65
67
|
},
|
|
66
68
|
"bugs": {
|
|
67
69
|
"url": "https://github.com/serenity-js/serenity-js/issues"
|
|
@@ -70,27 +72,5 @@
|
|
|
70
72
|
"node": "^14 || ^16",
|
|
71
73
|
"npm": "^6 || ^7 || ^8"
|
|
72
74
|
},
|
|
73
|
-
"
|
|
74
|
-
"include": [
|
|
75
|
-
"src/**/*.ts"
|
|
76
|
-
],
|
|
77
|
-
"exclude": [
|
|
78
|
-
"src/**/*.d.ts",
|
|
79
|
-
"lib",
|
|
80
|
-
"spec",
|
|
81
|
-
"node_modules"
|
|
82
|
-
],
|
|
83
|
-
"extension": [
|
|
84
|
-
".ts"
|
|
85
|
-
],
|
|
86
|
-
"require": [
|
|
87
|
-
"ts-node/register"
|
|
88
|
-
],
|
|
89
|
-
"reporter": [
|
|
90
|
-
"json"
|
|
91
|
-
],
|
|
92
|
-
"cache": true,
|
|
93
|
-
"all": true
|
|
94
|
-
},
|
|
95
|
-
"gitHead": "7e8570d412348980c22a6e189ebc4c4f0157919d"
|
|
75
|
+
"gitHead": "9fb7df72c7f33cb10504843db890f7855b8c355a"
|
|
96
76
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as parser from 'error-stack-parser';
|
|
2
|
+
import StackFrame = require('stackframe');
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @desc
|
|
@@ -9,7 +10,7 @@ import * as parser from 'error-stack-parser';
|
|
|
9
10
|
* @package
|
|
10
11
|
*/
|
|
11
12
|
export class ErrorStackParser {
|
|
12
|
-
parse(error: Error):
|
|
13
|
+
parse(error: Error): StackFrame[] {
|
|
13
14
|
return parser.parse(error);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -12,6 +12,17 @@ import { CollectsArtifacts } from './CollectsArtifacts';
|
|
|
12
12
|
import { PerformsActivities } from './PerformsActivities';
|
|
13
13
|
import { UsesAbilities } from './UsesAbilities';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @desc
|
|
17
|
+
* Core element of the [Screenplay Pattern](/handbook/design/screenplay-pattern.html),
|
|
18
|
+
* an {@link Actor} represents a user or an external system interacting with the system under test.
|
|
19
|
+
*
|
|
20
|
+
* @implements {PerformsActivities}
|
|
21
|
+
* @implements {UsesAbilities}
|
|
22
|
+
* @implements {CanHaveAbilities}
|
|
23
|
+
* @implements {AnswersQuestions}
|
|
24
|
+
* @implements {CollectsArtifacts}
|
|
25
|
+
*/
|
|
15
26
|
export class Actor implements
|
|
16
27
|
PerformsActivities,
|
|
17
28
|
UsesAbilities,
|
|
@@ -32,19 +43,21 @@ export class Actor implements
|
|
|
32
43
|
|
|
33
44
|
/**
|
|
34
45
|
* @desc
|
|
35
|
-
* Retrieves actor's {@link Ability}
|
|
46
|
+
* Retrieves actor's {@link Ability} of `abilityType`, or one that extends `abilityType`.
|
|
36
47
|
*
|
|
37
|
-
* Please note that this method performs an
|
|
38
|
-
*
|
|
39
|
-
* the same check when abilities are assigned to the actor
|
|
48
|
+
* Please note that this method performs an {@link instanceof} check against abilities
|
|
49
|
+
* given to this actor via {@link Actor#whoCan}.
|
|
50
|
+
* Please also note that {@link Actor#whoCan} performs the same check when abilities are assigned to the actor
|
|
51
|
+
* to ensure the actor has at most one instance of a given ability type.
|
|
40
52
|
*
|
|
41
|
-
* @param
|
|
53
|
+
* @param {AbilityType<T>} abilityType
|
|
54
|
+
* @returns {T}
|
|
42
55
|
*/
|
|
43
|
-
abilityTo<T extends Ability>(
|
|
44
|
-
const found = this.findAbilityTo(
|
|
56
|
+
abilityTo<T extends Ability>(abilityType: AbilityType<T>): T {
|
|
57
|
+
const found = this.findAbilityTo(abilityType);
|
|
45
58
|
|
|
46
59
|
if (! found) {
|
|
47
|
-
throw new ConfigurationError(`${ this.name } can't ${
|
|
60
|
+
throw new ConfigurationError(`${ this.name } can't ${ abilityType.name } yet. ` +
|
|
48
61
|
`Did you give them the ability to do so?`);
|
|
49
62
|
}
|
|
50
63
|
|
|
@@ -7,5 +7,13 @@ import { Answerable } from '../Answerable';
|
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
9
|
export interface AnswersQuestions {
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @desc
|
|
13
|
+
* Makes the {@link Actor} evaluate an {@link Answerable}
|
|
14
|
+
* and return the value it holds.
|
|
15
|
+
*
|
|
16
|
+
* @type {function<T>>(answerable: Answerable<T>): Promise<T>}
|
|
17
|
+
*/
|
|
18
|
+
answer: <T>(answerable: Answerable<T>) => Promise<T>;
|
|
11
19
|
}
|
|
@@ -3,14 +3,16 @@ import { UsesAbilities } from './UsesAbilities';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @desc
|
|
6
|
-
* Enables the {@link Actor} to have an {@link Ability} or
|
|
6
|
+
* Enables the {@link Actor} to have an {@link Ability} or abilities to perform some {@link Activity}.
|
|
7
7
|
*
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
10
|
export interface CanHaveAbilities<Returned_Type = UsesAbilities> {
|
|
11
11
|
/**
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
12
|
+
* @desc
|
|
13
|
+
* Assigns an {@link Ability} or several abilities to the {@link Actor}
|
|
14
|
+
*
|
|
15
|
+
* @type {function(...abilities: Ability[]): Returned_Type}
|
|
14
16
|
*/
|
|
15
|
-
whoCan(...abilities: Ability[])
|
|
17
|
+
whoCan: (...abilities: Ability[]) => Returned_Type;
|
|
16
18
|
}
|
|
@@ -7,12 +7,15 @@ import { Artifact, Name } from '../../model';
|
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
9
|
export interface CollectsArtifacts {
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* @desc
|
|
12
|
-
*
|
|
13
|
+
* Makes the {@link Actor} collect an {@link Artifact} so that it can be included in the test report.
|
|
14
|
+
*
|
|
15
|
+
* @type {function(artifact: Artifact, name?: Name): void}
|
|
13
16
|
*
|
|
14
|
-
* @
|
|
15
|
-
* @
|
|
17
|
+
* @see {@link Artifact} - The artifact to be collected, such as {@link JSONData}
|
|
18
|
+
* @see {@link Name} - The name of the artifact to make it easy to recognise in the test report
|
|
16
19
|
*/
|
|
17
|
-
collect(artifact: Artifact, name?: Name)
|
|
20
|
+
collect: (artifact: Artifact, name?: Name) => void;
|
|
18
21
|
}
|
|
@@ -2,10 +2,19 @@ import { Activity } from '../Activity';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @desc
|
|
5
|
-
* Enables the {@link Actor} to perform an {@link Activity},
|
|
5
|
+
* Enables the {@link Actor} to perform an {@link Activity},
|
|
6
|
+
* such as a {@link Task} or an {@link Interaction}
|
|
6
7
|
*
|
|
7
8
|
* @public
|
|
8
9
|
*/
|
|
9
10
|
export interface PerformsActivities {
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @desc
|
|
14
|
+
* Makes the {@link Actor} attempt to perform a sequence of activities.
|
|
15
|
+
*
|
|
16
|
+
* @type {function(...activities: Activity[]): Promise<void>}
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
attemptsTo: (...activities: Activity[]) => Promise<void>;
|
|
11
20
|
}
|
|
@@ -11,10 +11,10 @@ export interface UsesAbilities {
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @desc
|
|
14
|
-
*
|
|
14
|
+
* Provides access to the {@link Actor}'s {@link Ability} to do something
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
16
|
+
* @type {function<T extends Ability>(doSomething: AbilityType<T>): T}
|
|
17
|
+
* @public
|
|
18
18
|
*/
|
|
19
|
-
abilityTo<T extends Ability>(doSomething: AbilityType<T>)
|
|
19
|
+
abilityTo: <T extends Ability>(doSomething: AbilityType<T>) => T;
|
|
20
20
|
}
|
|
@@ -10,7 +10,6 @@ import { ExpectationOutcome } from './expectations';
|
|
|
10
10
|
export type Predicate<Actual> = (actor: AnswersQuestions, actual: Answerable<Actual>) =>
|
|
11
11
|
Promise<ExpectationOutcome<unknown, Actual>> | ExpectationOutcome<unknown, Actual>; // eslint-disable-line @typescript-eslint/indent
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
/**
|
|
15
14
|
* @desc
|
|
16
15
|
* Defines an expectation to be used with [assertions](/modules/assertions)
|