@serenity-js/core 3.0.0-rc.1 → 3.0.0-rc.10

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 (96) hide show
  1. package/CHANGELOG.md +321 -0
  2. package/lib/index.d.ts +1 -1
  3. package/lib/index.js +3 -1
  4. package/lib/index.js.map +1 -1
  5. package/lib/io/asyncMap.d.ts +8 -0
  6. package/lib/io/asyncMap.js +18 -0
  7. package/lib/io/asyncMap.js.map +1 -0
  8. package/lib/io/format.d.ts +2 -0
  9. package/lib/io/format.js +3 -1
  10. package/lib/io/format.js.map +1 -1
  11. package/lib/io/index.d.ts +1 -1
  12. package/lib/io/index.js +1 -1
  13. package/lib/io/index.js.map +1 -1
  14. package/lib/io/inspected.js +3 -2
  15. package/lib/io/inspected.js.map +1 -1
  16. package/lib/screenplay/Optional.d.ts +29 -0
  17. package/lib/screenplay/{model/Adapter.js → Optional.js} +1 -1
  18. package/lib/screenplay/Optional.js.map +1 -0
  19. package/lib/screenplay/Question.d.ts +40 -4
  20. package/lib/screenplay/Question.js +130 -14
  21. package/lib/screenplay/Question.js.map +1 -1
  22. package/lib/screenplay/index.d.ts +1 -1
  23. package/lib/screenplay/index.js +1 -1
  24. package/lib/screenplay/index.js.map +1 -1
  25. package/lib/screenplay/interactions/index.d.ts +0 -1
  26. package/lib/screenplay/interactions/index.js +0 -1
  27. package/lib/screenplay/interactions/index.js.map +1 -1
  28. package/lib/screenplay/questions/Check.d.ts +3 -3
  29. package/lib/screenplay/questions/Check.js +5 -7
  30. package/lib/screenplay/questions/Check.js.map +1 -1
  31. package/lib/screenplay/questions/Expectation.d.ts +13 -19
  32. package/lib/screenplay/questions/Expectation.js +21 -47
  33. package/lib/screenplay/questions/Expectation.js.map +1 -1
  34. package/lib/screenplay/questions/List.d.ts +19 -199
  35. package/lib/screenplay/questions/List.js +154 -217
  36. package/lib/screenplay/questions/List.js.map +1 -1
  37. package/lib/stage/index.d.ts +0 -2
  38. package/lib/stage/index.js +0 -2
  39. package/lib/stage/index.js.map +1 -1
  40. package/package.json +6 -6
  41. package/src/index.ts +1 -1
  42. package/src/io/asyncMap.ts +18 -0
  43. package/src/io/format.ts +3 -0
  44. package/src/io/index.ts +1 -1
  45. package/src/io/inspected.ts +3 -2
  46. package/src/screenplay/Optional.ts +30 -0
  47. package/src/screenplay/Question.ts +200 -20
  48. package/src/screenplay/index.ts +1 -1
  49. package/src/screenplay/interactions/index.ts +0 -1
  50. package/src/screenplay/questions/Check.ts +10 -15
  51. package/src/screenplay/questions/Expectation.ts +47 -73
  52. package/src/screenplay/questions/List.ts +215 -242
  53. package/src/stage/index.ts +0 -2
  54. package/lib/io/collections/index.d.ts +0 -1
  55. package/lib/io/collections/index.js +0 -14
  56. package/lib/io/collections/index.js.map +0 -1
  57. package/lib/io/collections/reducible.d.ts +0 -16
  58. package/lib/io/collections/reducible.js +0 -3
  59. package/lib/io/collections/reducible.js.map +0 -1
  60. package/lib/screenplay/interactions/See.d.ts +0 -31
  61. package/lib/screenplay/interactions/See.js +0 -43
  62. package/lib/screenplay/interactions/See.js.map +0 -1
  63. package/lib/screenplay/model/Adapter.d.ts +0 -8
  64. package/lib/screenplay/model/Adapter.js.map +0 -1
  65. package/lib/screenplay/model/createAdapter.d.ts +0 -3
  66. package/lib/screenplay/model/createAdapter.js +0 -112
  67. package/lib/screenplay/model/createAdapter.js.map +0 -1
  68. package/lib/screenplay/model/index.d.ts +0 -2
  69. package/lib/screenplay/model/index.js +0 -15
  70. package/lib/screenplay/model/index.js.map +0 -1
  71. package/lib/screenplay/questions/lists/ArrayListAdapter.d.ts +0 -88
  72. package/lib/screenplay/questions/lists/ArrayListAdapter.js +0 -167
  73. package/lib/screenplay/questions/lists/ArrayListAdapter.js.map +0 -1
  74. package/lib/screenplay/questions/lists/ListAdapter.d.ts +0 -20
  75. package/lib/screenplay/questions/lists/ListAdapter.js +0 -3
  76. package/lib/screenplay/questions/lists/ListAdapter.js.map +0 -1
  77. package/lib/screenplay/questions/lists/index.d.ts +0 -2
  78. package/lib/screenplay/questions/lists/index.js +0 -15
  79. package/lib/screenplay/questions/lists/index.js.map +0 -1
  80. package/lib/stage/DressingRoom.d.ts +0 -37
  81. package/lib/stage/DressingRoom.js +0 -53
  82. package/lib/stage/DressingRoom.js.map +0 -1
  83. package/lib/stage/WithStage.d.ts +0 -51
  84. package/lib/stage/WithStage.js +0 -3
  85. package/lib/stage/WithStage.js.map +0 -1
  86. package/src/io/collections/index.ts +0 -1
  87. package/src/io/collections/reducible.ts +0 -16
  88. package/src/screenplay/interactions/See.ts +0 -45
  89. package/src/screenplay/model/Adapter.ts +0 -14
  90. package/src/screenplay/model/createAdapter.ts +0 -142
  91. package/src/screenplay/model/index.ts +0 -2
  92. package/src/screenplay/questions/lists/ArrayListAdapter.ts +0 -205
  93. package/src/screenplay/questions/lists/ListAdapter.ts +0 -33
  94. package/src/screenplay/questions/lists/index.ts +0 -2
  95. package/src/stage/DressingRoom.ts +0 -53
  96. package/src/stage/WithStage.ts +0 -52
