@serenity-js/core 3.0.0-rc.18 → 3.0.0-rc.19
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 +17 -0
- package/lib/io/ErrorStackParser.d.ts +2 -2
- package/lib/io/ErrorStackParser.js +1 -1
- package/lib/io/ErrorStackParser.js.map +1 -1
- package/lib/model/artifacts/HTTPRequestResponse.d.ts +3 -5
- package/lib/model/artifacts/HTTPRequestResponse.js.map +1 -1
- package/lib/screenplay/Question.d.ts +64 -8
- package/lib/screenplay/Question.js +106 -15
- package/lib/screenplay/Question.js.map +1 -1
- package/lib/screenplay/RecursivelyAnswered.d.ts +38 -0
- package/lib/screenplay/RecursivelyAnswered.js +3 -0
- package/lib/screenplay/RecursivelyAnswered.js.map +1 -0
- package/lib/screenplay/WithAnswerableProperties.d.ts +34 -0
- package/lib/screenplay/WithAnswerableProperties.js +3 -0
- package/lib/screenplay/WithAnswerableProperties.js.map +1 -0
- package/lib/screenplay/index.d.ts +2 -1
- package/lib/screenplay/index.js +2 -1
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/questions/index.d.ts +0 -1
- package/lib/screenplay/questions/index.js +0 -1
- package/lib/screenplay/questions/index.js.map +1 -1
- package/package.json +3 -4
- package/src/io/ErrorStackParser.ts +2 -3
- package/src/model/artifacts/HTTPRequestResponse.ts +4 -2
- package/src/screenplay/Question.ts +152 -35
- package/src/screenplay/RecursivelyAnswered.ts +42 -0
- package/src/screenplay/WithAnswerableProperties.ts +38 -0
- package/src/screenplay/index.ts +2 -1
- package/src/screenplay/questions/index.ts +0 -1
- package/lib/screenplay/DynamicRecord.d.ts +0 -8
- package/lib/screenplay/DynamicRecord.js +0 -4
- package/lib/screenplay/DynamicRecord.js.map +0 -1
- package/lib/screenplay/questions/Dictionary.d.ts +0 -52
- package/lib/screenplay/questions/Dictionary.js +0 -94
- package/lib/screenplay/questions/Dictionary.js.map +0 -1
- package/src/screenplay/DynamicRecord.ts +0 -21
- package/src/screenplay/questions/Dictionary.ts +0 -121
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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.19](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.18...v3.0.0-rc.19) (2022-06-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** upgraded "error-stack-parser" to 2.1.4 and removed dependency on "stackframe" ([8d44563](https://github.com/serenity-js/serenity-js/commit/8d445631c015887a608c3a62079d47bbec22794c)), closes [stacktracejs/error-stack-parser#75](https://github.com/stacktracejs/error-stack-parser/issues/75) [stacktracejs/error-stack-parser#80](https://github.com/stacktracejs/error-stack-parser/issues/80)
|
|
12
|
+
* **rest:** updated Axios to 0.27.2 ([b54694b](https://github.com/serenity-js/serenity-js/commit/b54694ba3dd2b8e0316d94c44381f51b1ab79ad0)), closes [axios/axios#4124](https://github.com/axios/axios/issues/4124) [#1223](https://github.com/serenity-js/serenity-js/issues/1223)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **core:** Question.fromObject() generates questions from plain objects with nested Answerables ([3113f20](https://github.com/serenity-js/serenity-js/commit/3113f20ed5c86cb4bcf11479855d4ceaa5696970)), closes [#1219](https://github.com/serenity-js/serenity-js/issues/1219)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
# [3.0.0-rc.18](https://github.com/serenity-js/serenity-js/compare/v2.33.9...v3.0.0-rc.18) (2022-06-06)
|
|
7
24
|
|
|
8
25
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as parser from 'error-stack-parser';
|
|
2
2
|
/**
|
|
3
3
|
* @desc
|
|
4
4
|
* A thin wrapper around error-stack-parser module
|
|
@@ -8,5 +8,5 @@ import StackFrame from 'stackframe';
|
|
|
8
8
|
* @package
|
|
9
9
|
*/
|
|
10
10
|
export declare class ErrorStackParser {
|
|
11
|
-
parse(error: Error): StackFrame[];
|
|
11
|
+
parse(error: Error): parser.StackFrame[];
|
|
12
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ErrorStackParser = void 0;
|
|
4
|
-
const parser = require(
|
|
4
|
+
const parser = require("error-stack-parser");
|
|
5
5
|
/**
|
|
6
6
|
* @desc
|
|
7
7
|
* A thin wrapper around error-stack-parser module
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorStackParser.js","sourceRoot":"","sources":["../../src/io/ErrorStackParser.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"ErrorStackParser.js","sourceRoot":"","sources":["../../src/io/ErrorStackParser.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAE7C;;;;;;;GAOG;AACH,MAAa,gBAAgB;IACzB,KAAK,CAAC,KAAY;QACd,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACJ;AAJD,4CAIC"}
|
|
@@ -10,16 +10,14 @@ export interface RequestAndResponse extends JSONObject {
|
|
|
10
10
|
request: {
|
|
11
11
|
url: string;
|
|
12
12
|
method: string;
|
|
13
|
-
headers:
|
|
14
|
-
[header: string]: string;
|
|
15
|
-
};
|
|
13
|
+
headers: Record<string, string | number | boolean>;
|
|
16
14
|
data?: any;
|
|
17
15
|
};
|
|
18
16
|
response: {
|
|
19
17
|
status: number;
|
|
20
18
|
data?: any;
|
|
21
|
-
headers?: {
|
|
22
|
-
|
|
19
|
+
headers?: Record<string, string> & {
|
|
20
|
+
'set-cookie'?: string[];
|
|
23
21
|
};
|
|
24
22
|
};
|
|
25
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPRequestResponse.js","sourceRoot":"","sources":["../../../src/model/artifacts/HTTPRequestResponse.ts"],"names":[],"mappings":";;;AAEA,yCAAsC;
|
|
1
|
+
{"version":3,"file":"HTTPRequestResponse.js","sourceRoot":"","sources":["../../../src/model/artifacts/HTTPRequestResponse.ts"],"names":[],"mappings":";;;AAEA,yCAAsC;AAwBtC;;;;;GAKG;AACH,MAAa,mBAAoB,SAAQ,mBAAQ;IAC7C,MAAM,CAAC,QAAQ,CAAC,KAAyB;QACrC,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChH,CAAC;CACJ;AAJD,kDAIC"}
|
|
@@ -2,12 +2,14 @@ import { AnswersQuestions, UsesAbilities } from './actor';
|
|
|
2
2
|
import { Answerable } from './Answerable';
|
|
3
3
|
import { Interaction } from './Interaction';
|
|
4
4
|
import { Optional } from './Optional';
|
|
5
|
+
import { RecursivelyAnswered } from './RecursivelyAnswered';
|
|
6
|
+
import { WithAnswerableProperties } from './WithAnswerableProperties';
|
|
5
7
|
/**
|
|
6
8
|
* @desc
|
|
7
9
|
* Enables the {@link Actor} to query the system under test.
|
|
8
10
|
*
|
|
9
11
|
* @example <caption>A basic Question</caption>
|
|
10
|
-
* import {
|
|
12
|
+
* import { actorCalled, AnswersQuestions, UsesAbilities, Question } from '@serenity-js/core'
|
|
11
13
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
12
14
|
*
|
|
13
15
|
* const LastItemOf = <T>(list: T[]): Question<T> =>
|
|
@@ -15,7 +17,7 @@ import { Optional } from './Optional';
|
|
|
15
17
|
* return list[list.length - 1];
|
|
16
18
|
* });
|
|
17
19
|
*
|
|
18
|
-
*
|
|
20
|
+
* await actorCalled('Quentin').attemptsTo(
|
|
19
21
|
* Ensure.that(LastItemFrom([1,2,3]), equals(3)),
|
|
20
22
|
* );
|
|
21
23
|
*
|
|
@@ -28,8 +30,8 @@ import { Optional } from './Optional';
|
|
|
28
30
|
* return CallAnApi.as(actor).mapLastResponse(response => response.statusText);
|
|
29
31
|
* });
|
|
30
32
|
*
|
|
31
|
-
*
|
|
32
|
-
* import {
|
|
33
|
+
* @example <caption>Mapping answers to other questions</caption>
|
|
34
|
+
* import { actorCalled, AnswersQuestions, UsesAbilities, Question } from '@serenity-js/core'
|
|
33
35
|
* import { CallAnApi, LastResponse } from '@serenity-js/rest'
|
|
34
36
|
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
35
37
|
*
|
|
@@ -38,12 +40,12 @@ import { Optional } from './Optional';
|
|
|
38
40
|
* return LastResponse.status().answeredBy(actor) === 200;
|
|
39
41
|
* });
|
|
40
42
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
43
|
+
* await actorCalled('Quentin')
|
|
44
|
+
* .whoCan(CallAnApi.at('https://myapp.com/api'));
|
|
45
|
+
* .attemptsTo(
|
|
44
46
|
* Send.a(GetRequest.to('/books/0-688-00230-7')),
|
|
45
47
|
* Ensure.that(RequestWasSuccessful(), isTrue()),
|
|
46
|
-
*
|
|
48
|
+
* );
|
|
47
49
|
*
|
|
48
50
|
* @see {@link Actor}
|
|
49
51
|
* @see {@link Interaction}
|
|
@@ -68,6 +70,60 @@ export declare abstract class Question<T> {
|
|
|
68
70
|
* @returns {QuestionAdapter<Awaited<R>>}
|
|
69
71
|
*/
|
|
70
72
|
static about<R>(description: string, body: (actor: AnswersQuestions & UsesAbilities) => Promise<R> | R): QuestionAdapter<Awaited<R>>;
|
|
73
|
+
/**
|
|
74
|
+
* @desc
|
|
75
|
+
* Generates a {@link QuestionAdapter} that recursively resolves
|
|
76
|
+
* any {@link Answerable} fields of the provided object,
|
|
77
|
+
* including {@link Answerable} fields of nested objects.
|
|
78
|
+
*
|
|
79
|
+
* Optionally, the method accepts `overrides` to be shallow-merged with the fields of the original `source`, producing a new merged object.
|
|
80
|
+
*
|
|
81
|
+
* Overrides are applied from left to right, with subsequent objects overwriting property assignments of the previous ones.
|
|
82
|
+
*
|
|
83
|
+
* @example <caption>Resolving an object recursively</caption>
|
|
84
|
+
* import { actorCalled, Question } from '@serenity-js/core'
|
|
85
|
+
* import { Send, PostRequest } from '@serenity-js/rest'
|
|
86
|
+
* import { By, Text, PageElement } from '@serenity-js/web'
|
|
87
|
+
*
|
|
88
|
+
* actorCalled('Daisy')
|
|
89
|
+
* .whoCan(CallAnApi.at('https://api.example.org'))
|
|
90
|
+
* .attemptsTo(
|
|
91
|
+
* Send.a(
|
|
92
|
+
* PostRequest.to('/products/2')
|
|
93
|
+
* .with(Question.fromObject({
|
|
94
|
+
* name: Text.of(PageElement.located(By.css('.name'))),
|
|
95
|
+
* }))
|
|
96
|
+
* )
|
|
97
|
+
* );
|
|
98
|
+
*
|
|
99
|
+
* @example <caption>Resolving an object recursively</caption>
|
|
100
|
+
* import { actorCalled, Question } from '@serenity-js/core'
|
|
101
|
+
* import { Send, PostRequest } from '@serenity-js/rest'
|
|
102
|
+
* import { By, Text, PageElement } from '@serenity-js/web'
|
|
103
|
+
*
|
|
104
|
+
* actorCalled('Daisy')
|
|
105
|
+
* .whoCan(CallAnApi.at('https://api.example.org'))
|
|
106
|
+
* .attemptsTo(
|
|
107
|
+
* Send.a(
|
|
108
|
+
* PostRequest.to('/products/2')
|
|
109
|
+
* .with(Question.fromObject({
|
|
110
|
+
* name: Text.of(PageElement.located(By.css('.name'))),
|
|
111
|
+
* quantity: undefined,
|
|
112
|
+
* }, {
|
|
113
|
+
* quantity: 2,
|
|
114
|
+
* }))
|
|
115
|
+
* )
|
|
116
|
+
* );
|
|
117
|
+
*
|
|
118
|
+
* @param {Answerable<O>} source
|
|
119
|
+
* @param {Array<Answerable<Partial<O>>>} overrides
|
|
120
|
+
*
|
|
121
|
+
* @returns {QuestionAdapter<Record<Key, Value>>>}
|
|
122
|
+
*
|
|
123
|
+
* @see {@link WithAnswerableProperties}
|
|
124
|
+
* @see {@link RecursivelyAnswered}
|
|
125
|
+
*/
|
|
126
|
+
static fromObject<Source_Type extends object>(source: Answerable<WithAnswerableProperties<Source_Type>>, ...overrides: Array<Answerable<Partial<WithAnswerableProperties<Source_Type>>>>): QuestionAdapter<RecursivelyAnswered<Source_Type>>;
|
|
71
127
|
/**
|
|
72
128
|
* @desc
|
|
73
129
|
* Checks if the value is a {@link Question}.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Question = void 0;
|
|
4
|
+
const objects_1 = require("tiny-types/lib/objects");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
4
6
|
const io_1 = require("../io");
|
|
5
7
|
const Interaction_1 = require("./Interaction");
|
|
6
8
|
/**
|
|
@@ -8,7 +10,7 @@ const Interaction_1 = require("./Interaction");
|
|
|
8
10
|
* Enables the {@link Actor} to query the system under test.
|
|
9
11
|
*
|
|
10
12
|
* @example <caption>A basic Question</caption>
|
|
11
|
-
* import {
|
|
13
|
+
* import { actorCalled, AnswersQuestions, UsesAbilities, Question } from '@serenity-js/core'
|
|
12
14
|
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
13
15
|
*
|
|
14
16
|
* const LastItemOf = <T>(list: T[]): Question<T> =>
|
|
@@ -16,7 +18,7 @@ const Interaction_1 = require("./Interaction");
|
|
|
16
18
|
* return list[list.length - 1];
|
|
17
19
|
* });
|
|
18
20
|
*
|
|
19
|
-
*
|
|
21
|
+
* await actorCalled('Quentin').attemptsTo(
|
|
20
22
|
* Ensure.that(LastItemFrom([1,2,3]), equals(3)),
|
|
21
23
|
* );
|
|
22
24
|
*
|
|
@@ -29,8 +31,8 @@ const Interaction_1 = require("./Interaction");
|
|
|
29
31
|
* return CallAnApi.as(actor).mapLastResponse(response => response.statusText);
|
|
30
32
|
* });
|
|
31
33
|
*
|
|
32
|
-
*
|
|
33
|
-
* import {
|
|
34
|
+
* @example <caption>Mapping answers to other questions</caption>
|
|
35
|
+
* import { actorCalled, AnswersQuestions, UsesAbilities, Question } from '@serenity-js/core'
|
|
34
36
|
* import { CallAnApi, LastResponse } from '@serenity-js/rest'
|
|
35
37
|
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
36
38
|
*
|
|
@@ -39,12 +41,12 @@ const Interaction_1 = require("./Interaction");
|
|
|
39
41
|
* return LastResponse.status().answeredBy(actor) === 200;
|
|
40
42
|
* });
|
|
41
43
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
44
|
+
* await actorCalled('Quentin')
|
|
45
|
+
* .whoCan(CallAnApi.at('https://myapp.com/api'));
|
|
46
|
+
* .attemptsTo(
|
|
45
47
|
* Send.a(GetRequest.to('/books/0-688-00230-7')),
|
|
46
48
|
* Ensure.that(RequestWasSuccessful(), isTrue()),
|
|
47
|
-
*
|
|
49
|
+
* );
|
|
48
50
|
*
|
|
49
51
|
* @see {@link Actor}
|
|
50
52
|
* @see {@link Interaction}
|
|
@@ -71,6 +73,71 @@ class Question {
|
|
|
71
73
|
static about(description, body) {
|
|
72
74
|
return Question.createAdapter(new QuestionStatement(description, body));
|
|
73
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* @desc
|
|
78
|
+
* Generates a {@link QuestionAdapter} that recursively resolves
|
|
79
|
+
* any {@link Answerable} fields of the provided object,
|
|
80
|
+
* including {@link Answerable} fields of nested objects.
|
|
81
|
+
*
|
|
82
|
+
* Optionally, the method accepts `overrides` to be shallow-merged with the fields of the original `source`, producing a new merged object.
|
|
83
|
+
*
|
|
84
|
+
* Overrides are applied from left to right, with subsequent objects overwriting property assignments of the previous ones.
|
|
85
|
+
*
|
|
86
|
+
* @example <caption>Resolving an object recursively</caption>
|
|
87
|
+
* import { actorCalled, Question } from '@serenity-js/core'
|
|
88
|
+
* import { Send, PostRequest } from '@serenity-js/rest'
|
|
89
|
+
* import { By, Text, PageElement } from '@serenity-js/web'
|
|
90
|
+
*
|
|
91
|
+
* actorCalled('Daisy')
|
|
92
|
+
* .whoCan(CallAnApi.at('https://api.example.org'))
|
|
93
|
+
* .attemptsTo(
|
|
94
|
+
* Send.a(
|
|
95
|
+
* PostRequest.to('/products/2')
|
|
96
|
+
* .with(Question.fromObject({
|
|
97
|
+
* name: Text.of(PageElement.located(By.css('.name'))),
|
|
98
|
+
* }))
|
|
99
|
+
* )
|
|
100
|
+
* );
|
|
101
|
+
*
|
|
102
|
+
* @example <caption>Resolving an object recursively</caption>
|
|
103
|
+
* import { actorCalled, Question } from '@serenity-js/core'
|
|
104
|
+
* import { Send, PostRequest } from '@serenity-js/rest'
|
|
105
|
+
* import { By, Text, PageElement } from '@serenity-js/web'
|
|
106
|
+
*
|
|
107
|
+
* actorCalled('Daisy')
|
|
108
|
+
* .whoCan(CallAnApi.at('https://api.example.org'))
|
|
109
|
+
* .attemptsTo(
|
|
110
|
+
* Send.a(
|
|
111
|
+
* PostRequest.to('/products/2')
|
|
112
|
+
* .with(Question.fromObject({
|
|
113
|
+
* name: Text.of(PageElement.located(By.css('.name'))),
|
|
114
|
+
* quantity: undefined,
|
|
115
|
+
* }, {
|
|
116
|
+
* quantity: 2,
|
|
117
|
+
* }))
|
|
118
|
+
* )
|
|
119
|
+
* );
|
|
120
|
+
*
|
|
121
|
+
* @param {Answerable<O>} source
|
|
122
|
+
* @param {Array<Answerable<Partial<O>>>} overrides
|
|
123
|
+
*
|
|
124
|
+
* @returns {QuestionAdapter<Record<Key, Value>>>}
|
|
125
|
+
*
|
|
126
|
+
* @see {@link WithAnswerableProperties}
|
|
127
|
+
* @see {@link RecursivelyAnswered}
|
|
128
|
+
*/
|
|
129
|
+
static fromObject(source, ...overrides) {
|
|
130
|
+
return Question.about('value', async (actor) => {
|
|
131
|
+
if (source === null || source === undefined) {
|
|
132
|
+
return source;
|
|
133
|
+
}
|
|
134
|
+
const sources = [];
|
|
135
|
+
for (const [i, currentSource] of [source, ...overrides].entries()) {
|
|
136
|
+
sources.push(await recursivelyAnswer(actor, currentSource, `argument ${i}`));
|
|
137
|
+
}
|
|
138
|
+
return Object.assign({}, ...sources);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
74
141
|
/**
|
|
75
142
|
* @desc
|
|
76
143
|
* Checks if the value is a {@link Question}.
|
|
@@ -152,9 +219,7 @@ class Question {
|
|
|
152
219
|
return `${targetDescription} ${parameters[0]}`;
|
|
153
220
|
}
|
|
154
221
|
const parameterDescriptions = [
|
|
155
|
-
'(',
|
|
156
|
-
parameters.map(p => (0, io_1.f) `${p}`).join(', '),
|
|
157
|
-
')'
|
|
222
|
+
'(', parameters.map(p => (0, io_1.f) `${p}`).join(', '), ')',
|
|
158
223
|
].join('');
|
|
159
224
|
return `${targetDescription}${parameterDescriptions}`;
|
|
160
225
|
}
|
|
@@ -183,10 +248,7 @@ class QuestionStatement extends Interaction_1.Interaction {
|
|
|
183
248
|
return new IsPresent((0, io_1.f) `${this}.isPresent()`, this.body);
|
|
184
249
|
}
|
|
185
250
|
async answeredBy(actor) {
|
|
186
|
-
|
|
187
|
-
return isDefined(result)
|
|
188
|
-
? result
|
|
189
|
-
: undefined;
|
|
251
|
+
return await this.body(actor);
|
|
190
252
|
}
|
|
191
253
|
async performAs(actor) {
|
|
192
254
|
await this.body(actor);
|
|
@@ -251,4 +313,33 @@ function isDefined(value) {
|
|
|
251
313
|
return value !== undefined
|
|
252
314
|
&& value !== null;
|
|
253
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* @package
|
|
318
|
+
*/
|
|
319
|
+
const maxRecursiveCallsLimit = 100;
|
|
320
|
+
/**
|
|
321
|
+
* @package
|
|
322
|
+
*/
|
|
323
|
+
async function recursivelyAnswer(actor, answerable, description, currentRecursion = 0) {
|
|
324
|
+
if (currentRecursion >= maxRecursiveCallsLimit) {
|
|
325
|
+
throw new errors_1.LogicError(`Question.fromObject() has reached the limit of ${maxRecursiveCallsLimit} recursive calls while trying to resolve ${description}. Could it contain cyclic references?`);
|
|
326
|
+
}
|
|
327
|
+
const answer = await actor.answer(answerable);
|
|
328
|
+
if ((0, objects_1.isRecord)(answer)) {
|
|
329
|
+
const entries = Object.entries(answer);
|
|
330
|
+
const answeredEntries = [];
|
|
331
|
+
for (const [key, value] of entries) {
|
|
332
|
+
answeredEntries.push([key, await recursivelyAnswer(actor, value, description, currentRecursion + 1)]);
|
|
333
|
+
}
|
|
334
|
+
return Object.fromEntries(answeredEntries);
|
|
335
|
+
}
|
|
336
|
+
if (Array.isArray(answer)) {
|
|
337
|
+
const answeredEntries = [];
|
|
338
|
+
for (const item of answer) {
|
|
339
|
+
answeredEntries.push(await recursivelyAnswer(actor, item, description, currentRecursion + 1));
|
|
340
|
+
}
|
|
341
|
+
return answeredEntries;
|
|
342
|
+
}
|
|
343
|
+
return answer;
|
|
344
|
+
}
|
|
254
345
|
//# sourceMappingURL=Question.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../src/screenplay/Question.ts"],"names":[],"mappings":";;;AAAA,8BAA0B;AAG1B,+CAA4C;
|
|
1
|
+
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../src/screenplay/Question.ts"],"names":[],"mappings":";;;AAAA,oDAAkD;AAElD,sCAAuC;AACvC,8BAA0B;AAG1B,+CAA4C;AAK5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,gBAAgB,GAAG,CAAC,CAAM,CAAC,CAAC;SACtG;QAED,OAAO,eAA0C,CAAC;KACrD;IAED,OAAO,MAAsB,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Question } from './Question';
|
|
2
|
+
/**
|
|
3
|
+
* @desc
|
|
4
|
+
* Describes a recursively resolved plain JavaScript {@link WithAnswerableProperties}.
|
|
5
|
+
* Typically, used in conjunction with {@link Question.fromObject}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import {
|
|
9
|
+
* actorCalled, notes, q, Question, QuestionAdapter, WithAnswerableProperties
|
|
10
|
+
* } from '@serenity-js/core';
|
|
11
|
+
*
|
|
12
|
+
* interface RequestConfiguration {
|
|
13
|
+
* headers: Record<string, string>;
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* const requestConfiguration: WithAnswerableProperties<RequestConfiguration> = {
|
|
17
|
+
* headers: {
|
|
18
|
+
* Authorization: q`Bearer ${ notes().get('authDetails').token }`
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* const question: QuestionAdapter<RequestConfiguration> =
|
|
23
|
+
* Question.fromObject<RequestConfiguration>(requestConfiguration)
|
|
24
|
+
*
|
|
25
|
+
* const answer = await actorCalled('Annie').answer(question);
|
|
26
|
+
*
|
|
27
|
+
* const a1: RequestConfiguration = answer;
|
|
28
|
+
* const a2: RecursivelyAnswered<WithAnswerableProperties<RequestConfiguration>> = answer;
|
|
29
|
+
*
|
|
30
|
+
* // RequestConfiguration === RecursivelyAnswered<WithAnswerableProperties<RequestConfiguration>>
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*
|
|
34
|
+
* @typedef {object} RecursivelyAnswered<T>
|
|
35
|
+
*/
|
|
36
|
+
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 ? {
|
|
37
|
+
[K in keyof T]: RecursivelyAnswered<T[K]>;
|
|
38
|
+
} : T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecursivelyAnswered.js","sourceRoot":"","sources":["../../src/screenplay/RecursivelyAnswered.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Answerable } from './Answerable';
|
|
2
|
+
import { Question } from './Question';
|
|
3
|
+
/**
|
|
4
|
+
* @desc
|
|
5
|
+
* Describes a plain JavaScript object with {@link Answerable} properties.
|
|
6
|
+
* Typically, used in conjunction with {@link RecursivelyAnswered} and {@link Question.fromObject}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import {
|
|
10
|
+
* actorCalled, notes, q, Question, QuestionAdapter, WithAnswerableProperties
|
|
11
|
+
* } from '@serenity-js/core';
|
|
12
|
+
*
|
|
13
|
+
* interface RequestConfiguration {
|
|
14
|
+
* headers: Record<string, string>;
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* const requestConfiguration: WithAnswerableProperties<RequestConfiguration> = {
|
|
18
|
+
* headers: {
|
|
19
|
+
* Authorization: q`Bearer ${ notes().get('authDetails').token }`
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* const question: QuestionAdapter<RequestConfiguration> =
|
|
24
|
+
* Question.fromObject<RequestConfiguration>(requestConfiguration)
|
|
25
|
+
*
|
|
26
|
+
* const answer: RequestConfiguration = await actorCalled('Annie').answer(question);
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*
|
|
30
|
+
* @typedef {object} WithAnswerableProperties<T>
|
|
31
|
+
*/
|
|
32
|
+
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 ? Answerable<{
|
|
33
|
+
[K in keyof T]: WithAnswerableProperties<T[K]>;
|
|
34
|
+
}> : Answerable<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithAnswerableProperties.js","sourceRoot":"","sources":["../../src/screenplay/WithAnswerableProperties.ts"],"names":[],"mappings":""}
|
|
@@ -4,11 +4,12 @@ export * from './AbilityType';
|
|
|
4
4
|
export * from './Activity';
|
|
5
5
|
export * from './actor';
|
|
6
6
|
export * from './Answerable';
|
|
7
|
-
export * from './DynamicRecord';
|
|
8
7
|
export * from './Interaction';
|
|
9
8
|
export * from './interactions';
|
|
10
9
|
export * from './notes';
|
|
11
10
|
export * from './Optional';
|
|
12
11
|
export * from './Question';
|
|
13
12
|
export * from './questions';
|
|
13
|
+
export * from './RecursivelyAnswered';
|
|
14
14
|
export * from './Task';
|
|
15
|
+
export * from './WithAnswerableProperties';
|
package/lib/screenplay/index.js
CHANGED
|
@@ -20,12 +20,13 @@ __exportStar(require("./AbilityType"), exports);
|
|
|
20
20
|
__exportStar(require("./Activity"), exports);
|
|
21
21
|
__exportStar(require("./actor"), exports);
|
|
22
22
|
__exportStar(require("./Answerable"), exports);
|
|
23
|
-
__exportStar(require("./DynamicRecord"), exports);
|
|
24
23
|
__exportStar(require("./Interaction"), exports);
|
|
25
24
|
__exportStar(require("./interactions"), exports);
|
|
26
25
|
__exportStar(require("./notes"), exports);
|
|
27
26
|
__exportStar(require("./Optional"), exports);
|
|
28
27
|
__exportStar(require("./Question"), exports);
|
|
29
28
|
__exportStar(require("./questions"), exports);
|
|
29
|
+
__exportStar(require("./RecursivelyAnswered"), exports);
|
|
30
30
|
__exportStar(require("./Task"), exports);
|
|
31
|
+
__exportStar(require("./WithAnswerableProperties"), exports);
|
|
31
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,
|
|
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,0CAAwB;AACxB,6CAA2B;AAC3B,6CAA2B;AAC3B,8CAA4B;AAC5B,wDAAsC;AACtC,yCAAuB;AACvB,6DAA2C"}
|
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Check"), exports);
|
|
18
|
-
__exportStar(require("./Dictionary"), exports);
|
|
19
18
|
__exportStar(require("./Expectation"), exports);
|
|
20
19
|
__exportStar(require("./expectations"), exports);
|
|
21
20
|
__exportStar(require("./List"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenplay/questions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenplay/questions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,gDAA8B;AAC9B,iDAA+B;AAC/B,yCAAuB;AACvB,iDAA+B;AAC/B,sCAAoB"}
|
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.19",
|
|
4
4
|
"description": "Serenity/JS Screenplay, reporting engine and core interfaces.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -36,13 +36,12 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"cuid": "^2.1.8",
|
|
38
38
|
"diff": "^5.0.0",
|
|
39
|
-
"error-stack-parser": "2.1.
|
|
39
|
+
"error-stack-parser": "2.1.4",
|
|
40
40
|
"fast-glob": "^3.2.11",
|
|
41
41
|
"filenamify": "^4.3.0",
|
|
42
42
|
"graceful-fs": "^4.2.10",
|
|
43
43
|
"moment": "^2.29.3",
|
|
44
44
|
"semver": "^7.3.7",
|
|
45
|
-
"stackframe": "1.3.0",
|
|
46
45
|
"tiny-types": "^1.18.4",
|
|
47
46
|
"upath": "^2.0.1"
|
|
48
47
|
},
|
|
@@ -72,5 +71,5 @@
|
|
|
72
71
|
"node": "^14 || ^16",
|
|
73
72
|
"npm": "^6 || ^7 || ^8"
|
|
74
73
|
},
|
|
75
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "dda2a6eab593e2525aa67888f197e48f2e3ae148"
|
|
76
75
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import StackFrame from 'stackframe';
|
|
1
|
+
import * as parser from 'error-stack-parser';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* @desc
|
|
@@ -10,7 +9,7 @@ import StackFrame from 'stackframe';
|
|
|
10
9
|
* @package
|
|
11
10
|
*/
|
|
12
11
|
export class ErrorStackParser {
|
|
13
|
-
parse(error: Error): StackFrame[] {
|
|
12
|
+
parse(error: Error): parser.StackFrame[] {
|
|
14
13
|
return parser.parse(error);
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -12,13 +12,15 @@ export interface RequestAndResponse extends JSONObject {
|
|
|
12
12
|
request: {
|
|
13
13
|
url: string;
|
|
14
14
|
method: string;
|
|
15
|
-
headers:
|
|
15
|
+
headers: Record<string, string | number | boolean>;
|
|
16
16
|
data?: any;
|
|
17
17
|
};
|
|
18
18
|
response: {
|
|
19
19
|
status: number;
|
|
20
20
|
data?: any;
|
|
21
|
-
headers?:
|
|
21
|
+
headers?: Record<string, string> & {
|
|
22
|
+
'set-cookie'?: string[]
|
|
23
|
+
};
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
|