@serenity-js/core 3.0.0-rc.33 → 3.0.0-rc.34
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 +11 -0
- package/lib/config/ClassDescription.d.ts +1 -1
- package/lib/config/SerenityConfig.d.ts +1 -1
- package/lib/config/SerenityConfig.js +1 -1
- package/lib/errors/ListItemNotFoundError.d.ts +20 -0
- package/lib/errors/ListItemNotFoundError.d.ts.map +1 -0
- package/lib/errors/ListItemNotFoundError.js +30 -0
- package/lib/errors/ListItemNotFoundError.js.map +1 -0
- package/lib/errors/index.d.ts +1 -0
- package/lib/errors/index.d.ts.map +1 -1
- package/lib/errors/index.js +3 -1
- package/lib/errors/index.js.map +1 -1
- package/lib/io/format.d.ts +3 -3
- package/lib/io/format.d.ts.map +1 -1
- package/lib/io/format.js +3 -3
- package/lib/io/format.js.map +1 -1
- package/lib/screenplay/Ability.d.ts +1 -1
- package/lib/screenplay/Activity.d.ts +1 -1
- package/lib/screenplay/Activity.js +1 -1
- package/lib/screenplay/Answerable.d.ts +1 -1
- package/lib/screenplay/Answered.d.ts +1 -1
- package/lib/screenplay/Interaction.d.ts +1 -1
- package/lib/screenplay/Interaction.js +1 -1
- package/lib/screenplay/Optional.d.ts +1 -1
- package/lib/screenplay/Question.d.ts +3 -3
- package/lib/screenplay/Question.js +1 -1
- package/lib/screenplay/RecursivelyAnswered.d.ts +1 -1
- package/lib/screenplay/Task.d.ts +1 -1
- package/lib/screenplay/Task.js +1 -1
- package/lib/screenplay/WithAnswerableProperties.d.ts +1 -1
- package/lib/screenplay/actor/Actor.d.ts +1 -1
- package/lib/screenplay/actor/Actor.js +1 -1
- package/lib/screenplay/interactions/Wait.js +12 -5
- package/lib/screenplay/interactions/Wait.js.map +1 -1
- package/lib/screenplay/questions/List.js +3 -3
- package/lib/screenplay/questions/List.js.map +1 -1
- package/lib/screenplay/questions/MetaQuestion.d.ts +1 -1
- package/lib/screenplay/questions/q.d.ts +1 -1
- package/lib/screenplay/questions/q.js +1 -1
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.d.ts +3 -2
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.d.ts.map +1 -1
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.js +3 -2
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.js.map +1 -1
- package/lib/stage/queues/DomainEventQueue.d.ts +1 -1
- package/lib/stage/queues/DomainEventQueue.js +1 -1
- package/lib/stage/queues/DomainEventQueues.d.ts +1 -1
- package/lib/stage/queues/DomainEventQueues.js +1 -1
- package/package.json +5 -5
- package/src/config/ClassDescription.ts +1 -1
- package/src/config/SerenityConfig.ts +1 -1
- package/src/errors/ListItemNotFoundError.ts +35 -0
- package/src/errors/index.ts +1 -0
- package/src/io/format.ts +3 -3
- package/src/screenplay/Ability.ts +1 -1
- package/src/screenplay/Activity.ts +1 -1
- package/src/screenplay/Answerable.ts +1 -1
- package/src/screenplay/Answered.ts +1 -1
- package/src/screenplay/Interaction.ts +1 -1
- package/src/screenplay/Optional.ts +1 -1
- package/src/screenplay/Question.ts +3 -3
- package/src/screenplay/RecursivelyAnswered.ts +1 -1
- package/src/screenplay/Task.ts +1 -1
- package/src/screenplay/WithAnswerableProperties.ts +1 -1
- package/src/screenplay/actor/Actor.ts +1 -1
- package/src/screenplay/interactions/Wait.ts +21 -13
- package/src/screenplay/questions/List.ts +4 -4
- package/src/screenplay/questions/MetaQuestion.ts +1 -1
- package/src/screenplay/questions/q.ts +1 -1
- package/src/stage/crew/artifact-archiver/ArtifactArchiver.ts +3 -2
- package/src/stage/queues/DomainEventQueue.ts +1 -1
- package/src/stage/queues/DomainEventQueues.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.0.0-rc.34](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.33...v3.0.0-rc.34) (2022-11-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **core:** interaction to Wait should fail after the timeout ([5403394](https://github.com/serenity-js/serenity-js/commit/54033946873e20a18ad1076c77f841b3856f2478)), closes [#1339](https://github.com/serenity-js/serenity-js/issues/1339)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.0.0-rc.33](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.32...v3.0.0-rc.33) (2022-11-07)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
* For example, `./my-reporter:MyReporter` would be interpreted as a request to load the `MyReporter` type from `./my-reporter` file, located
|
|
48
48
|
* relative to the [working directory](https://nodejs.org/api/process.html#processcwd) of the current Node.js process.
|
|
49
49
|
*
|
|
50
|
-
* @group
|
|
50
|
+
* @group Serenity
|
|
51
51
|
*/
|
|
52
52
|
export declare type ClassDescription = string | // e.g. '@serenity-js/core:StreamReporter'
|
|
53
53
|
[
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSONObject } from 'tiny-types';
|
|
2
|
+
import { RuntimeError } from './RuntimeError';
|
|
3
|
+
/**
|
|
4
|
+
* Thrown to indicate that an {@apilink Interaction}, a {@apilink Task} or a test scenario
|
|
5
|
+
* can't be executed due to no items are found in a list.
|
|
6
|
+
*
|
|
7
|
+
* For example, it's not possible to get the first() or the last() item of a list
|
|
8
|
+
* if the list is empty.
|
|
9
|
+
*
|
|
10
|
+
* @group Errors
|
|
11
|
+
*/
|
|
12
|
+
export declare class ListItemNotFoundError extends RuntimeError {
|
|
13
|
+
static fromJSON(serialised: JSONObject): ListItemNotFoundError;
|
|
14
|
+
/**
|
|
15
|
+
* @param message - Human-readable description of the error
|
|
16
|
+
* @param [cause] - The root cause of this {@apilink ListItemNotFoundError}, if any
|
|
17
|
+
*/
|
|
18
|
+
constructor(message: string, cause?: Error);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ListItemNotFoundError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemNotFoundError.d.ts","sourceRoot":"","sources":["../../src/errors/ListItemNotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;IAEnD,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,qBAAqB;IAW9D;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAG7C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListItemNotFoundError = void 0;
|
|
4
|
+
const ErrorSerialiser_1 = require("./ErrorSerialiser");
|
|
5
|
+
const RuntimeError_1 = require("./RuntimeError");
|
|
6
|
+
/**
|
|
7
|
+
* Thrown to indicate that an {@apilink Interaction}, a {@apilink Task} or a test scenario
|
|
8
|
+
* can't be executed due to no items are found in a list.
|
|
9
|
+
*
|
|
10
|
+
* For example, it's not possible to get the first() or the last() item of a list
|
|
11
|
+
* if the list is empty.
|
|
12
|
+
*
|
|
13
|
+
* @group Errors
|
|
14
|
+
*/
|
|
15
|
+
class ListItemNotFoundError extends RuntimeError_1.RuntimeError {
|
|
16
|
+
static fromJSON(serialised) {
|
|
17
|
+
const error = new ListItemNotFoundError(serialised.message, ErrorSerialiser_1.ErrorSerialiser.deserialise(serialised.cause));
|
|
18
|
+
error.stack = serialised.stack;
|
|
19
|
+
return error;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param message - Human-readable description of the error
|
|
23
|
+
* @param [cause] - The root cause of this {@apilink ListItemNotFoundError}, if any
|
|
24
|
+
*/
|
|
25
|
+
constructor(message, cause) {
|
|
26
|
+
super(ListItemNotFoundError, message, cause);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ListItemNotFoundError = ListItemNotFoundError;
|
|
30
|
+
//# sourceMappingURL=ListItemNotFoundError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListItemNotFoundError.js","sourceRoot":"","sources":["../../src/errors/ListItemNotFoundError.ts"],"names":[],"mappings":";;;AAEA,uDAAoD;AACpD,iDAA8C;AAE9C;;;;;;;;GAQG;AACH,MAAa,qBAAsB,SAAQ,2BAAY;IAEnD,MAAM,CAAC,QAAQ,CAAC,UAAsB;QAClC,MAAM,KAAK,GAAG,IAAI,qBAAqB,CACnC,UAAU,CAAC,OAAiB,EAC5B,iCAAe,CAAC,WAAW,CAAC,UAAU,CAAC,KAA2B,CAAC,CACtE,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,KAAe,CAAC;QAEzC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;OAGG;IACH,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;CACJ;AApBD,sDAoBC"}
|
package/lib/errors/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { ConfigurationError } from './ConfigurationError';
|
|
|
3
3
|
export { ErrorSerialiser } from './ErrorSerialiser';
|
|
4
4
|
export { ErrorStackParser } from './ErrorStackParser';
|
|
5
5
|
export { ImplementationPendingError } from './ImplementationPendingError';
|
|
6
|
+
export { ListItemNotFoundError } from './ListItemNotFoundError';
|
|
6
7
|
export { LogicError } from './LogicError';
|
|
7
8
|
export { RuntimeError } from './RuntimeError';
|
|
8
9
|
export { TestCompromisedError } from './TestCompromisedError';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/errors/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnknownError = exports.TimeoutExpiredError = exports.TestCompromisedError = exports.RuntimeError = exports.LogicError = exports.ImplementationPendingError = exports.ErrorStackParser = exports.ErrorSerialiser = exports.ConfigurationError = exports.AssertionError = void 0;
|
|
3
|
+
exports.UnknownError = exports.TimeoutExpiredError = exports.TestCompromisedError = exports.RuntimeError = exports.LogicError = exports.ListItemNotFoundError = exports.ImplementationPendingError = exports.ErrorStackParser = exports.ErrorSerialiser = exports.ConfigurationError = exports.AssertionError = void 0;
|
|
4
4
|
const AssertionError_1 = require("./AssertionError");
|
|
5
5
|
const ConfigurationError_1 = require("./ConfigurationError");
|
|
6
6
|
const ErrorSerialiser_1 = require("./ErrorSerialiser");
|
|
@@ -20,6 +20,8 @@ var ErrorStackParser_1 = require("./ErrorStackParser");
|
|
|
20
20
|
Object.defineProperty(exports, "ErrorStackParser", { enumerable: true, get: function () { return ErrorStackParser_1.ErrorStackParser; } });
|
|
21
21
|
var ImplementationPendingError_2 = require("./ImplementationPendingError");
|
|
22
22
|
Object.defineProperty(exports, "ImplementationPendingError", { enumerable: true, get: function () { return ImplementationPendingError_2.ImplementationPendingError; } });
|
|
23
|
+
var ListItemNotFoundError_1 = require("./ListItemNotFoundError");
|
|
24
|
+
Object.defineProperty(exports, "ListItemNotFoundError", { enumerable: true, get: function () { return ListItemNotFoundError_1.ListItemNotFoundError; } });
|
|
23
25
|
var LogicError_2 = require("./LogicError");
|
|
24
26
|
Object.defineProperty(exports, "LogicError", { enumerable: true, get: function () { return LogicError_2.LogicError; } });
|
|
25
27
|
var RuntimeError_1 = require("./RuntimeError");
|
package/lib/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAClD,6DAA0D;AAC1D,uDAAoD;AACpD,6EAA0E;AAC1E,6CAA0C;AAC1C,iEAA8D;AAC9D,+DAA4D;AAC5D,iDAA8C;AAE9C,iCAAe,CAAC,kBAAkB,CAC9B,+BAAc,EACd,uCAAkB,EAClB,uDAA0B,EAC1B,uBAAU,EACV,2CAAoB,EACpB,yCAAmB,EACnB,2BAAY,CACf,CAAC;AAEF,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,2EAA0E;AAAjE,wIAAA,0BAA0B,OAAA;AACnC,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAClD,6DAA0D;AAC1D,uDAAoD;AACpD,6EAA0E;AAC1E,6CAA0C;AAC1C,iEAA8D;AAC9D,+DAA4D;AAC5D,iDAA8C;AAE9C,iCAAe,CAAC,kBAAkB,CAC9B,+BAAc,EACd,uCAAkB,EAClB,uDAA0B,EAC1B,uBAAU,EACV,2CAAoB,EACpB,yCAAmB,EACnB,2BAAY,CACf,CAAC;AAEF,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,2EAA0E;AAAjE,wIAAA,0BAA0B,OAAA;AACnC,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
package/lib/io/format.d.ts
CHANGED
|
@@ -54,13 +54,13 @@ import { Answerable } from '../screenplay';
|
|
|
54
54
|
* @param config
|
|
55
55
|
* `markQuestions`: boolean - if set to true, descriptions of questions passed in as arguments will be surrounded with double angled brackets, i.e. `<<description>>`
|
|
56
56
|
*
|
|
57
|
-
* @group
|
|
57
|
+
* @group Questions
|
|
58
58
|
*/
|
|
59
59
|
export declare function format(config: {
|
|
60
60
|
markQuestions: boolean;
|
|
61
61
|
}): (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
|
|
62
|
-
/** @group
|
|
62
|
+
/** @group Questions */
|
|
63
63
|
export declare const f: (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
|
|
64
|
-
/** @group
|
|
64
|
+
/** @group Questions */
|
|
65
65
|
export declare const d: (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string;
|
|
66
66
|
//# sourceMappingURL=format.d.ts.map
|
package/lib/io/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,CAAC,SAAS,EAAE,oBAAoB,EAAE,GAAG,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,MAAM,CAS/I;AAED,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,CAAC,SAAS,EAAE,oBAAoB,EAAE,GAAG,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,MAAM,CAS/I;AAED,uBAAuB;AACvB,eAAO,MAAM,CAAC,cAZ0D,oBAAoB,mBAAmB,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,MAY1F,CAAC;AAEjD,uBAAuB;AACvB,eAAO,MAAM,CAAC,cAf0D,oBAAoB,mBAAmB,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,MAezF,CAAC"}
|
package/lib/io/format.js
CHANGED
|
@@ -57,7 +57,7 @@ const inspected_1 = require("./inspected");
|
|
|
57
57
|
* @param config
|
|
58
58
|
* `markQuestions`: boolean - if set to true, descriptions of questions passed in as arguments will be surrounded with double angled brackets, i.e. `<<description>>`
|
|
59
59
|
*
|
|
60
|
-
* @group
|
|
60
|
+
* @group Questions
|
|
61
61
|
*/
|
|
62
62
|
function format(config) {
|
|
63
63
|
return (templates, ...placeholders) => {
|
|
@@ -70,8 +70,8 @@ function format(config) {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
exports.format = format;
|
|
73
|
-
/** @group
|
|
73
|
+
/** @group Questions */
|
|
74
74
|
exports.f = format({ markQuestions: true });
|
|
75
|
-
/** @group
|
|
75
|
+
/** @group Questions */
|
|
76
76
|
exports.d = format({ markQuestions: false });
|
|
77
77
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;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;AAED,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;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;AAED,uBAAuB;AACV,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAEjD,uBAAuB;AACV,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { AnswersQuestions, PerformsActivities, UsesAbilities } from './actor';
|
|
|
9
9
|
* - {@apilink PerformsActivities}
|
|
10
10
|
* - [Command design pattern on Wikipedia](https://en.wikipedia.org/wiki/Command_pattern)
|
|
11
11
|
*
|
|
12
|
-
* @group
|
|
12
|
+
* @group Activities
|
|
13
13
|
*/
|
|
14
14
|
export declare abstract class Activity {
|
|
15
15
|
#private;
|
|
@@ -28,7 +28,7 @@ const io_1 = require("../io");
|
|
|
28
28
|
* - {@apilink PerformsActivities}
|
|
29
29
|
* - [Command design pattern on Wikipedia](https://en.wikipedia.org/wiki/Command_pattern)
|
|
30
30
|
*
|
|
31
|
-
* @group
|
|
31
|
+
* @group Activities
|
|
32
32
|
*/
|
|
33
33
|
class Activity {
|
|
34
34
|
constructor(description, location = Activity.callerLocation(5)) {
|
|
@@ -3,7 +3,7 @@ import { Question } from './Question';
|
|
|
3
3
|
* A union type that provides a convenient way to represent any value
|
|
4
4
|
* that can be resolved by {@apilink Actor.answer}.
|
|
5
5
|
*
|
|
6
|
-
* @group
|
|
6
|
+
* @group Questions
|
|
7
7
|
*/
|
|
8
8
|
export declare type Answerable<T> = Question<Promise<T>> | Question<T> | Promise<T> | T;
|
|
9
9
|
//# sourceMappingURL=Answerable.d.ts.map
|
|
@@ -7,7 +7,7 @@ import { Question } from './Question';
|
|
|
7
7
|
* Answered<Answerable<T>> === T
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
|
-
* @group
|
|
10
|
+
* @group Questions
|
|
11
11
|
*/
|
|
12
12
|
export declare type Answered<T> = T extends null | undefined ? T : T extends Question<Promise<infer A>> | Question<infer A> | Promise<infer A> ? Awaited<A> : T;
|
|
13
13
|
//# sourceMappingURL=Answered.d.ts.map
|
|
@@ -14,7 +14,7 @@ import { Answerable } from './Answerable';
|
|
|
14
14
|
* and if all the links of the property chain leading to the entry of interest exist too
|
|
15
15
|
* (so `books` is present, and so is `books[0]`, `books[0].author`, `books[0].author.name`).
|
|
16
16
|
*
|
|
17
|
-
* @group
|
|
17
|
+
* @group Questions
|
|
18
18
|
*/
|
|
19
19
|
export interface Optional {
|
|
20
20
|
/**
|
|
@@ -94,7 +94,7 @@ import { WithAnswerableProperties } from './WithAnswerableProperties';
|
|
|
94
94
|
* - {@apilink Ability}
|
|
95
95
|
* - {@apilink QuestionAdapter}
|
|
96
96
|
*
|
|
97
|
-
* @group
|
|
97
|
+
* @group Questions
|
|
98
98
|
*/
|
|
99
99
|
export declare abstract class Question<T> {
|
|
100
100
|
/**
|
|
@@ -223,7 +223,7 @@ declare global {
|
|
|
223
223
|
* - both methods and fields of the wrapped object can be used as {@apilink Question|questions} or {@apilink Interactions|interactions}
|
|
224
224
|
* - method parameters of the wrapped object will accept {@apilink Answerable|Answerable<T>}
|
|
225
225
|
*
|
|
226
|
-
* @group
|
|
226
|
+
* @group Questions
|
|
227
227
|
*/
|
|
228
228
|
export declare type QuestionAdapterFieldDecorator<Original_Type> = {
|
|
229
229
|
[Field in keyof Omit<Original_Type, keyof QuestionStatement<Original_Type>>]: Original_Type[Field] extends (...args: infer OriginalParameters) => infer OriginalMethodResult ? (...args: {
|
|
@@ -236,7 +236,7 @@ export declare type QuestionAdapterFieldDecorator<Original_Type> = {
|
|
|
236
236
|
* {@apilink QuestionAdapter} proxies the methods and fields of the wrapped object recursively,
|
|
237
237
|
* allowing them to be used as either a {@apilink Question} or an {@apilink Interaction}.
|
|
238
238
|
*
|
|
239
|
-
* @group
|
|
239
|
+
* @group Questions
|
|
240
240
|
*/
|
|
241
241
|
export declare type QuestionAdapter<T> = Question<Promise<T>> & Interaction & {
|
|
242
242
|
isPresent(): Question<Promise<boolean>>;
|
|
@@ -32,7 +32,7 @@ import { Question } from './Question';
|
|
|
32
32
|
* // RequestConfiguration === RecursivelyAnswered<WithAnswerableProperties<RequestConfiguration>>
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* @group
|
|
35
|
+
* @group Questions
|
|
36
36
|
*/
|
|
37
37
|
export declare type RecursivelyAnswered<T> = T extends null | undefined ? T : T extends Question<Promise<infer A>> | Question<infer A> | Promise<infer A> ? RecursivelyAnswered<Awaited<A>> : T extends object ? {
|
|
38
38
|
[K in keyof T]: RecursivelyAnswered<T[K]>;
|
package/lib/screenplay/Task.d.ts
CHANGED
package/lib/screenplay/Task.js
CHANGED
|
@@ -25,7 +25,7 @@ import { Question } from './Question';
|
|
|
25
25
|
* const answer: RequestConfiguration = await actorCalled('Annie').answer(question);
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
28
|
-
* @group
|
|
28
|
+
* @group Questions
|
|
29
29
|
*/
|
|
30
30
|
export declare type WithAnswerableProperties<T> = T extends null | undefined ? T : T extends Question<Promise<infer A>> | Question<infer A> | Promise<infer A> ? Answerable<A> : T extends object ? {
|
|
31
31
|
[K in keyof T]: WithAnswerableProperties<T[K]>;
|
|
@@ -16,7 +16,7 @@ import { UsesAbilities } from './UsesAbilities';
|
|
|
16
16
|
* - {@apilink Cast}
|
|
17
17
|
* - {@apilink Stage}
|
|
18
18
|
*
|
|
19
|
-
* @group
|
|
19
|
+
* @group Actors
|
|
20
20
|
*/
|
|
21
21
|
export declare class Actor implements PerformsActivities, UsesAbilities, CanHaveAbilities<Actor>, AnswersQuestions, CollectsArtifacts {
|
|
22
22
|
readonly name: string;
|
|
@@ -278,20 +278,27 @@ function waitUntil(expectation, pollingInterval) {
|
|
|
278
278
|
let delay;
|
|
279
279
|
let pollingActive = false;
|
|
280
280
|
async function poll() {
|
|
281
|
+
async function nextPollingInterval() {
|
|
282
|
+
if (pollingActive) {
|
|
283
|
+
delay = waitFor(pollingInterval);
|
|
284
|
+
await delay.start();
|
|
285
|
+
await poll();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
281
288
|
try {
|
|
282
289
|
const expectationIsMet = await expectation();
|
|
283
290
|
if (expectationIsMet) {
|
|
284
291
|
delay === null || delay === void 0 ? void 0 : delay.stop();
|
|
285
292
|
return;
|
|
286
293
|
}
|
|
287
|
-
|
|
288
|
-
delay = waitFor(pollingInterval);
|
|
289
|
-
await delay.start();
|
|
290
|
-
await poll();
|
|
291
|
-
}
|
|
294
|
+
await nextPollingInterval();
|
|
292
295
|
}
|
|
293
296
|
catch (error) {
|
|
294
297
|
delay === null || delay === void 0 ? void 0 : delay.stop();
|
|
298
|
+
if (error instanceof errors_1.ListItemNotFoundError) {
|
|
299
|
+
await nextPollingInterval();
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
295
302
|
throw error;
|
|
296
303
|
}
|
|
297
304
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wait.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Wait.ts"],"names":[],"mappings":";;;AAAA,2CAAuE;AAEvE,
|
|
1
|
+
{"version":3,"file":"Wait.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Wait.ts"],"names":[],"mappings":";;;AAAA,2CAAuE;AAEvE,yCAA0F;AAC1F,iCAA6B;AAC7B,uCAAuC;AAGvC,gDAA6C;AAC7C,4CAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Y,CAAC,QAAkB;IAEpC,IAAI,SAAyB,CAAC;IAE9B,OAAO;QACH,KAAK,EAAE,GAAG,EAAE,CACR,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAClC,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBACxB,YAAY,CAAC,SAAS,CAAC,CAAC;gBACxB,MAAM,CAAC,IAAI,4BAAmB,CAC1B,IAAA,MAAC,EAAA,cAAe,QAAS,cAAc,EACvC,QAAQ,CACX,CAAC,CAAC;YACP,CAAC,EAAE,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;QAClC,CAAC,CAAC;QAEN,IAAI,EAAE,GAAG,EAAE;YACP,YAAY,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -40,7 +40,7 @@ class List extends Question_1.Question {
|
|
|
40
40
|
return Question_1.Question.about(`the first of ${this.subject}`, async (actor) => {
|
|
41
41
|
const items = await this.answeredBy(actor);
|
|
42
42
|
if (items.length === 0) {
|
|
43
|
-
throw new errors_1.
|
|
43
|
+
throw new errors_1.ListItemNotFoundError((0, io_1.d) `Can't retrieve the first item from a list with 0 items: ${items}`);
|
|
44
44
|
}
|
|
45
45
|
return items[0];
|
|
46
46
|
});
|
|
@@ -49,7 +49,7 @@ class List extends Question_1.Question {
|
|
|
49
49
|
return Question_1.Question.about(`the last of ${this.subject}`, async (actor) => {
|
|
50
50
|
const items = await this.answeredBy(actor);
|
|
51
51
|
if (items.length === 0) {
|
|
52
|
-
throw new errors_1.
|
|
52
|
+
throw new errors_1.ListItemNotFoundError((0, io_1.d) `Can't retrieve the last item from a list with 0 items: ${items}`);
|
|
53
53
|
}
|
|
54
54
|
return items[items.length - 1];
|
|
55
55
|
});
|
|
@@ -58,7 +58,7 @@ class List extends Question_1.Question {
|
|
|
58
58
|
return Question_1.Question.about(`the ${ordinal(index + 1)} of ${this.subject}`, async (actor) => {
|
|
59
59
|
const items = await this.answeredBy(actor);
|
|
60
60
|
if (index < 0 || items.length <= index) {
|
|
61
|
-
throw new errors_1.
|
|
61
|
+
throw new errors_1.ListItemNotFoundError(`Can't retrieve the ${ordinal(index)} item from a list with ${items.length} items: ` + (0, io_1.d) `${items}`);
|
|
62
62
|
}
|
|
63
63
|
return items[index];
|
|
64
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/screenplay/questions/List.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/screenplay/questions/List.ts"],"names":[],"mappings":";;;AAAA,yCAAiE;AACjE,iCAA6B;AAG7B,0CAAwD;AACxD,kCAA+B;AAE/B,iDAAgD;AAGhD;;;;;GAKG;AACH,MAAa,IAAgB,SAAQ,mBAA8B;IAO/D,YACuB,UAAwC;QAE3D,KAAK,EAAE,CAAC;QAFW,eAAU,GAAV,UAAU,CAA8B;QAG3D,IAAI,CAAC,OAAO,GAAG,IAAA,MAAC,EAAA,GAAI,UAAW,EAAE,CAAC;IACtC,CAAC;IATD,MAAM,CAAC,EAAE,CAAK,UAAiC;QAC3C,OAAO,IAAI,IAAI,CAAK,UAAU,CAAC,CAAC;IACpC,CAAC;IASD,YAAY,CACR,QAA+E;QAE/E,OAAO,IAAI,IAAI,CACX,IAAI,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAC5D,CAAC;IACN,CAAC;IAED,OAAO,CAAC,QAA2G;QAC/G,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CACD,QAAqE,EACrE,WAAqC;QAErC,OAAO,IAAI,IAAI,CACX,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,OAA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,CAAC;IACxB,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAuB,SAAQ,WAAI;IAErC,YACqB,UAAwC,EACxC,OAAe,EACf,EAAqG;QAEtH,KAAK,CAAC,wBAAyB,OAAQ,EAAE,CAAC,CAAC;QAJ1B,eAAU,GAAV,UAAU,CAA8B;QACxC,YAAO,GAAP,OAAO,CAAQ;QACf,OAAE,GAAF,EAAE,CAAmG;IAG1H,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,KAAY;QACxB,MAAM,UAAU,GAAqB,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE;YAC9C,MAAM,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;SACrD;IACL,CAAC;CACJ"}
|
|
@@ -55,11 +55,12 @@ import { StageCrewMember } from '../../StageCrewMember';
|
|
|
55
55
|
* ]
|
|
56
56
|
* // other Serenity/JS config
|
|
57
57
|
* },
|
|
58
|
-
*
|
|
59
|
-
* // other WebdriverIO config
|
|
58
|
+
* // other WebdriverIO config
|
|
60
59
|
* }
|
|
61
60
|
* ```
|
|
62
61
|
*
|
|
62
|
+
* [ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
|
|
63
|
+
*
|
|
63
64
|
* @group Stage
|
|
64
65
|
*/
|
|
65
66
|
export declare class ArtifactArchiver implements StageCrewMember {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArtifactArchiver.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/artifact-archiver/ArtifactArchiver.ts"],"names":[],"mappings":"AAGA,OAAO,EAQH,WAAW,EACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAQ,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD
|
|
1
|
+
{"version":3,"file":"ArtifactArchiver.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/artifact-archiver/ArtifactArchiver.ts"],"names":[],"mappings":"AAGA,OAAO,EAQH,WAAW,EACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAQ,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,qBAAa,gBAAiB,YAAW,eAAe;IAkChD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,KAAK,CAAC;IAjClB;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAG,WAAW,EAAE,MAAM,EAAE,GAAG,eAAe;IAQpE;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE,GAAG,eAAe;IAMrE;;;;OAIG;gBAEkB,UAAU,EAAE,UAAU,EAC/B,KAAK,CAAC,EAAE,KAAK;IAIzB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe;IAKzC;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IA8BlC,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,OAAO;IAsBf,OAAO,CAAC,yBAAyB;CAoBpC"}
|
|
@@ -59,11 +59,12 @@ const Hash_1 = require("./Hash");
|
|
|
59
59
|
* ]
|
|
60
60
|
* // other Serenity/JS config
|
|
61
61
|
* },
|
|
62
|
-
*
|
|
63
|
-
* // other WebdriverIO config
|
|
62
|
+
* // other WebdriverIO config
|
|
64
63
|
* }
|
|
65
64
|
* ```
|
|
66
65
|
*
|
|
66
|
+
* [ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
|
|
67
|
+
*
|
|
67
68
|
* @group Stage
|
|
68
69
|
*/
|
|
69
70
|
class ArtifactArchiver {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArtifactArchiver.js","sourceRoot":"","sources":["../../../../src/stage/crew/artifact-archiver/ArtifactArchiver.ts"],"names":[],"mappings":";;;AACA,2CAAkF;AAElF,4CASyB;AACzB,oCAA+C;AAC/C,0CAA6G;AAG7G,iCAA8B;AAE9B
|
|
1
|
+
{"version":3,"file":"ArtifactArchiver.js","sourceRoot":"","sources":["../../../../src/stage/crew/artifact-archiver/ArtifactArchiver.ts"],"names":[],"mappings":";;;AACA,2CAAkF;AAElF,4CASyB;AACzB,oCAA+C;AAC/C,0CAA6G;AAG7G,iCAA8B;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAa,gBAAgB;IA4BzB;;;;OAIG;IACH,YACqB,UAAsB,EAC/B,KAAa;QADJ,eAAU,GAAV,UAAU,CAAY;QAC/B,UAAK,GAAL,KAAK,CAAQ;IAEzB,CAAC;IAnCD;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAG,WAAqB;QAC9C,IAAA,mBAAM,EAAC,+BAA+B,EAAE,WAAW,EAAE,IAAA,qBAAQ,EAAC,QAAQ,EAAE,IAAA,0BAAa,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3F,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,SAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,O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YAAa,YAAY,CAAC,KAAM,GAAG,CAAC,EAC/E,EAAE,CACL,CAAC,CAAC;QACP,CAAC,CAAC;aACD,KAAK,CAAC,KAAK,CAAC,EAAE;YACX,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,6BAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACX,CAAC;IAEO,yBAAyB,CAAC,KAA2D,EAAE,sBAA4B;QACvH,OAAO,CAAC,YAAkB,EAAE,EAAE;YAC1B,IAAI,KAAK,YAAY,yCAAgC,EAAE;gBACnD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,wCAA+B,CACnD,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,QAAQ,CAAC,WAA2B,EAC1C,sBAAsB,CACzB,CAAC,CAAC;aACN;iBAAM,IAAI,KAAK,YAAY,0BAAiB,EAAE;gBAC3C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,yBAAgB,CACpC,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,QAAQ,CAAC,WAA2B,EAC1C,sBAAsB,CACzB,CAAC,CAAC;aACN;QACL,CAAC,CAAC;IACN,CAAC;CACJ;AA1ID,4CA0IC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,iBAAiB,EAAE;SAC1B,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/core",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.34",
|
|
4
4
|
"description": "Serenity/JS Screenplay, reporting engine and core interfaces.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"validate-npm-package-name": "^4.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/chai": "^4.3.
|
|
47
|
+
"@types/chai": "^4.3.4",
|
|
48
48
|
"@types/cuid": "^1.3.1",
|
|
49
49
|
"@types/diff": "^5.0.2",
|
|
50
50
|
"@types/filenamify": "^2.0.2",
|
|
51
51
|
"@types/mocha": "^9.1.1",
|
|
52
|
-
"@types/semver": "^7.3.
|
|
52
|
+
"@types/semver": "^7.3.13",
|
|
53
53
|
"@types/validate-npm-package-name": "^4.0.0",
|
|
54
54
|
"assertion-error-formatter": "^3.0.0",
|
|
55
|
-
"memfs": "^3.4.
|
|
55
|
+
"memfs": "^3.4.12",
|
|
56
56
|
"mocha": "^10.0.0",
|
|
57
57
|
"nyc": "15.1.0",
|
|
58
58
|
"ts-node": "^10.9.1",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"node": "^14 || ^16 || ^18",
|
|
71
71
|
"npm": "^6 || ^7 || ^8"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "5b0ad14a0b673fdb541ec89ac67dc631db562018"
|
|
74
74
|
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
* For example, `./my-reporter:MyReporter` would be interpreted as a request to load the `MyReporter` type from `./my-reporter` file, located
|
|
48
48
|
* relative to the [working directory](https://nodejs.org/api/process.html#processcwd) of the current Node.js process.
|
|
49
49
|
*
|
|
50
|
-
* @group
|
|
50
|
+
* @group Serenity
|
|
51
51
|
*/
|
|
52
52
|
export type ClassDescription =
|
|
53
53
|
string | // e.g. '@serenity-js/core:StreamReporter'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSONObject } from 'tiny-types';
|
|
2
|
+
|
|
3
|
+
import { ErrorSerialiser } from './ErrorSerialiser';
|
|
4
|
+
import { RuntimeError } from './RuntimeError';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Thrown to indicate that an {@apilink Interaction}, a {@apilink Task} or a test scenario
|
|
8
|
+
* can't be executed due to no items are found in a list.
|
|
9
|
+
*
|
|
10
|
+
* For example, it's not possible to get the first() or the last() item of a list
|
|
11
|
+
* if the list is empty.
|
|
12
|
+
*
|
|
13
|
+
* @group Errors
|
|
14
|
+
*/
|
|
15
|
+
export class ListItemNotFoundError extends RuntimeError {
|
|
16
|
+
|
|
17
|
+
static fromJSON(serialised: JSONObject): ListItemNotFoundError {
|
|
18
|
+
const error = new ListItemNotFoundError(
|
|
19
|
+
serialised.message as string,
|
|
20
|
+
ErrorSerialiser.deserialise(serialised.cause as string | undefined),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
error.stack = serialised.stack as string;
|
|
24
|
+
|
|
25
|
+
return error;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param message - Human-readable description of the error
|
|
30
|
+
* @param [cause] - The root cause of this {@apilink ListItemNotFoundError}, if any
|
|
31
|
+
*/
|
|
32
|
+
constructor(message: string, cause?: Error) {
|
|
33
|
+
super(ListItemNotFoundError, message, cause);
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/errors/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { ConfigurationError } from './ConfigurationError';
|
|
|
22
22
|
export { ErrorSerialiser } from './ErrorSerialiser';
|
|
23
23
|
export { ErrorStackParser } from './ErrorStackParser';
|
|
24
24
|
export { ImplementationPendingError } from './ImplementationPendingError';
|
|
25
|
+
export { ListItemNotFoundError } from './ListItemNotFoundError';
|
|
25
26
|
export { LogicError } from './LogicError';
|
|
26
27
|
export { RuntimeError } from './RuntimeError';
|
|
27
28
|
export { TestCompromisedError } from './TestCompromisedError';
|
package/src/io/format.ts
CHANGED
|
@@ -56,7 +56,7 @@ import { inspected } from './inspected';
|
|
|
56
56
|
* @param config
|
|
57
57
|
* `markQuestions`: boolean - if set to true, descriptions of questions passed in as arguments will be surrounded with double angled brackets, i.e. `<<description>>`
|
|
58
58
|
*
|
|
59
|
-
* @group
|
|
59
|
+
* @group Questions
|
|
60
60
|
*/
|
|
61
61
|
export function format(config: { markQuestions: boolean }): (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>) => string {
|
|
62
62
|
return (templates: TemplateStringsArray, ...placeholders: Array<Answerable<any>>): string => {
|
|
@@ -69,8 +69,8 @@ export function format(config: { markQuestions: boolean }): (templates: Template
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
/** @group
|
|
72
|
+
/** @group Questions */
|
|
73
73
|
export const f = format({ markQuestions: true });
|
|
74
74
|
|
|
75
|
-
/** @group
|
|
75
|
+
/** @group Questions */
|
|
76
76
|
export const d = format({ markQuestions: false });
|
|
@@ -13,7 +13,7 @@ import { AnswersQuestions, PerformsActivities, UsesAbilities } from './actor';
|
|
|
13
13
|
* - {@apilink PerformsActivities}
|
|
14
14
|
* - [Command design pattern on Wikipedia](https://en.wikipedia.org/wiki/Command_pattern)
|
|
15
15
|
*
|
|
16
|
-
* @group
|
|
16
|
+
* @group Activities
|
|
17
17
|
*/
|
|
18
18
|
export abstract class Activity {
|
|
19
19
|
|
|
@@ -4,6 +4,6 @@ import { Question } from './Question';
|
|
|
4
4
|
* A union type that provides a convenient way to represent any value
|
|
5
5
|
* that can be resolved by {@apilink Actor.answer}.
|
|
6
6
|
*
|
|
7
|
-
* @group
|
|
7
|
+
* @group Questions
|
|
8
8
|
*/
|
|
9
9
|
export type Answerable<T> = Question<Promise<T>> | Question<T> | Promise<T> | T;
|
|
@@ -8,7 +8,7 @@ import { Question } from './Question';
|
|
|
8
8
|
* Answered<Answerable<T>> === T
|
|
9
9
|
* ```
|
|
10
10
|
*
|
|
11
|
-
* @group
|
|
11
|
+
* @group Questions
|
|
12
12
|
*/
|
|
13
13
|
export type Answered<T> =
|
|
14
14
|
T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
|
|
@@ -15,7 +15,7 @@ import { Answerable } from './Answerable';
|
|
|
15
15
|
* and if all the links of the property chain leading to the entry of interest exist too
|
|
16
16
|
* (so `books` is present, and so is `books[0]`, `books[0].author`, `books[0].author.name`).
|
|
17
17
|
*
|
|
18
|
-
* @group
|
|
18
|
+
* @group Questions
|
|
19
19
|
*/
|
|
20
20
|
export interface Optional {
|
|
21
21
|
/**
|
|
@@ -99,7 +99,7 @@ import { WithAnswerableProperties } from './WithAnswerableProperties';
|
|
|
99
99
|
* - {@apilink Ability}
|
|
100
100
|
* - {@apilink QuestionAdapter}
|
|
101
101
|
*
|
|
102
|
-
* @group
|
|
102
|
+
* @group Questions
|
|
103
103
|
*/
|
|
104
104
|
export abstract class Question<T> {
|
|
105
105
|
|
|
@@ -378,7 +378,7 @@ declare global {
|
|
|
378
378
|
* - both methods and fields of the wrapped object can be used as {@apilink Question|questions} or {@apilink Interactions|interactions}
|
|
379
379
|
* - method parameters of the wrapped object will accept {@apilink Answerable|Answerable<T>}
|
|
380
380
|
*
|
|
381
|
-
* @group
|
|
381
|
+
* @group Questions
|
|
382
382
|
*/
|
|
383
383
|
export type QuestionAdapterFieldDecorator<Original_Type> = {
|
|
384
384
|
[Field in keyof Omit<Original_Type, keyof QuestionStatement<Original_Type>>]:
|
|
@@ -400,7 +400,7 @@ export type QuestionAdapterFieldDecorator<Original_Type> = {
|
|
|
400
400
|
* {@apilink QuestionAdapter} proxies the methods and fields of the wrapped object recursively,
|
|
401
401
|
* allowing them to be used as either a {@apilink Question} or an {@apilink Interaction}.
|
|
402
402
|
*
|
|
403
|
-
* @group
|
|
403
|
+
* @group Questions
|
|
404
404
|
*/
|
|
405
405
|
export type QuestionAdapter<T> =
|
|
406
406
|
& Question<Promise<T>>
|
|
@@ -33,7 +33,7 @@ import { Question } from './Question';
|
|
|
33
33
|
* // RequestConfiguration === RecursivelyAnswered<WithAnswerableProperties<RequestConfiguration>>
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
|
-
* @group
|
|
36
|
+
* @group Questions
|
|
37
37
|
*/
|
|
38
38
|
export type RecursivelyAnswered<T> =
|
|
39
39
|
T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
|
package/src/screenplay/Task.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { Question } from './Question';
|
|
|
26
26
|
* const answer: RequestConfiguration = await actorCalled('Annie').answer(question);
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
|
-
* @group
|
|
29
|
+
* @group Questions
|
|
30
30
|
*/
|
|
31
31
|
export type WithAnswerableProperties<T> =
|
|
32
32
|
T extends null | undefined ? T :
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ensure, isGreaterThanOrEqualTo, isInRange } from 'tiny-types';
|
|
2
2
|
|
|
3
|
-
import { AssertionError, TimeoutExpiredError } from '../../errors';
|
|
3
|
+
import { AssertionError, ListItemNotFoundError, TimeoutExpiredError } from '../../errors';
|
|
4
4
|
import { d } from '../../io';
|
|
5
5
|
import { Duration } from '../../model';
|
|
6
6
|
import { AnswersQuestions, UsesAbilities } from '../actor';
|
|
@@ -252,7 +252,7 @@ export class WaitUntil<Actual> extends Interaction {
|
|
|
252
252
|
pollingEvery(interval: Duration): Interaction {
|
|
253
253
|
return new WaitUntil(this.actual, this.expectation, this.timeout, interval);
|
|
254
254
|
}
|
|
255
|
-
|
|
255
|
+
|
|
256
256
|
/**
|
|
257
257
|
* @inheritDoc
|
|
258
258
|
*/
|
|
@@ -268,8 +268,8 @@ export class WaitUntil<Actual> extends Interaction {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
const timeout = timeoutAfter(this.timeout);
|
|
271
|
-
const poller
|
|
272
|
-
|
|
271
|
+
const poller = waitUntil(expectation, this.pollingInterval);
|
|
272
|
+
|
|
273
273
|
return Promise.race([
|
|
274
274
|
timeout.start(),
|
|
275
275
|
poller.start(),
|
|
@@ -320,25 +320,33 @@ function waitUntil(expectation: () => Promise<boolean> | boolean, pollingInterva
|
|
|
320
320
|
let pollingActive = false;
|
|
321
321
|
|
|
322
322
|
async function poll(): Promise<void> {
|
|
323
|
+
|
|
324
|
+
async function nextPollingInterval(): Promise<void> {
|
|
325
|
+
if (pollingActive) {
|
|
326
|
+
delay = waitFor(pollingInterval);
|
|
327
|
+
await delay.start();
|
|
328
|
+
await poll();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
323
332
|
try {
|
|
324
333
|
const expectationIsMet = await expectation();
|
|
325
|
-
|
|
326
334
|
if (expectationIsMet) {
|
|
327
335
|
delay?.stop();
|
|
328
336
|
return;
|
|
329
337
|
}
|
|
338
|
+
await nextPollingInterval();
|
|
339
|
+
} catch (error) {
|
|
340
|
+
delay?.stop();
|
|
330
341
|
|
|
331
|
-
if (
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
await delay.start();
|
|
335
|
-
|
|
336
|
-
await poll();
|
|
342
|
+
if (error instanceof ListItemNotFoundError) {
|
|
343
|
+
await nextPollingInterval();
|
|
344
|
+
return;
|
|
337
345
|
}
|
|
338
|
-
|
|
339
|
-
delay?.stop()
|
|
346
|
+
|
|
340
347
|
throw error;
|
|
341
348
|
}
|
|
349
|
+
|
|
342
350
|
}
|
|
343
351
|
|
|
344
352
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogicError } from '../../errors';
|
|
1
|
+
import { ListItemNotFoundError, LogicError } from '../../errors';
|
|
2
2
|
import { d } from '../../io';
|
|
3
3
|
import { Actor, AnswersQuestions, UsesAbilities } from '../actor';
|
|
4
4
|
import { Answerable } from '../Answerable';
|
|
@@ -61,7 +61,7 @@ export class List<Item_Type> extends Question<Promise<Item_Type[]>> {
|
|
|
61
61
|
const items = await this.answeredBy(actor);
|
|
62
62
|
|
|
63
63
|
if (items.length === 0) {
|
|
64
|
-
throw new
|
|
64
|
+
throw new ListItemNotFoundError(d`Can't retrieve the first item from a list with 0 items: ${ items }`)
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return items[0];
|
|
@@ -73,7 +73,7 @@ export class List<Item_Type> extends Question<Promise<Item_Type[]>> {
|
|
|
73
73
|
const items = await this.answeredBy(actor);
|
|
74
74
|
|
|
75
75
|
if (items.length === 0) {
|
|
76
|
-
throw new
|
|
76
|
+
throw new ListItemNotFoundError(d`Can't retrieve the last item from a list with 0 items: ${ items }`)
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
return items[items.length - 1];
|
|
@@ -85,7 +85,7 @@ export class List<Item_Type> extends Question<Promise<Item_Type[]>> {
|
|
|
85
85
|
const items = await this.answeredBy(actor);
|
|
86
86
|
|
|
87
87
|
if (index < 0 || items.length <= index) {
|
|
88
|
-
throw new
|
|
88
|
+
throw new ListItemNotFoundError(`Can't retrieve the ${ ordinal(index) } item from a list with ${ items.length } items: ` + d`${ items }`)
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
return items[index];
|
|
@@ -70,11 +70,12 @@ import { Hash } from './Hash';
|
|
|
70
70
|
* ]
|
|
71
71
|
* // other Serenity/JS config
|
|
72
72
|
* },
|
|
73
|
-
*
|
|
74
|
-
* // other WebdriverIO config
|
|
73
|
+
* // other WebdriverIO config
|
|
75
74
|
* }
|
|
76
75
|
* ```
|
|
77
76
|
*
|
|
77
|
+
* [ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
|
|
78
|
+
*
|
|
78
79
|
* @group Stage
|
|
79
80
|
*/
|
|
80
81
|
export class ArtifactArchiver implements StageCrewMember {
|