package/CHANGELOG.md CHANGED
@@ -3,6 +3,303 @@
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.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
7
+
8
+
9
+
10
+ # [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)
11
+
12
+
13
+ ### Features
14
+
15
+ * **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)
16
+
17
+
18
+
19
+ # [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)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **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)
25
+
26
+
27
+
28
+ # [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)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
34
+ * **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
35
+ * **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
36
+
37
+
38
+ ### Features
39
+
40
+ * **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)
41
+ * **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
42
+ * **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)
43
+ * **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)
44
+
45
+
46
+
47
+ # [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
48
+
49
+
50
+
51
+ # [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)
52
+
53
+
54
+ ### Bug Fixes
55
+
56
+ * **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
57
+
58
+
59
+
60
+ # [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)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * **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))
66
+
67
+
68
+
69
+ # [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)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * **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)
75
+ * **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
76
+ * **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
77
+ * **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
78
+
79
+
80
+ ### Features
81
+
82
+ * **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)
83
+ * **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
84
+ * **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)
85
+ * **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)
86
+ * **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)
87
+
88
+
89
+
90
+ # [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)
91
+
92
+
93
+
94
+ # [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
100
+ * **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
101
+ * **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)
102
+ * **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
103
+ * **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
104
+ * **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
105
+ * **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
106
+ * **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
107
+ * **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
108
+ * **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)
109
+ * **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
110
+ * **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
111
+
112
+
113
+ ### Features
114
+
115
+ * **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
116
+ * **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
117
+ * **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)
118
+ * **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)
119
+ * **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)
120
+
121
+
122
+ ### BREAKING CHANGES
123
+
124
+ * **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
125
+ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
126
+
127
+
128
+
129
+
130
+
131
+ # [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)
132
+
133
+
134
+ ### Features
135
+
136
+ * **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)
137
+
138
+
139
+
140
+
141
+
142
+ # [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)
143
+
144
+
145
+ ### Bug Fixes
146
+
147
+ * **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)
148
+
149
+
150
+
151
+
152
+
153
+ # [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)
154
+
155
+
156
+ ### Bug Fixes
157
+
158
+ * **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
159
+ * **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
160
+ * **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
161
+
162
+
163
+ ### Features
164
+
165
+ * **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)
166
+ * **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
167
+ * **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)
168
+ * **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)
169
+
170
+
171
+
172
+
173
+
174
+ # [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
175
+
176
+
177
+
178
+ # [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)
179
+
180
+
181
+ ### Bug Fixes
182
+
183
+ * **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
184
+
185
+
186
+
187
+ # [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)
188
+
189
+
190
+ ### Bug Fixes
191
+
192
+ * **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))
193
+
194
+
195
+
196
+ # [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)
197
+
198
+
199
+ ### Bug Fixes
200
+
201
+ * **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)
202
+ * **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
203
+ * **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
204
+ * **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
205
+
206
+
207
+ ### Features
208
+
209
+ * **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)
210
+ * **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
211
+ * **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)
212
+ * **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)
213
+ * **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)
214
+
215
+
216
+
217
+ # [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)
218
+
219
+
220
+
221
+ # [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
222
+
223
+
224
+ ### Bug Fixes
225
+
226
+ * **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
227
+ * **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
228
+ * **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)
229
+ * **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
230
+ * **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
231
+ * **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
232
+ * **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
233
+ * **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
234
+ * **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
235
+ * **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)
236
+ * **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
237
+ * **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
238
+
239
+
240
+ ### Features
241
+
242
+ * **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
243
+ * **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
244
+ * **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)
245
+ * **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)
246
+ * **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)
247
+
248
+
249
+ ### BREAKING CHANGES
250
+
251
+ * **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
252
+ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
253
+
254
+
255
+
256
+
257
+
258
+ # [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)
259
+
260
+
261
+ ### Bug Fixes
262
+
263
+ * **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
264
+
265
+
266
+
267
+
268
+
269
+ # [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)
270
+
271
+
272
+ ### Bug Fixes
273
+
274
+ * **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))
275
+
276
+
277
+
278
+
279
+
280
+ # [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)
281
+
282
+
283
+ ### Bug Fixes
284
+
285
+ * **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)
286
+ * **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
287
+ * **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
288
+ * **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
289
+
290
+
291
+ ### Features
292
+
293
+ * **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)
294
+ * **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
295
+ * **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)
296
+ * **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)
297
+ * **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)
298
+
299
+
300
+
301
+
302
+
6
303
  # [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)
