@serenity-js/core 3.0.0-rc.17 → 3.0.0-rc.20
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 +271 -0
- package/README.md +1 -1
- package/lib/events/SceneFinishes.d.ts +7 -0
- package/lib/events/SceneFinishes.js +7 -0
- package/lib/events/SceneFinishes.js.map +1 -1
- package/lib/io/ErrorStackParser.d.ts +2 -2
- package/lib/io/ErrorStackParser.js.map +1 -1
- package/lib/io/ModuleLoader.js.map +1 -1
- package/lib/io/Path.js.map +1 -1
- package/lib/model/artifacts/HTTPRequestResponse.d.ts +3 -5
- package/lib/model/artifacts/HTTPRequestResponse.js.map +1 -1
- package/lib/screenplay/Question.d.ts +64 -8
- package/lib/screenplay/Question.js +106 -15
- package/lib/screenplay/Question.js.map +1 -1
- package/lib/screenplay/RecursivelyAnswered.d.ts +38 -0
- package/lib/screenplay/RecursivelyAnswered.js +3 -0
- package/lib/screenplay/RecursivelyAnswered.js.map +1 -0
- package/lib/screenplay/WithAnswerableProperties.d.ts +34 -0
- package/lib/screenplay/WithAnswerableProperties.js +3 -0
- package/lib/screenplay/WithAnswerableProperties.js.map +1 -0
- package/lib/screenplay/abilities/Discardable.d.ts +8 -1
- package/lib/screenplay/activities/OutcomeMatcher.js.map +1 -1
- package/lib/screenplay/index.d.ts +2 -1
- package/lib/screenplay/index.js +2 -1
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/interactions/Wait.d.ts +205 -0
- package/lib/screenplay/interactions/Wait.js +301 -0
- package/lib/screenplay/interactions/Wait.js.map +1 -0
- package/lib/screenplay/interactions/WaitBuilder.d.ts +28 -0
- package/lib/screenplay/interactions/WaitBuilder.js +3 -0
- package/lib/screenplay/interactions/WaitBuilder.js.map +1 -0
- package/lib/screenplay/interactions/index.d.ts +2 -0
- package/lib/screenplay/interactions/index.js +2 -0
- package/lib/screenplay/interactions/index.js.map +1 -1
- package/lib/screenplay/notes/ChainableSetter.d.ts +5 -0
- package/lib/screenplay/notes/ChainableSetter.js +3 -0
- package/lib/screenplay/notes/ChainableSetter.js.map +1 -0
- package/lib/screenplay/notes/Notepad.d.ts +7 -5
- package/lib/screenplay/notes/Notepad.js +13 -14
- package/lib/screenplay/notes/Notepad.js.map +1 -1
- package/lib/screenplay/notes/NotepadAdapter.d.ts +244 -0
- package/lib/screenplay/notes/NotepadAdapter.js +314 -0
- package/lib/screenplay/notes/NotepadAdapter.js.map +1 -0
- package/lib/screenplay/notes/TakeNotes.d.ts +21 -20
- package/lib/screenplay/notes/TakeNotes.js +21 -20
- package/lib/screenplay/notes/TakeNotes.js.map +1 -1
- package/lib/screenplay/notes/index.d.ts +1 -0
- package/lib/screenplay/notes/index.js +1 -0
- package/lib/screenplay/notes/index.js.map +1 -1
- package/lib/screenplay/notes/notes.d.ts +6 -6
- package/lib/screenplay/notes/notes.js +4 -3
- package/lib/screenplay/notes/notes.js.map +1 -1
- package/lib/screenplay/questions/index.d.ts +0 -1
- package/lib/screenplay/questions/index.js +0 -1
- package/lib/screenplay/questions/index.js.map +1 -1
- package/package.json +10 -11
- package/src/events/SceneFinishes.ts +7 -0
- package/src/io/ErrorStackParser.ts +1 -2
- package/src/io/ModuleLoader.ts +1 -1
- package/src/io/Path.ts +0 -1
- package/src/model/artifacts/HTTPRequestResponse.ts +4 -2
- package/src/screenplay/Question.ts +152 -35
- package/src/screenplay/RecursivelyAnswered.ts +42 -0
- package/src/screenplay/WithAnswerableProperties.ts +38 -0
- package/src/screenplay/abilities/Discardable.ts +9 -1
- package/src/screenplay/activities/OutcomeMatcher.ts +1 -7
- package/src/screenplay/index.ts +2 -1
- package/src/screenplay/interactions/Wait.ts +350 -0
- package/src/screenplay/interactions/WaitBuilder.ts +30 -0
- package/src/screenplay/interactions/index.ts +2 -0
- package/src/screenplay/notes/ChainableSetter.ts +6 -0
- package/src/screenplay/notes/Notepad.ts +13 -14
- package/src/screenplay/notes/NotepadAdapter.ts +334 -0
- package/src/screenplay/notes/TakeNotes.ts +21 -20
- package/src/screenplay/notes/index.ts +1 -0
- package/src/screenplay/notes/notes.ts +6 -5
- package/src/screenplay/questions/index.ts +0 -1
- package/lib/screenplay/DynamicRecord.d.ts +0 -8
- package/lib/screenplay/DynamicRecord.js +0 -4
- package/lib/screenplay/DynamicRecord.js.map +0 -1
- package/lib/screenplay/questions/Dictionary.d.ts +0 -52
- package/lib/screenplay/questions/Dictionary.js +0 -94
- package/lib/screenplay/questions/Dictionary.js.map +0 -1
- package/src/screenplay/DynamicRecord.ts +0 -21
- package/src/screenplay/questions/Dictionary.ts +0 -121
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,250 @@
|
|
|
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.20](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.19...v3.0.0-rc.20) (2022-07-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **core:** corrected Wait so that polling stops when the timeout expires ([60677e7](https://github.com/serenity-js/serenity-js/commit/60677e700269f03fd08e2cd58c06df0ec9c71f6f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **core:** interaction to Wait stops upon errors ([56ff3eb](https://github.com/serenity-js/serenity-js/commit/56ff3ebd5366064f89be8ad3eefa53114ad12e85)), closes [#1035](https://github.com/serenity-js/serenity-js/issues/1035)
|
|
17
|
+
* **core:** interactions to Wait.for and Wait.until are now browser-independent ([d115142](https://github.com/serenity-js/serenity-js/commit/d1151427bed96c1ebd0d1dcc4159c6aeedc605de)), closes [#1035](https://github.com/serenity-js/serenity-js/issues/1035) [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
18
|
+
* **core:** minimum timeout and polling interval guards for Wait ([fd53d81](https://github.com/serenity-js/serenity-js/commit/fd53d81f5211eca18ba91729088d07883f2f9956)), closes [#1035](https://github.com/serenity-js/serenity-js/issues/1035)
|
|
19
|
+
* **web:** introduced PagesContext and implemented PlaywrightPage ([0045a72](https://github.com/serenity-js/serenity-js/commit/0045a726d540871333f644928218aed00bcd372c)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [3.0.0-rc.19](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.18...v3.0.0-rc.19) (2022-06-11)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **deps:** upgraded "error-stack-parser" to 2.1.4 and removed dependency on "stackframe" ([8d44563](https://github.com/serenity-js/serenity-js/commit/8d445631c015887a608c3a62079d47bbec22794c)), closes [stacktracejs/error-stack-parser#75](https://github.com/stacktracejs/error-stack-parser/issues/75) [stacktracejs/error-stack-parser#80](https://github.com/stacktracejs/error-stack-parser/issues/80)
|
|
31
|
+
* **rest:** updated Axios to 0.27.2 ([b54694b](https://github.com/serenity-js/serenity-js/commit/b54694ba3dd2b8e0316d94c44381f51b1ab79ad0)), closes [axios/axios#4124](https://github.com/axios/axios/issues/4124) [#1223](https://github.com/serenity-js/serenity-js/issues/1223)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* **core:** Question.fromObject() generates questions from plain objects with nested Answerables ([3113f20](https://github.com/serenity-js/serenity-js/commit/3113f20ed5c86cb4bcf11479855d4ceaa5696970)), closes [#1219](https://github.com/serenity-js/serenity-js/issues/1219)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# [3.0.0-rc.18](https://github.com/serenity-js/serenity-js/compare/v2.33.9...v3.0.0-rc.18) (2022-06-06)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* **deps:** updated error-stack-parser to 2.1.0 ([e57957b](https://github.com/serenity-js/serenity-js/commit/e57957b7739cd84c35b125552a78586cb2d4f2bf)), closes [stacktracejs/error-stack-parser#75](https://github.com/stacktracejs/error-stack-parser/issues/75)
|
|
48
|
+
* **deps:** updated tiny-types ([f1951cf](https://github.com/serenity-js/serenity-js/commit/f1951cf753df3807b5778d116f8e8bc3f24830a7))
|
|
49
|
+
* **deps:** updated tiny-types to 1.18.2 ([83a651c](https://github.com/serenity-js/serenity-js/commit/83a651c4c2f3f8dbaabcdacba94c720efdff45dd))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* **core:** further improvements to Notepad ([c0d4c0a](https://github.com/serenity-js/serenity-js/commit/c0d4c0a8cdbc38274d2b27f48337742be3322b12)), closes [#1220](https://github.com/serenity-js/serenity-js/issues/1220)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# [3.0.0-rc.17](https://github.com/serenity-js/serenity-js/compare/v2.33.8...v3.0.0-rc.17) (2022-06-02)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
* **core:** corrected QuestionAdapter to improve support for `any` type ([9bed585](https://github.com/serenity-js/serenity-js/commit/9bed5851a342c77052d378e6178765d65e542be8))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* **core:** Screenplay-style Dictionary<T> to help resolve objects with nested Questions ([6a66778](https://github.com/serenity-js/serenity-js/commit/6a667788b7579f94edb70c36103d82ca3f146eed)), closes [#1219](https://github.com/serenity-js/serenity-js/issues/1219)
|
|
69
|
+
* **core:** type-safe Notepad and improved notes() DSL with support for QuestionAdapters ([04c5397](https://github.com/serenity-js/serenity-js/commit/04c53971cc90561f07fa64eaed79777a90f75d5a)), closes [#1220](https://github.com/serenity-js/serenity-js/issues/1220)
|
|
70
|
+
* **rest:** all HTTP requests accept DynamicRecord<AxiosRequestConfig> ([c28b47c](https://github.com/serenity-js/serenity-js/commit/c28b47cde53e2e0d3ee8313a1e21e15cbe78df9a)), closes [#463](https://github.com/serenity-js/serenity-js/issues/463)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# [3.0.0-rc.16](https://github.com/serenity-js/serenity-js/compare/v2.33.6...v3.0.0-rc.16) (2022-04-15)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Features
|
|
78
|
+
|
|
79
|
+
* **core:** get the number of notes stored in the notepad with Notepad#size() ([a5c00b9](https://github.com/serenity-js/serenity-js/commit/a5c00b9b5cef455ec1410039137e5c79aa9d9460))
|
|
80
|
+
* **core:** improved support for recording and reading notes ([6afc610](https://github.com/serenity-js/serenity-js/commit/6afc6104d808866dbcabe92bbd64eb97fa104f7a)), closes [#817](https://github.com/serenity-js/serenity-js/issues/817)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### BREAKING CHANGES
|
|
84
|
+
|
|
85
|
+
* **core:** This implementation replaces the previous implementations of TakeNote, TakeNotes
|
|
86
|
+
and Note, so tests using those interfaces will need to be updated.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# [3.0.0-rc.15](https://github.com/serenity-js/serenity-js/compare/v2.33.5...v3.0.0-rc.15) (2022-04-10)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
* **web:** replaced legacy PromiseLike return types with native Promise types ([436b3cb](https://github.com/serenity-js/serenity-js/commit/436b3cba1793f63008a56633cc93669736155ce6))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
# [3.0.0-rc.14](https://github.com/serenity-js/serenity-js/compare/v2.33.3...v3.0.0-rc.14) (2022-03-28)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Bug Fixes
|
|
103
|
+
|
|
104
|
+
* **web:** auto-generated descriptions of nested PageElements are easier to read ([5a51d91](https://github.com/serenity-js/serenity-js/commit/5a51d91f0abb1c32814c219a44da51d52df77f87))
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# [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)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# [3.0.0-rc.12](https://github.com/serenity-js/serenity-js/compare/v2.33.2...v3.0.0-rc.12) (2022-02-23)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# [3.0.0-rc.11](https://github.com/serenity-js/serenity-js/compare/v2.33.1...v3.0.0-rc.11) (2022-02-13)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Bug Fixes
|
|
120
|
+
|
|
121
|
+
* **core:** updated dependency on error-stack-parser ([ea50285](https://github.com/serenity-js/serenity-js/commit/ea502855da40c2f95c893c75061ef6dcf12f669d))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
# [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)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
### Features
|
|
133
|
+
|
|
134
|
+
* **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)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
# [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)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### Bug Fixes
|
|
142
|
+
|
|
143
|
+
* **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)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# [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)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
### Bug Fixes
|
|
151
|
+
|
|
152
|
+
* **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
|
|
153
|
+
* **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
|
|
154
|
+
* **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
### Features
|
|
158
|
+
|
|
159
|
+
* **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)
|
|
160
|
+
* **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
|
|
161
|
+
* **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)
|
|
162
|
+
* **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)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
# [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)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
### Bug Fixes
|
|
174
|
+
|
|
175
|
+
* **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
# [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)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
### Bug Fixes
|
|
183
|
+
|
|
184
|
+
* **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))
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# [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)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### Bug Fixes
|
|
192
|
+
|
|
193
|
+
* **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)
|
|
194
|
+
* **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
|
|
195
|
+
* **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
|
|
196
|
+
* **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### Features
|
|
200
|
+
|
|
201
|
+
* **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)
|
|
202
|
+
* **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
|
|
203
|
+
* **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)
|
|
204
|
+
* **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)
|
|
205
|
+
* **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)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
# [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)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
### Bug Fixes
|
|
217
|
+
|
|
218
|
+
* **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
|
|
219
|
+
* **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
|
|
220
|
+
* **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)
|
|
221
|
+
* **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
|
|
222
|
+
* **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
|
|
223
|
+
* **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
|
|
224
|
+
* **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
|
|
225
|
+
* **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
|
|
226
|
+
* **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
|
|
227
|
+
* **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)
|
|
228
|
+
* **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
|
|
229
|
+
* **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
### Features
|
|
233
|
+
|
|
234
|
+
* **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
|
|
235
|
+
* **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
|
|
236
|
+
* **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)
|
|
237
|
+
* **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)
|
|
238
|
+
* **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)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
### BREAKING CHANGES
|
|
242
|
+
|
|
243
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
244
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
6
250
|
# [3.0.0-rc.17](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.16...v3.0.0-rc.17) (2022-06-02)
|
|
7
251
|
|
|
8
252
|
|
|
@@ -505,6 +749,33 @@ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped su
|
|
|
505
749
|
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
506
750
|
|
|
507
751
|
|
|
752
|
+
## [2.33.9](https://github.com/serenity-js/serenity-js/compare/v2.33.8...v2.33.9) (2022-06-02)
|
|
753
|
+
|
|
754
|
+
**Note:** Version bump only for package @serenity-js/core
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
## [2.33.8](https://github.com/serenity-js/serenity-js/compare/v2.33.7...v2.33.8) (2022-05-07)
|
|
761
|
+
|
|
762
|
+
**Note:** Version bump only for package @serenity-js/core
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
## [2.33.7](https://github.com/serenity-js/serenity-js/compare/v2.33.6...v2.33.7) (2022-05-05)
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
### Bug Fixes
|
|
772
|
+
|
|
773
|
+
* **deps:** update dependency moment to ^2.29.3 ([9a14e46](https://github.com/serenity-js/serenity-js/commit/9a14e46a08ec3024edaaf3c9d76ee87a9deca85a))
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
508
779
|
## [2.33.6](https://github.com/serenity-js/serenity-js/compare/v2.33.5...v2.33.6) (2022-04-15)
|
|
509
780
|
|
|
510
781
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ and [API docs](https://serenity-js.org/modules/), and follow [@SerenityJS](https
|
|
|
8
8
|
|
|
9
9
|
### Learning Serenity/JS
|
|
10
10
|
|
|
11
|
-
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/
|
|
11
|
+
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
12
|
|
|
13
13
|
If you have any questions, join us on [Serenity/JS Community Chat](https://gitter.im/serenity-js/Lobby).
|
|
14
14
|
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { JSONObject } from 'tiny-types';
|
|
2
2
|
import { CorrelationId, Outcome, ScenarioDetails, Timestamp } from '../model';
|
|
3
3
|
import { DomainEvent } from './DomainEvent';
|
|
4
|
+
/**
|
|
5
|
+
* @desc
|
|
6
|
+
* Emitted by a Serenity/JS test runner adapter, right before a test and all its associated test hooks finish.
|
|
7
|
+
* Triggers any clean-up operations that might be required, such as discarding of the {@link Discardable} abilities.
|
|
8
|
+
*
|
|
9
|
+
* @extends {DomainEvent}
|
|
10
|
+
*/
|
|
4
11
|
export declare class SceneFinishes extends DomainEvent {
|
|
5
12
|
readonly sceneId: CorrelationId;
|
|
6
13
|
readonly details: ScenarioDetails;
|
|
@@ -4,6 +4,13 @@ exports.SceneFinishes = void 0;
|
|
|
4
4
|
const tiny_types_1 = require("tiny-types");
|
|
5
5
|
const model_1 = require("../model");
|
|
6
6
|
const DomainEvent_1 = require("./DomainEvent");
|
|
7
|
+
/**
|
|
8
|
+
* @desc
|
|
9
|
+
* Emitted by a Serenity/JS test runner adapter, right before a test and all its associated test hooks finish.
|
|
10
|
+
* Triggers any clean-up operations that might be required, such as discarding of the {@link Discardable} abilities.
|
|
11
|
+
*
|
|
12
|
+
* @extends {DomainEvent}
|
|
13
|
+
*/
|
|
7
14
|
class SceneFinishes extends DomainEvent_1.DomainEvent {
|
|
8
15
|
constructor(sceneId, details, outcome, timestamp) {
|
|
9
16
|
super(timestamp);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneFinishes.js","sourceRoot":"","sources":["../../src/events/SceneFinishes.ts"],"names":[],"mappings":";;;AAAA,2CAA2D;AAE3D,oCAAiG;AACjG,+CAA4C;AAE5C,MAAa,aAAc,SAAQ,yBAAW;IAU1C,YACoB,OAAsB,EACtB,OAAwB,EACxB,OAAgB,EAChC,SAAqB;QAErB,KAAK,CAAC,SAAS,CAAC,CAAC;QALD,YAAO,GAAP,OAAO,CAAe;QACtB,YAAO,GAAP,OAAO,CAAiB;QACxB,YAAO,GAAP,OAAO,CAAS;QAIhC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QACxC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QACxC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;IAC5C,CAAC;IAnBD,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,aAAa,CACpB,qBAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAiB,CAAC,EAC3C,uBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAqB,CAAC,EACjD,eAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAA4B,CAAC,EAChD,iBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAmB,CAAC,CAC5C,CAAC;IACN,CAAC;CAaJ;AArBD,sCAqBC"}
|
|
1
|
+
{"version":3,"file":"SceneFinishes.js","sourceRoot":"","sources":["../../src/events/SceneFinishes.ts"],"names":[],"mappings":";;;AAAA,2CAA2D;AAE3D,oCAAiG;AACjG,+CAA4C;AAE5C;;;;;;GAMG;AACH,MAAa,aAAc,SAAQ,yBAAW;IAU1C,YACoB,OAAsB,EACtB,OAAwB,EACxB,OAAgB,EAChC,SAAqB;QAErB,KAAK,CAAC,SAAS,CAAC,CAAC;QALD,YAAO,GAAP,OAAO,CAAe;QACtB,YAAO,GAAP,OAAO,CAAiB;QACxB,YAAO,GAAP,OAAO,CAAS;QAIhC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QACxC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;QACxC,IAAA,mBAAM,EAAC,SAAS,EAAE,OAAO,EAAE,IAAA,sBAAS,GAAE,CAAC,CAAC;IAC5C,CAAC;IAnBD,MAAM,CAAC,QAAQ,CAAC,CAAa;QACzB,OAAO,IAAI,aAAa,CACpB,qBAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAiB,CAAC,EAC3C,uBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAqB,CAAC,EACjD,eAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAA4B,CAAC,EAChD,iBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAmB,CAAC,CAC5C,CAAC;IACN,CAAC;CAaJ;AArBD,sCAqBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as parser from 'error-stack-parser';
|
|
2
2
|
/**
|
|
3
3
|
* @desc
|
|
4
4
|
* A thin wrapper around error-stack-parser module
|
|
@@ -8,5 +8,5 @@ import StackFrame = require('stackframe');
|
|
|
8
8
|
* @package
|
|
9
9
|
*/
|
|
10
10
|
export declare class ErrorStackParser {
|
|
11
|
-
parse(error: Error): StackFrame[];
|
|
11
|
+
parse(error: Error): parser.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;AAE7C;;;;;;;GAOG;AACH,MAAa,gBAAgB;IACzB,KAAK,CAAC,KAAY;QACd,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACJ;AAJD,4CAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleLoader.js","sourceRoot":"","sources":["../../src/io/ModuleLoader.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,gCAAgC;AAClE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"ModuleLoader.js","sourceRoot":"","sources":["../../src/io/ModuleLoader.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,gCAAgC;AAClE,6BAA6B,CAAC,2CAA2C;AAEzE,uCAAoC;AAEpC;;;GAGG;AACH,MAAa,YAAY;IAErB;;;OAGG;IACH,YAA4B,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IACvC,CAAC;IAED;;;;;;OAMG;IACH,YAAY,CAAC,QAAgB;QACzB,IAAI;YACA,OAAO,CAAC,CAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACpC;QAAC,MAAM;YACJ,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAgB;QACpB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAEhD,OAAO,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE;YACrC,EAAE,EAAE,QAAQ;YACZ,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;SAC3C,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,QAAgB;QACpB,IAAI;YACA,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC1C;QACD,MAAM;YACF,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;SAC5B;IACL,CAAC;IAED;;;;;;OAMG;IACH,SAAS,CAAC,QAAgB;QACtB,OAAO,IAAI,iBAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAI,QAAS,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAC3E,CAAC;CACJ;AAvED,oCAuEC"}
|
package/lib/io/Path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../src/io/Path.ts"],"names":[],"mappings":";;;AAAA,2CAAkF;
|
|
1
|
+
{"version":3,"file":"Path.js","sourceRoot":"","sources":["../../src/io/Path.ts"],"names":[],"mappings":";;;AAAA,2CAAkF;AAClF,yCAA0C;AAC1C,8BAA+B;AAE/B,MAAa,IAAK,SAAQ,qBAAQ;IA2B9B,YAAY,KAAa;QACrB,KAAK,EAAE,CAAC;QACR,IAAA,mBAAM,EAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAA,sBAAS,GAAE,EAAE,IAAA,qBAAQ,EAAC,QAAQ,EAAE,IAAA,0BAAa,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IA5BD,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,IAAI,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,KAAa;QACpC,MACI,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,EAC5D,SAAS,GAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EACrC,QAAQ,GAAK,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,EACjD,QAAQ,GAAK,UAAU,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;aAClE,IAAI,EAAE;aACN,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAEjC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CACrB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EACxB,GAAI,QAAS,GAAI,SAAU,EAAE,CAChC,CAAC,CAAC;IACP,CAAC;IASD,IAAI,CAAC,OAAa;QACd,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK;QACD,OAAO,IAAI,CAAC,KAAK;aACZ,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;aACrB,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAE,OAAO,CAAC,CAAC,CAAC,kEAAkE;IAC1G,CAAC;IAED,OAAO,CAAC,OAAa;QACjB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,SAAS;QACL,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,IAAI;QACA,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;;AA9DL,oBA+DC;AA9D2B,cAAS,GAAG,GAAG,CAAC"}
|
|
@@ -10,16 +10,14 @@ export interface RequestAndResponse extends JSONObject {
|
|
|
10
10
|
request: {
|
|
11
11
|
url: string;
|
|
12
12
|
method: string;
|
|
13
|
-
headers:
|
|
14
|
-
[header: string]: string;
|
|
15
|
-
};
|
|
13
|
+
headers: Record<string, string | number | boolean>;
|
|
16
14
|
data?: any;
|
|
17
15
|
};
|
|
18
16
|
response: {
|
|
19
17
|
status: number;
|
|
20
18
|
data?: any;
|
|
21
|
-
headers?: {
|
|
22
|
-
|
|
19
|
+
headers?: Record<string, string> & {
|
|
20
|
+
'set-cookie'?: string[];
|
|
23
21
|
};
|
|
24
22
|
};
|
|
25
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPRequestResponse.js","sourceRoot":"","sources":["../../../src/model/artifacts/HTTPRequestResponse.ts"],"names":[],"mappings":";;;AAEA,yCAAsC;
|
|
1
|
+
{"version":3,"file":"HTTPRequestResponse.js","sourceRoot":"","sources":["../../../src/model/artifacts/HTTPRequestResponse.ts"],"names":[],"mappings":";;;AAEA,yCAAsC;AAwBtC;;;;;GAKG;AACH,MAAa,mBAAoB,SAAQ,mBAAQ;IAC7C,MAAM,CAAC,QAAQ,CAAC,KAAyB;QACrC,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChH,CAAC;CACJ;AAJD,kDAIC"}
|
|
@@ -2,12 +2,14 @@ import { AnswersQuestions, UsesAbilities } from './actor';
|
|
|
2
2
|
import { Answerable } from './Answerable';
|
|
3
3
|
import { Interaction } from './Interaction';
|
|
4
4
|
import { Optional } from './Optional';
|
|
5
|
+
import { RecursivelyAnswered } from './RecursivelyAnswered';
|
|
6
|
+
import { WithAnswerableProperties } from './WithAnswerableProperties';
|
|
5
7
|
/**
|
|
6
8
|
* @desc
|
|
7
9
|
* Enables the {@link Actor} to query the system under test.
|
|
8
10
|
*
|
|
9
11
|
* @example <caption>A basic Question</caption>
|
|
10
|
-
* import {
|
|
12
|
+
* import { actorCalled, AnswersQuestions, UsesAbilities, Question } from '@serenity-js/core'
|
|
11
13
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
12
14
|
*
|
|
13
15
|
* const LastItemOf = <T>(list: T[]): Question<T> =>
|
|
@@ -15,7 +17,7 @@ import { Optional } from './Optional';
|
|
|
15
17
|
* return list[list.length - 1];
|
|
16
18
|
* });
|
|
17
19
|
*
|
|
18
|
-
*
|
|
20
|
+
* await actorCalled('Quentin').attemptsTo(
|
|
19
21
|
* Ensure.that(LastItemFrom([1,2,3]), equals(3)),
|
|
20
22
|
* );
|
|
21
23
|
*
|
|
@@ -28,8 +30,8 @@ import { Optional } from './Optional';
|
|
|
28
30
|
* return CallAnApi.as(actor).mapLastResponse(response => response.statusText);
|
|
29
31
|
* });
|
|
30
32
|
*
|
|
31
|
-
*
|
|
32
|
-
* import {
|
|
33
|
+
* @example <caption>Mapping answers to other questions</caption>
|
|
34
|
+
* import { actorCalled, AnswersQuestions, UsesAbilities, Question } from '@serenity-js/core'
|
|
33
35
|
* import { CallAnApi, LastResponse } from '@serenity-js/rest'
|
|
34
36
|
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
35
37
|
*
|
|
@@ -38,12 +40,12 @@ import { Optional } from './Optional';
|
|
|
38
40
|
* return LastResponse.status().answeredBy(actor) === 200;
|
|
39
41
|
* });
|
|
40
42
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
43
|
+
* await actorCalled('Quentin')
|
|
44
|
+
* .whoCan(CallAnApi.at('https://myapp.com/api'));
|
|
45
|
+
* .attemptsTo(
|
|
44
46
|
* Send.a(GetRequest.to('/books/0-688-00230-7')),
|
|
45
47
|
* Ensure.that(RequestWasSuccessful(), isTrue()),
|
|
46
|
-
*
|
|
48
|
+
* );
|
|
47
49
|
*
|
|
48
50
|
* @see {@link Actor}
|
|
49
51
|
* @see {@link Interaction}
|
|
@@ -68,6 +70,60 @@ export declare abstract class Question<T> {
|
|
|
68
70
|
* @returns {QuestionAdapter<Awaited<R>>}
|
|
69
71
|
*/
|
|
70
72
|
static about<R>(description: string, body: (actor: AnswersQuestions & UsesAbilities) => Promise<R> | R): QuestionAdapter<Awaited<R>>;
|
|
73
|
+
/**
|
|
74
|
+
* @desc
|
|
75
|
+
* Generates a {@link QuestionAdapter} that recursively resolves
|
|
76
|
+
* any {@link Answerable} fields of the provided object,
|
|
77
|
+
* including {@link Answerable} fields of nested objects.
|
|
78
|
+
*
|
|
79
|
+
* Optionally, the method accepts `overrides` to be shallow-merged with the fields of the original `source`, producing a new merged object.
|
|
80
|
+
*
|
|
81
|
+
* Overrides are applied from left to right, with subsequent objects overwriting property assignments of the previous ones.
|
|
82
|
+
*
|
|
83
|
+
* @example <caption>Resolving an object recursively</caption>
|
|
84
|
+
* import { actorCalled, Question } from '@serenity-js/core'
|
|
85
|
+
* import { Send, PostRequest } from '@serenity-js/rest'
|
|
86
|
+
* import { By, Text, PageElement } from '@serenity-js/web'
|
|
87
|
+
*
|
|
88
|
+
* actorCalled('Daisy')
|
|
89
|
+
* .whoCan(CallAnApi.at('https://api.example.org'))
|
|
90
|
+
* .attemptsTo(
|
|
91
|
+
* Send.a(
|
|
92
|
+
* PostRequest.to('/products/2')
|
|
93
|
+
* .with(Question.fromObject({
|
|
94
|
+
* name: Text.of(PageElement.located(By.css('.name'))),
|
|
95
|
+
* }))
|
|
96
|
+
* )
|
|
97
|
+
* );
|
|
98
|
+
*
|
|
99
|
+
* @example <caption>Resolving an object recursively</caption>
|
|
100
|
+
* import { actorCalled, Question } from '@serenity-js/core'
|
|
101
|
+
* import { Send, PostRequest } from '@serenity-js/rest'
|
|
102
|
+
* import { By, Text, PageElement } from '@serenity-js/web'
|
|
103
|
+
*
|
|
104
|
+
* actorCalled('Daisy')
|
|
105
|
+
* .whoCan(CallAnApi.at('https://api.example.org'))
|
|
106
|
+
* .attemptsTo(
|
|
107
|
+
* Send.a(
|
|
108
|
+
* PostRequest.to('/products/2')
|
|
109
|
+
* .with(Question.fromObject({
|
|
110
|
+
* name: Text.of(PageElement.located(By.css('.name'))),
|
|
111
|
+
* quantity: undefined,
|
|
112
|
+
* }, {
|
|
113
|
+
* quantity: 2,
|
|
114
|
+
* }))
|
|
115
|
+
* )
|
|
116
|
+
* );
|
|
117
|
+
*
|
|
118
|
+
* @param {Answerable<O>} source
|
|
119
|
+
* @param {Array<Answerable<Partial<O>>>} overrides
|
|
120
|
+
*
|
|
121
|
+
* @returns {QuestionAdapter<Record<Key, Value>>>}
|
|
122
|
+
*
|
|
123
|
+
* @see {@link WithAnswerableProperties}
|
|
124
|
+
* @see {@link RecursivelyAnswered}
|
|
125
|
+
*/
|
|
126
|
+
static fromObject<Source_Type extends object>(source: Answerable<WithAnswerableProperties<Source_Type>>, ...overrides: Array<Answerable<Partial<WithAnswerableProperties<Source_Type>>>>): QuestionAdapter<RecursivelyAnswered<Source_Type>>;
|
|
71
127
|
/**
|
|
72
128
|
* @desc
|
|
73
129
|
* Checks if the value is a {@link Question}.
|