@serenity-js/core 3.0.0-rc.4 → 3.0.0-rc.8
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 +143 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/io/format.d.ts +2 -0
- package/lib/io/format.js +3 -1
- package/lib/io/format.js.map +1 -1
- package/lib/io/inspected.js +2 -1
- package/lib/io/inspected.js.map +1 -1
- package/lib/screenplay/Optional.d.ts +29 -0
- package/lib/screenplay/{model/Adapter.js → Optional.js} +1 -1
- package/lib/screenplay/Optional.js.map +1 -0
- package/lib/screenplay/Question.d.ts +40 -4
- package/lib/screenplay/Question.js +132 -14
- package/lib/screenplay/Question.js.map +1 -1
- package/lib/screenplay/index.d.ts +1 -1
- package/lib/screenplay/index.js +1 -1
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/interactions/index.d.ts +0 -1
- package/lib/screenplay/interactions/index.js +0 -1
- package/lib/screenplay/interactions/index.js.map +1 -1
- package/lib/screenplay/questions/Check.d.ts +3 -3
- package/lib/screenplay/questions/Check.js +5 -7
- package/lib/screenplay/questions/Check.js.map +1 -1
- package/lib/screenplay/questions/Expectation.d.ts +13 -19
- package/lib/screenplay/questions/Expectation.js +21 -47
- package/lib/screenplay/questions/Expectation.js.map +1 -1
- package/lib/screenplay/questions/List.d.ts +6 -7
- package/lib/screenplay/questions/List.js +10 -12
- package/lib/screenplay/questions/List.js.map +1 -1
- package/lib/stage/index.d.ts +0 -2
- package/lib/stage/index.js +0 -2
- package/lib/stage/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -1
- package/src/io/format.ts +3 -0
- package/src/io/inspected.ts +2 -1
- package/src/screenplay/Optional.ts +30 -0
- package/src/screenplay/Question.ts +202 -20
- package/src/screenplay/index.ts +1 -1
- package/src/screenplay/interactions/index.ts +0 -1
- package/src/screenplay/questions/Check.ts +10 -15
- package/src/screenplay/questions/Expectation.ts +47 -73
- package/src/screenplay/questions/List.ts +18 -23
- package/src/stage/index.ts +0 -2
- package/lib/screenplay/interactions/See.d.ts +0 -31
- package/lib/screenplay/interactions/See.js +0 -43
- package/lib/screenplay/interactions/See.js.map +0 -1
- package/lib/screenplay/model/Adapter.d.ts +0 -8
- package/lib/screenplay/model/Adapter.js.map +0 -1
- package/lib/screenplay/model/createAdapter.d.ts +0 -3
- package/lib/screenplay/model/createAdapter.js +0 -118
- package/lib/screenplay/model/createAdapter.js.map +0 -1
- package/lib/screenplay/model/index.d.ts +0 -2
- package/lib/screenplay/model/index.js +0 -15
- package/lib/screenplay/model/index.js.map +0 -1
- package/lib/stage/DressingRoom.d.ts +0 -37
- package/lib/stage/DressingRoom.js +0 -53
- package/lib/stage/DressingRoom.js.map +0 -1
- package/lib/stage/WithStage.d.ts +0 -51
- package/lib/stage/WithStage.js +0 -3
- package/lib/stage/WithStage.js.map +0 -1
- package/src/screenplay/interactions/See.ts +0 -45
- package/src/screenplay/model/Adapter.ts +0 -14
- package/src/screenplay/model/createAdapter.ts +0 -149
- package/src/screenplay/model/index.ts +0 -2
- package/src/stage/DressingRoom.ts +0 -53
- package/src/stage/WithStage.ts +0 -52
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,133 @@
|
|
|
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.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **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)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **core:** removed deprecated interface DressingRoom; please use Cast instead ([d68b44b](https://github.com/serenity-js/serenity-js/commit/d68b44b545f50f6533523ab07008f9f89ac34433))
|
|
23
|
+
* **core:** removed deprecated interface WithStage ([45d1c2b](https://github.com/serenity-js/serenity-js/commit/45d1c2b3e0ff1946ccff97d148d0776f2fa60065))
|
|
24
|
+
* **core:** removed deprecated task to See.if ([dd5e2f5](https://github.com/serenity-js/serenity-js/commit/dd5e2f5c7e61444d40899f70d413f38bc9f6691a))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **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)
|
|
30
|
+
* **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
|
|
31
|
+
* **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)
|
|
32
|
+
* **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)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# [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)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# [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)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* **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))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# [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)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Bug Fixes
|
|
64
|
+
|
|
65
|
+
* **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)
|
|
66
|
+
* **core:** removed interface Reducible since it's not used any more ([1e9f23b](https://github.com/serenity-js/serenity-js/commit/1e9f23b227e3c4509dd52d6885cde5d3ecd1d102))
|
|
67
|
+
* **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
|
|
68
|
+
* **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Features
|
|
72
|
+
|
|
73
|
+
* **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)
|
|
74
|
+
* **core:** List supports custom collectors ([cd3f2bc](https://github.com/serenity-js/serenity-js/commit/cd3f2bc1b536c8e56714aecd669bfed7ab078e0a))
|
|
75
|
+
* **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)
|
|
76
|
+
* **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)
|
|
77
|
+
* **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)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# [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)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Bug Fixes
|
|
89
|
+
|
|
90
|
+
* **core:** `formatted` can be configured to produce single- or multi-line descriptions ([21145a3](https://github.com/serenity-js/serenity-js/commit/21145a3dda17e87ea7bd950da4526b90f37a1edc))
|
|
91
|
+
* **core:** `inspected` produces a better description of functions used as parameters ([15535c6](https://github.com/serenity-js/serenity-js/commit/15535c675469651b835c0b358649a590f2c15b5d))
|
|
92
|
+
* **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)
|
|
93
|
+
* **core:** answerProxy renamed to ProxyAnswer to better reflect its purpose ([a98fe41](https://github.com/serenity-js/serenity-js/commit/a98fe41378bc8475f027946e0f01a30f4789d57a))
|
|
94
|
+
* **core:** corrected type defs of Question.as ([681ce22](https://github.com/serenity-js/serenity-js/commit/681ce22259bf75161df7ce2454f4b6d73ea87259))
|
|
95
|
+
* **core:** exported createProxyAnswer to make it easier to use ([5471989](https://github.com/serenity-js/serenity-js/commit/547198985025d0ede2ab47ea89d8944960fb980d))
|
|
96
|
+
* **core:** removed Loop as it will be replaced ([0b63d27](https://github.com/serenity-js/serenity-js/commit/0b63d27745c905001adf3c219dd0e3cf44756320))
|
|
97
|
+
* **core:** removed Property as it will be replaced by new Question ([fd7fa10](https://github.com/serenity-js/serenity-js/commit/fd7fa10dfbaa0c0cba059c5f18920609c4bac014))
|
|
98
|
+
* **core:** removed Transform and mapping functions as they'll be replaced with new Question ([506eaea](https://github.com/serenity-js/serenity-js/commit/506eaeaf2df22cfde5d7ca6a8f413fc053556c2b))
|
|
99
|
+
* **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)
|
|
100
|
+
* **cucumber:** support for recognising non-Serenity AssertionErrors in older version of Cucumber ([31e9e99](https://github.com/serenity-js/serenity-js/commit/31e9e9919c2fd1e87b3f4405d9b2a6ae0164e893))
|
|
101
|
+
* **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
### Features
|
|
105
|
+
|
|
106
|
+
* **core:** question.about creates a proxy around the answer to simplify the API ([25e0841](https://github.com/serenity-js/serenity-js/commit/25e084116ad28a02b55fbd8814b6ffa0375ec433))
|
|
107
|
+
* **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
|
|
108
|
+
* **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)
|
|
109
|
+
* **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)
|
|
110
|
+
* **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)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### BREAKING CHANGES
|
|
114
|
+
|
|
115
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
116
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
# [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)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Bug Fixes
|
|
126
|
+
|
|
127
|
+
* **core:** screenplay Adapters will now correctly proxy calls to function-specific object keys ([ad6f1e6](https://github.com/serenity-js/serenity-js/commit/ad6f1e655ca77d6efde4461854e54c4113ca8fdd))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
6
133
|
# [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)
|
|
7
134
|
|
|
8
135
|
|
|
@@ -82,6 +209,22 @@ modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped su
|
|
|
82
209
|
|
|
83
210
|
|
|
84
211
|
|
|
212
|
+
## [2.32.7](https://github.com/serenity-js/serenity-js/compare/v2.32.6...v2.32.7) (2022-01-10)
|
|
213
|
+
|
|
214
|
+
**Note:** Version bump only for package @serenity-js/core
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
## [2.32.6](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v2.32.6) (2022-01-10)
|
|
221
|
+
|
|
222
|
+
**Note:** Version bump only for package @serenity-js/core
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
85
228
|
## [2.32.5](https://github.com/serenity-js/serenity-js/compare/v2.32.4...v2.32.5) (2021-12-08)
|
|
86
229
|
|
|
87
230
|
**Note:** Version bump only for package @serenity-js/core
|
package/lib/index.d.ts
CHANGED
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,
|
|
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"}
|
package/lib/io/format.d.ts
CHANGED
|
@@ -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
|
package/lib/io/format.js.map
CHANGED
|
@@ -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/inspected.js
CHANGED
package/lib/io/inspected.js.map
CHANGED
|
@@ -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,IA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AC,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
|
+
}
|
|
@@ -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 {
|
|
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) =>
|
|
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):
|
|
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 {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Question = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const io_1 = require("../io");
|
|
5
|
+
const Interaction_1 = require("./Interaction");
|
|
6
6
|
/**
|
|
7
7
|
* @desc
|
|
8
8
|
* Enables the {@link Actor} to query the system under test.
|
|
@@ -69,7 +69,7 @@ class Question {
|
|
|
69
69
|
* @returns {Question<R>}
|
|
70
70
|
*/
|
|
71
71
|
static about(description, body) {
|
|
72
|
-
return
|
|
72
|
+
return Question.createAdapter(new QuestionStatement(description, body));
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* @desc
|
|
@@ -85,33 +85,144 @@ class Question {
|
|
|
85
85
|
static isAQuestion(maybeQuestion) {
|
|
86
86
|
return !!maybeQuestion && !!maybeQuestion.answeredBy;
|
|
87
87
|
}
|
|
88
|
+
static createAdapter(statement) {
|
|
89
|
+
return new Proxy(() => statement, {
|
|
90
|
+
get(currentStatement, key, receiver) {
|
|
91
|
+
const target = currentStatement();
|
|
92
|
+
if (key === Symbol.toPrimitive) {
|
|
93
|
+
return (_hint) => {
|
|
94
|
+
return target.toString();
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (key in target) {
|
|
98
|
+
return Reflect.get(target, key);
|
|
99
|
+
}
|
|
100
|
+
if (key === 'then') {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
// todo: extract function to determine the subject
|
|
104
|
+
const originalSubject = (0, io_1.f) `${target}`;
|
|
105
|
+
const fieldDescription = (typeof key === 'number' || /^\d+$/.test(String(key)))
|
|
106
|
+
? `[${String(key)}]` // array index
|
|
107
|
+
: `.${String(key)}`; // field/method name
|
|
108
|
+
// / todo
|
|
109
|
+
return Question.about(`${originalSubject}${fieldDescription}`, async (actor) => {
|
|
110
|
+
const answer = await actor.answer(target);
|
|
111
|
+
if (!isDefined(answer)) {
|
|
112
|
+
return undefined; // eslint-disable-line unicorn/no-useless-undefined
|
|
113
|
+
}
|
|
114
|
+
const field = answer[key];
|
|
115
|
+
return typeof field === 'function'
|
|
116
|
+
? field.bind(answer)
|
|
117
|
+
: field;
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
set(currentStatement, key, value, receiver) {
|
|
121
|
+
const target = currentStatement();
|
|
122
|
+
return Reflect.set(target, key, value);
|
|
123
|
+
},
|
|
124
|
+
apply(currentStatement, _thisArgument, parameters) {
|
|
125
|
+
const target = currentStatement();
|
|
126
|
+
const parameterDescriptions = [
|
|
127
|
+
'(',
|
|
128
|
+
parameters.map(p => (0, io_1.f) `${p}`).join(', '),
|
|
129
|
+
')'
|
|
130
|
+
].join('');
|
|
131
|
+
return Question.about(target.toString() + parameterDescriptions, async (actor) => {
|
|
132
|
+
const params = [];
|
|
133
|
+
for (const parameter of parameters) {
|
|
134
|
+
const answered = await actor.answer(parameter);
|
|
135
|
+
params.push(answered);
|
|
136
|
+
}
|
|
137
|
+
const field = await actor.answer(target);
|
|
138
|
+
return typeof field === 'function'
|
|
139
|
+
? field(...params)
|
|
140
|
+
: field;
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
getPrototypeOf(currentStatement) {
|
|
144
|
+
return Reflect.getPrototypeOf(currentStatement());
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
88
148
|
as(mapping) {
|
|
89
|
-
return Question.about(
|
|
149
|
+
return Question.about((0, io_1.f) `${this}.as(${mapping})`, async (actor) => {
|
|
90
150
|
const answer = (await actor.answer(this));
|
|
91
151
|
return mapping(answer);
|
|
92
152
|
});
|
|
93
153
|
}
|
|
94
154
|
}
|
|
95
155
|
exports.Question = Question;
|
|
156
|
+
class QuestionStatement extends Interaction_1.Interaction {
|
|
157
|
+
constructor(subject, body) {
|
|
158
|
+
super();
|
|
159
|
+
this.subject = subject;
|
|
160
|
+
this.body = body;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @desc
|
|
164
|
+
* Returns a Question that resolves to `true` if resolving the {@link QuestionStatement}
|
|
165
|
+
* returns a value other than `null` or `undefined` and doesn't throw errors.
|
|
166
|
+
*
|
|
167
|
+
* @returns {Question<Promise<boolean>>}
|
|
168
|
+
*/
|
|
169
|
+
isPresent() {
|
|
170
|
+
return new IsPresent((0, io_1.f) `${this}.isPresent()`, this.body);
|
|
171
|
+
}
|
|
172
|
+
async answeredBy(actor) {
|
|
173
|
+
const result = await this.body(actor);
|
|
174
|
+
return isDefined(result)
|
|
175
|
+
? result
|
|
176
|
+
: undefined;
|
|
177
|
+
}
|
|
178
|
+
async performAs(actor) {
|
|
179
|
+
await this.body(actor);
|
|
180
|
+
}
|
|
181
|
+
describedAs(subject) {
|
|
182
|
+
this.subject = subject;
|
|
183
|
+
return this;
|
|
184
|
+
}
|
|
185
|
+
toString() {
|
|
186
|
+
return this.subject;
|
|
187
|
+
}
|
|
188
|
+
as(mapping) {
|
|
189
|
+
return Question.about((0, io_1.f) `${this}.as(${mapping})`, async (actor) => {
|
|
190
|
+
const answer = await actor.answer(this);
|
|
191
|
+
if (!isDefined(answer)) {
|
|
192
|
+
return undefined; // eslint-disable-line unicorn/no-useless-undefined
|
|
193
|
+
}
|
|
194
|
+
return mapping(answer);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
96
198
|
/**
|
|
97
199
|
* @package
|
|
98
200
|
*/
|
|
99
|
-
class
|
|
201
|
+
class IsPresent extends Question {
|
|
100
202
|
constructor(subject, body) {
|
|
101
203
|
super();
|
|
102
204
|
this.subject = subject;
|
|
103
205
|
this.body = body;
|
|
104
206
|
}
|
|
105
|
-
answeredBy(actor) {
|
|
106
|
-
|
|
207
|
+
async answeredBy(actor) {
|
|
208
|
+
try {
|
|
209
|
+
const answer = await this.body(actor);
|
|
210
|
+
if (answer === undefined || answer === null) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
if (this.isOptional(answer)) {
|
|
214
|
+
return await actor.answer(answer.isPresent());
|
|
215
|
+
}
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
isOptional(maybeOptional) {
|
|
223
|
+
return typeof maybeOptional === 'object'
|
|
224
|
+
&& Reflect.has(maybeOptional, 'isPresent');
|
|
107
225
|
}
|
|
108
|
-
/**
|
|
109
|
-
* Changes the description of this question's subject
|
|
110
|
-
* and produces a new instance without mutating the original one.
|
|
111
|
-
*
|
|
112
|
-
* @param {string} subject
|
|
113
|
-
* @returns {Question<T>}
|
|
114
|
-
*/
|
|
115
226
|
describedAs(subject) {
|
|
116
227
|
this.subject = subject;
|
|
117
228
|
return this;
|
|
@@ -120,4 +231,11 @@ class AnonymousQuestion extends Question {
|
|
|
120
231
|
return this.subject;
|
|
121
232
|
}
|
|
122
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* @package
|
|
236
|
+
*/
|
|
237
|
+
function isDefined(value) {
|
|
238
|
+
return value !== undefined
|
|
239
|
+
&& value !== null;
|
|
240
|
+
}
|
|
123
241
|
//# sourceMappingURL=Question.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../src/screenplay/Question.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;
|
|
1
|
+
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../src/screenplay/Question.ts"],"names":[],"mappings":";;;AAAA,8BAA0B;AAG1B,+CAA4C;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAsB,QAAQ;IAC1B;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,KAAK,CAAI,WAAmB,EAAE,IAAiE;QAClG,OAAO,QAAQ,CAAC,aAAa,CAAC,IAAI,iBAAiB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,WAAW,CAAI,aAAsB;QACxC,OAAO,CAAC,CAAE,aAAa,IAAI,CAAC,CAAG,aAAqB,CAAC,UAAU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,OAAO,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ;AAED;;GAEG;AACH,SAAS,SAAS,CAAI,KAAQ;IAC1B,OAAO,KAAK,KAAK,SAAS;WACnB,KAAK,KAAK,IAAI,CAAC;AAC1B,CAAC"}
|
|
@@ -6,7 +6,7 @@ export * from './actor';
|
|
|
6
6
|
export * from './Answerable';
|
|
7
7
|
export * from './Interaction';
|
|
8
8
|
export * from './interactions';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './Optional';
|
|
10
10
|
export * from './Question';
|
|
11
11
|
export * from './questions';
|
|
12
12
|
export * from './Task';
|
package/lib/screenplay/index.js
CHANGED
|
@@ -18,7 +18,7 @@ __exportStar(require("./actor"), exports);
|
|
|
18
18
|
__exportStar(require("./Answerable"), exports);
|
|
19
19
|
__exportStar(require("./Interaction"), exports);
|
|
20
20
|
__exportStar(require("./interactions"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./Optional"), exports);
|
|
22
22
|
__exportStar(require("./Question"), exports);
|
|
23
23
|
__exportStar(require("./questions"), exports);
|
|
24
24
|
__exportStar(require("./Task"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/screenplay/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,4CAA0B;AAC1B,gDAA8B;AAC9B,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/screenplay/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,4CAA0B;AAC1B,gDAA8B;AAC9B,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,8CAA4B;AAC5B,yCAAuB"}
|
|
@@ -11,6 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Log"), exports);
|
|
14
|
-
__exportStar(require("./See"), exports);
|
|
15
14
|
__exportStar(require("./TakeNote"), exports);
|
|
16
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsB;AACtB,6CAA2B"}
|
|
@@ -44,7 +44,7 @@ export declare class Check<Actual> extends Task {
|
|
|
44
44
|
private readonly expectation;
|
|
45
45
|
private readonly activities;
|
|
46
46
|
private readonly alternativeActivities;
|
|
47
|
-
static whether<A>(actual: Answerable<A>, expectation: Expectation<
|
|
47
|
+
static whether<A>(actual: Answerable<A>, expectation: Expectation<A>): {
|
|
48
48
|
andIfSo: (...activities: Activity[]) => Check<A>;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
@@ -54,7 +54,7 @@ export declare class Check<Actual> extends Task {
|
|
|
54
54
|
* @param activities
|
|
55
55
|
* @param alternativeActivities
|
|
56
56
|
*/
|
|
57
|
-
constructor(actual: Answerable<Actual>, expectation: Expectation<
|
|
57
|
+
constructor(actual: Answerable<Actual>, expectation: Expectation<Actual>, activities: Activity[], alternativeActivities?: Activity[]);
|
|
58
58
|
/**
|
|
59
59
|
* @param {...@serenity-js/core/lib/screenplay~Activity[]} alternativeActivities
|
|
60
60
|
* @return {@serenity-js/core/lib/screenplay~Task}
|
|
@@ -72,7 +72,7 @@ export declare class Check<Actual> extends Task {
|
|
|
72
72
|
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
73
73
|
* @see {@link @serenity-js/core/lib/screenplay/actor~PerformsActivities}
|
|
74
74
|
*/
|
|
75
|
-
performAs(actor: AnswersQuestions & PerformsActivities):
|
|
75
|
+
performAs(actor: AnswersQuestions & PerformsActivities): Promise<void>;
|
|
76
76
|
/**
|
|
77
77
|
* @desc
|
|
78
78
|
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|