7
304
 
8
305
  **Note:** Version bump only for package @serenity-js/core
@@ -48,6 +345,30 @@ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped su
48
345
 
49
346
 
50
347
 
348
+ # [2.33.0](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v2.33.0) (2022-02-03)
349
+
350
+ **Note:** Version bump only for package @serenity-js/core
351
+
352
+
353
+
354
+
355
+
356
+ ## [2.32.7](https://github.com/serenity-js/serenity-js/compare/v2.32.6...v2.32.7) (2022-01-10)
357
+
358
+ **Note:** Version bump only for package @serenity-js/core
359
+
360
+
361
+
362
+
363
+
364
+ ## [2.32.6](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v2.32.6) (2022-01-10)
365
+
366
+ **Note:** Version bump only for package @serenity-js/core
367
+
368
+
369
+
370
+
371
+
51
372
  ## [2.32.5](https://github.com/serenity-js/serenity-js/compare/v2.32.4...v2.32.5) (2021-12-08)
52
373
 
53
374
  **Note:** Version bump only for package @serenity-js/core
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './errors';
2
2
  export * from './instance';
3
- export { format } from './io';
3
+ export { d, f, format } from './io';
4
4
  export { Duration, Timestamp } from './model';
5
5
  export * from './screenplay';
6
6
  export * from './Serenity';
package/lib/index.js CHANGED
@@ -10,10 +10,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.SerenityConfig = exports.Timestamp = exports.Duration = exports.format = void 0;
13
+ exports.SerenityConfig = exports.Timestamp = exports.Duration = exports.format = exports.f = exports.d = void 0;
14
14
  __exportStar(require("./errors"), exports);
15
15
  __exportStar(require("./instance"), exports);
16
16
  var io_1 = require("./io");
17
+ Object.defineProperty(exports, "d", { enumerable: true, get: function () { return io_1.d; } });
18
+ Object.defineProperty(exports, "f", { enumerable: true, get: function () { return io_1.f; } });
17
19
  Object.defineProperty(exports, "format", { enumerable: true, get: function () { return io_1.format; } });
18
20
  var model_1 = require("./model");
19
21
  Object.defineProperty(exports, "Duration", { enumerable: true, get: function () { return model_1.Duration; } });
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,2BAA8B;AAArB,4FAAA,MAAM,OAAA;AACf,iCAA8C;AAArC,iGAAA,QAAQ,OAAA;AAAE,kGAAA,SAAS,OAAA;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,2BAAoC;AAA3B,uFAAA,CAAC,OAAA;AAAE,uFAAA,CAAC,OAAA;AAAE,4FAAA,MAAM,OAAA;AACrB,iCAA8C;AAArC,iGAAA,QAAQ,OAAA;AAAE,kGAAA,SAAS,OAAA;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,0CAAwB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @desc
3
+ * Maps an Array<Item_Type> to an Array<Result_Type>, one element at a time.
4
+ *
5
+ * @param {Array<Item_Type>} items
6
+ * @param {function(item: Item_Type): Promise<Result_Type>} mappingFunction
7
+ */
8
+ export declare function asyncMap<Item_Type, Result_Type>(items: Item_Type[], mappingFunction: (item: Item_Type) => Promise<Result_Type> | Result_Type): Promise<Result_Type[]>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asyncMap = void 0;
4
+ /**
5
+ * @desc
6
+ * Maps an Array<Item_Type> to an Array<Result_Type>, one element at a time.
7
+ *
8
+ * @param {Array<Item_Type>} items
9
+ * @param {function(item: Item_Type): Promise<Result_Type>} mappingFunction
10
+ */
11
+ function asyncMap(items, mappingFunction) {
12
+ return items.reduce((previous, item) => previous.then(async (acc) => {
13
+ const result = await mappingFunction(item);
14
+ return acc.concat(result);
15
+ }), Promise.resolve([]));
16
+ }
17
+ exports.asyncMap = asyncMap;
18
+ //# sourceMappingURL=asyncMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncMap.js","sourceRoot":"","sources":["../../src/io/asyncMap.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAyB,KAAkB,EAAE,eAAwE;IACzI,OAAO,KAAK,CAAC,MAAM,CACf,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CACf,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;QAE3C,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,EACJ,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACxB,CAAC;AACN,CAAC;AAVD,4BAUC"}
@@ -35,3 +35,5 @@ import { Answerable } from '../screenplay';
35
35
  export declare function format(config: {
36
36
  markQuestions: boolean;
37
37
  }): (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
38
+ export declare const f: (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
39
+ export declare const d: (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
package/lib/io/format.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.format = void 0;
3
+ exports.d = exports.f = exports.format = void 0;
4
4
  const inspected_1 = require("./inspected");
5
5
  /**
6
6
  * @desc
@@ -46,4 +46,6 @@ function format(config) {
46
46
  };
47
47
  }
48
48
  exports.format = format;
49
+ exports.f = format({ markQuestions: true });
50
+ exports.d = format({ markQuestions: false });
49
51
  //# sourceMappingURL=format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,SAAgB,MAAM,CAAC,MAAkC;IACrD,OAAO,CAAC,SAA+B,EAAE,GAAG,YAAoC,EAAU,EAAE;QACxF,OAAO,SAAS;aACX,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM;YACzC,CAAC,CAAC,CAAE,QAAQ,EAAE,IAAA,qBAAS,EAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAE;YACjG,CAAC,CAAC,CAAE,QAAQ,CAAE,CAAC;aAClB,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACzC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAA;AACL,CAAC;AATD,wBASC"}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,SAAgB,MAAM,CAAC,MAAkC;IACrD,OAAO,CAAC,SAA+B,EAAE,GAAG,YAAoC,EAAU,EAAE;QACxF,OAAO,SAAS;aACX,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM;YACzC,CAAC,CAAC,CAAE,QAAQ,EAAE,IAAA,qBAAS,EAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAE;YACjG,CAAC,CAAC,CAAE,QAAQ,CAAE,CAAC;aAClB,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACzC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAA;AACL,CAAC;AATD,wBASC;AAEY,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACpC,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC"}
package/lib/io/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './AssertionReportDiffer';
2
- export * from './collections';
2
+ export * from './asyncMap';
3
3
  export * from './commaSeparated';
4
4
  export * from './Config';
5
5
  export * from './ErrorSerialiser';
package/lib/io/index.js CHANGED
@@ -11,7 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./AssertionReportDiffer"), exports);
14
- __exportStar(require("./collections"), exports);
14
+ __exportStar(require("./asyncMap"), exports);
15
15
  __exportStar(require("./commaSeparated"), exports);
16
16
  __exportStar(require("./Config"), exports);
17
17
  __exportStar(require("./ErrorSerialiser"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAwC;AACxC,gDAA8B;AAC9B,mDAAiC;AACjC,2CAAyB;AACzB,oDAAkC;AAClC,qDAAmC;AACnC,+CAA6B;AAC7B,+CAA6B;AAC7B,uDAAqC;AACrC,2CAAyB;AACzB,8CAA4B;AAC5B,yCAAuB;AACvB,iDAA+B;AAC/B,iDAA+B;AAC/B,yCAAuB;AACvB,+CAA6B;AAC7B,sDAAoC;AACpC,4CAA0B;AAC1B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAwC;AACxC,6CAA2B;AAC3B,mDAAiC;AACjC,2CAAyB;AACzB,oDAAkC;AAClC,qDAAmC;AACnC,+CAA6B;AAC7B,+CAA6B;AAC7B,uDAAqC;AACrC,2CAAyB;AACzB,8CAA4B;AAC5B,yCAAuB;AACvB,iDAA+B;AAC/B,iDAA+B;AAC/B,yCAAuB;AACvB,+CAA6B;AAC7B,sDAAoC;AACpC,4CAA0B;AAC1B,4CAA0B"}
@@ -46,7 +46,7 @@ function inspected(value, config) {
46
46
  if (!hasCustomInspectionFunction(value) && isPlainObject(value) && isSerialisableAsJSON(value)) {
47
47
  return stringifiedToJson(value, inline);
48
48
  }
49
- return (0, util_1.inspect)(value, { breakLength: Number.POSITIVE_INFINITY, compact: !inline, sorted: false });
49
+ return (0, util_1.inspect)(value, { breakLength: Number.POSITIVE_INFINITY, compact: inline ? 3 : false, sorted: false });
50
50
  }
51
51
  exports.inspected = inspected;
52
52
  function stringifiedToJson(value, inline) {
@@ -124,7 +124,8 @@ function isADate(v) {
124
124
  * @param {Answerable<any>} v
125
125
  */
126
126
  function isAPromise(v) {
127
- return !!v.then;
127
+ return typeof v === 'object'
128
+ && 'then' in v;
128
129
  }
129
130
  /**
130
131
  * @desc
@@ -1 +1 @@
1
- {"version":3,"file":"inspected.js","sourceRoot":"","sources":["../../src/io/inspected.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAG/B,qDAAkD;AAOlD;;;;;;;;;;;GAWG;AACH,SAAgB,SAAS,CAAC,KAAsB,EAAE,MAAwB;IAEtE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC;IAErF,IAAI,CAAE,SAAS,CAAC,KAAK,CAAC,EAAE;QACpB,OAAO,IAAA,cAAO,EAAC,KAAK,CAAC,CAAC;KACzB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACtB,OAAO,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KAC1C;IAED,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE;QACnB,OAAO,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;KAClC;IAED,IAAI,mBAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;QAC7B,OAAO,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,aAAa,CAAC,CAAC;KAClD;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;QAChB,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;KAC9B;IAED,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE;QAC1B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;KA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GAAG,OAAO,CAAC,CAAC;IACtB,OAAO,IAAI,KAAK,UAAU;QACtB,sEAAsE;QACtE,6BAA6B;QAC7B,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjD,2EAA2E;QAC3E,uEAAuE;QACvE,yBAAyB;QACzB,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;AACtF,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { Answerable } from './Answerable';
2
+ /**
3
+ * @desc
4
+ * `Optional` is a container object, which holds a value that may or may not be "present",
5
+ *
6
+ * The meaning of being "present" depends on the context and typically means a value that:
7
+ * - is other than `null` or `undefined`
8
+ * - is retrievable, so retrieving it doesn't throw any errors
9
+ *
10
+ * Additionally, `Optional` can also have a context-specific meaning. For example, `Optional#isPresent()`:
11
+ * - in the context of a `PageElement` means that the element exists in the DOM.
12
+ * - in the context of a `ModalWindow` means that the modal window is open.
13
+ * - in the case of a REST API response, `LastResponse.body().books[0].author.name.isPresent()`
14
+ * will inform us if a given entry exists (so `books[0].author.name`),
15
+ * and if all the links of the property chain leading to the entry of interest exist too
16
+ * (so `books` is present, and so is `books[0]`, `books[0].author`, `books[0].author.name`).
17
+ *
18
+ * @public
19
+ */
20
+ export interface Optional {
21
+ /**
22
+ * @desc
23
+ * Returns an {@link Answerable} that resolves to `true` when the optional value
24
+ * is present, `false` otherwise.
25
+ *
26
+ * @returns {Answerable<boolean>}
27
+ */
28
+ isPresent(): Answerable<boolean>;
29
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Adapter.js.map
3
+ //# sourceMappingURL=Optional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Optional.js","sourceRoot":"","sources":["../../src/screenplay/Optional.ts"],"names":[],"mappings":""}
@@ -1,5 +1,7 @@
1
1
  import { AnswersQuestions, UsesAbilities } from './actor';
2
- import { Adapter } from './model';
2
+ import { Answerable } from './Answerable';
3
+ import { Interaction } from './Interaction';
4
+ import { Optional } from './Optional';
3
5
  /**
4
6
  * @desc
5
7
  * Enables the {@link Actor} to query the system under test.
@@ -65,7 +67,7 @@ export declare abstract class Question<T> {
65
67
  *
66
68
  * @returns {Question<R>}
67
69
  */
68
- static about<R>(description: string, body: (actor: AnswersQuestions & UsesAbilities) => R): Question<R> & Adapter<Awaited<R>>;
70
+ static about<R>(description: string, body: (actor: AnswersQuestions & UsesAbilities) => Promise<R> | R): QuestionAdapter<Awaited<R>>;
69
71
  /**
70
72
  * @desc
71
73
  * Checks if the value is a {@link Question}.
@@ -78,6 +80,7 @@ export declare abstract class Question<T> {
78
80
  * @returns {boolean}
79
81
  */
80
82
  static isAQuestion<T>(maybeQuestion: unknown): maybeQuestion is Question<T>;
83
+ protected static createAdapter<AT>(statement: Question<AT>): QuestionAdapter<Awaited<AT>>;
81
84
  /**
82
85
  * @desc
83
86
  * Describes the subject of this {@link Question}.
@@ -95,8 +98,41 @@ export declare abstract class Question<T> {
95
98
  abstract describedAs(subject: string): this;
96
99
  /**
97
100
  * @abstract
98
- * // todo check why api docs are not getting generated for this methods
99
101
  */
100
102
  abstract answeredBy(actor: AnswersQuestions & UsesAbilities): T;
101
- as<O>(mapping: (answer: Awaited<T>) => Promise<O> | O): Question<Promise<O>>;
103
+ as<O>(mapping: (answer: Awaited<T>) => Promise<O> | O): QuestionAdapter<O>;
102
104
  }
105
+ declare global {
106
+ interface ProxyConstructor {
107
+ new <Source_Type extends object, Target_Type extends object>(target: Source_Type, handler: ProxyHandler<Source_Type>): Target_Type;
108
+ }
109
+ }
110
+ export declare type ProxiedAnswer<Original_Type> = {
111
+ [Field in keyof Omit<Original_Type, keyof QuestionStatement<Original_Type>>]: Original_Type[Field] extends (...args: infer OriginalParameters) => infer OriginalMethodResult ? (...args: {
112
+ [P in keyof OriginalParameters]: Answerable<OriginalParameters[P]>;
113
+ }) => {
114
+ isPresent(): Question<Promise<boolean>>;
115
+ } & QuestionAdapter<Awaited<OriginalMethodResult>> : {
116
+ isPresent(): Question<Promise<boolean>>;
117
+ } & QuestionAdapter<Awaited<Original_Type[Field]>>;
118
+ };
119
+ export declare type QuestionAdapter<Original_Type> = Question<Promise<Original_Type>> & Interaction & Optional & ProxiedAnswer<Original_Type>;
120
+ declare class QuestionStatement<Answer_Type> extends Interaction implements Question<Promise<Answer_Type>>, Optional {
121
+ private subject;
122
+ private readonly body;
123
+ constructor(subject: string, body: (actor: AnswersQuestions & UsesAbilities, ...Parameters: any[]) => Promise<Answer_Type> | Answer_Type);
124
+ /**
125
+ * @desc
126
+ * Returns a Question that resolves to `true` if resolving the {@link QuestionStatement}
127
+ * returns a value other than `null` or `undefined` and doesn't throw errors.
128
+ *
129
+ * @returns {Question<Promise<boolean>>}
130
+ */
131
+ isPresent(): Question<Promise<boolean>>;
132
+ answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<Answer_Type>;
133
+ performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
134
+ describedAs(subject: string): this;
135
+ toString(): string;
136
+ as<O>(mapping: (answer: Awaited<Answer_Type>) => (Promise<O> | O)): QuestionAdapter<O>;
137
+ }
138
+ export {};