@serenity-js/web 3.24.1 → 3.25.0
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 +16 -0
- package/lib/screenplay/models/PageElement.d.ts +44 -1
- package/lib/screenplay/models/PageElement.d.ts.map +1 -1
- package/lib/screenplay/models/PageElement.js +30 -0
- package/lib/screenplay/models/PageElement.js.map +1 -1
- package/package.json +5 -5
- package/src/screenplay/models/PageElement.ts +54 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.25.0](https://github.com/serenity-js/serenity-js/compare/v3.24.1...v3.25.0) (2024-07-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **web:** renamed PageElement.outerHtml to PageElement.html for consistency with other methods ([9df6e0f](https://github.com/serenity-js/serenity-js/commit/9df6e0f2eece966d50ddac92e7550baa72bcb5f1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **web:** outerHtml lets you retrieve the HTML content of the given PageElement ([1bb6c6a](https://github.com/serenity-js/serenity-js/commit/1bb6c6afbfea3fb0c8883f9fe4aec385aa12ac27))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [3.24.1](https://github.com/serenity-js/serenity-js/compare/v3.24.0...v3.24.1) (2024-06-26)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @serenity-js/web
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Answerable, MetaQuestionAdapter, Optional } from '@serenity-js/core';
|
|
1
|
+
import type { Answerable, MetaQuestion, MetaQuestionAdapter, Optional, QuestionAdapter } from '@serenity-js/core';
|
|
2
2
|
import type { Locator } from './Locator';
|
|
3
3
|
import type { SelectOption } from './SelectOption';
|
|
4
4
|
import type { Selector } from './selectors';
|
|
@@ -20,6 +20,29 @@ export declare abstract class PageElement<Native_Element_Type = any> implements
|
|
|
20
20
|
static from<NET>(nativeElement: NET): MetaQuestionAdapter<PageElement<NET>, PageElement<NET>>;
|
|
21
21
|
static located<NET>(selector: Answerable<Selector>): MetaQuestionAdapter<PageElement<NET>, PageElement<NET>>;
|
|
22
22
|
static of<NET>(childElement: MetaQuestionAdapter<PageElement<NET>, PageElement<NET>> | PageElement<NET>, parentElement: Answerable<PageElement<NET>>): MetaQuestionAdapter<PageElement<NET>, PageElement<NET>>;
|
|
23
|
+
/**
|
|
24
|
+
* A static method producing a {@apilink MetaQuestion} that can be used with {@apilink PageElements.eachMappedTo} method
|
|
25
|
+
* to extract the HTML of each element in a collection.
|
|
26
|
+
*
|
|
27
|
+
* #### Example
|
|
28
|
+
*
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { actorCalled, Log } from '@serenity-js/core'
|
|
31
|
+
* import { Navigate, PageElement, By, Text } from '@serenity-js/web'
|
|
32
|
+
* import { includes } from '@serenity-js/assertions'
|
|
33
|
+
*
|
|
34
|
+
* await actorCalled('Debbie').attemptsTo(
|
|
35
|
+
* Navigate.to('https://serenity-js.org'),
|
|
36
|
+
*
|
|
37
|
+
* Log.the(
|
|
38
|
+
* PageElements.located(By.css('a'))
|
|
39
|
+
* .where(Text, includes('modular'))
|
|
40
|
+
* .eachMappedTo(PageElement.html())
|
|
41
|
+
* ),
|
|
42
|
+
* )
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
static html<NET>(): MetaQuestion<PageElement<NET>, QuestionAdapter<string>>;
|
|
23
46
|
constructor(locator: Locator<Native_Element_Type>);
|
|
24
47
|
/**
|
|
25
48
|
* Locates a child element that:
|
|
@@ -95,6 +118,26 @@ export declare abstract class PageElement<Native_Element_Type = any> implements
|
|
|
95
118
|
abstract attribute(name: string): Promise<string>;
|
|
96
119
|
abstract text(): Promise<string>;
|
|
97
120
|
abstract value(): Promise<string>;
|
|
121
|
+
/**
|
|
122
|
+
* An instance method that resolves to the value of the [`outerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML) property
|
|
123
|
+
* of the underlying element.
|
|
124
|
+
*
|
|
125
|
+
* #### Example
|
|
126
|
+
*
|
|
127
|
+
* ```typescript
|
|
128
|
+
* import { actorCalled, Log } from '@serenity-js/core'
|
|
129
|
+
* import { Navigate, PageElement, By } from '@serenity-js/web'
|
|
130
|
+
*
|
|
131
|
+
* await actorCalled('Debbie').attemptsTo(
|
|
132
|
+
* Navigate.to('https://serenity-js.org'),
|
|
133
|
+
*
|
|
134
|
+
* Log.the(
|
|
135
|
+
* PageElement.located(By.css('h1')).html()
|
|
136
|
+
* ),
|
|
137
|
+
* )
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
abstract html(): Promise<string>;
|
|
98
141
|
/**
|
|
99
142
|
* When the element represents an [`iframe`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe),
|
|
100
143
|
* calling this method switches the current browsing context to the given `iframe` context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageElement.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/PageElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"PageElement.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/PageElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAG,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAKlH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ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,gBAAgB,CAAC;IAE9C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAErC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAExC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAEtC;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAEvC;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;CACzC"}
|
|
@@ -37,6 +37,36 @@ class PageElement {
|
|
|
37
37
|
return actor.answer(child);
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* A static method producing a {@apilink MetaQuestion} that can be used with {@apilink PageElements.eachMappedTo} method
|
|
42
|
+
* to extract the HTML of each element in a collection.
|
|
43
|
+
*
|
|
44
|
+
* #### Example
|
|
45
|
+
*
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { actorCalled, Log } from '@serenity-js/core'
|
|
48
|
+
* import { Navigate, PageElement, By, Text } from '@serenity-js/web'
|
|
49
|
+
* import { includes } from '@serenity-js/assertions'
|
|
50
|
+
*
|
|
51
|
+
* await actorCalled('Debbie').attemptsTo(
|
|
52
|
+
* Navigate.to('https://serenity-js.org'),
|
|
53
|
+
*
|
|
54
|
+
* Log.the(
|
|
55
|
+
* PageElements.located(By.css('a'))
|
|
56
|
+
* .where(Text, includes('modular'))
|
|
57
|
+
* .eachMappedTo(PageElement.html())
|
|
58
|
+
* ),
|
|
59
|
+
* )
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
static html() {
|
|
63
|
+
return {
|
|
64
|
+
of: (pageElement) => core_1.Question.about(`outer HTML of ${pageElement}`, async (actor) => {
|
|
65
|
+
const element = await actor.answer(pageElement);
|
|
66
|
+
return element.html();
|
|
67
|
+
})
|
|
68
|
+
};
|
|
69
|
+
}
|
|
40
70
|
constructor(locator) {
|
|
41
71
|
this.locator = locator;
|
|
42
72
|
(0, tiny_types_1.ensure)('native element locator', locator, (0, tiny_types_1.isDefined)());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageElement.js","sourceRoot":"","sources":["../../../src/screenplay/models/PageElement.ts"],"names":[],"mappings":";;;AACA,4CAAkD;AAClD,2CAA+C;AAE/C,4CAA4C;AAO5C;;;;;;;;;;GAUG;AACH,MAAsB,WAAW;IA+
|
|
1
|
+
{"version":3,"file":"PageElement.js","sourceRoot":"","sources":["../../../src/screenplay/models/PageElement.ts"],"names":[],"mappings":";;;AACA,4CAAkD;AAClD,2CAA+C;AAE/C,4CAA4C;AAO5C;;;;;;;;;;GAUG;AACH,MAAsB,WAAW;IA+DD;IA7D5B,MAAM,CAAC,IAAI,CAAM,aAAkB;QAC/B,OAAO,eAAQ,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;YACvD,MAAM,WAAW,GAAG,MAAM,wBAAY,CAAC,EAAE,CAAoB,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAElF,OAAO,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,OAAO,CAAM,QAA8B;QAC9C,OAAO,eAAQ,CAAC,KAAK,CAAC,IAAA,UAAG,EAAA,wBAAyB,QAAS,EAAE,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;YACzE,MAAM,UAAU,GAAI,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACjD,MAAM,WAAW,GAAG,MAAM,wBAAY,CAAC,EAAE,CAAoB,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAElF,OAAO,WAAW,CAAC,MAAM,CAAC,UAAU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AS,EAAE,CAAC;IACpC,CAAC;CAoBJ;AA9OD,kCA8OC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.0",
|
|
4
4
|
"description": "Serenity/JS Screenplay Pattern APIs for the Web",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"node": "^16.13 || ^18.12 || ^20"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@serenity-js/assertions": "3.
|
|
49
|
-
"@serenity-js/core": "3.
|
|
48
|
+
"@serenity-js/assertions": "3.25.0",
|
|
49
|
+
"@serenity-js/core": "3.25.0",
|
|
50
50
|
"tiny-types": "1.22.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"@types/chai": "4.3.16",
|
|
55
55
|
"@types/mocha": "10.0.7",
|
|
56
56
|
"c8": "10.1.2",
|
|
57
|
-
"mocha": "10.
|
|
57
|
+
"mocha": "10.6.0",
|
|
58
58
|
"mocha-multi": "1.1.7",
|
|
59
59
|
"ts-node": "10.9.2",
|
|
60
60
|
"typescript": "5.2.2"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "22657b685b6002f75b2569db54f4bea31ab91d12"
|
|
63
63
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Answerable, MetaQuestionAdapter, Optional } from '@serenity-js/core';
|
|
1
|
+
import type { Answerable, MetaQuestion, MetaQuestionAdapter, Optional , QuestionAdapter} from '@serenity-js/core';
|
|
2
2
|
import { Question, the } from '@serenity-js/core';
|
|
3
3
|
import { ensure, isDefined } from 'tiny-types';
|
|
4
4
|
|
|
@@ -51,6 +51,38 @@ export abstract class PageElement<Native_Element_Type = any> implements Optional
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* A static method producing a {@apilink MetaQuestion} that can be used with {@apilink PageElements.eachMappedTo} method
|
|
56
|
+
* to extract the HTML of each element in a collection.
|
|
57
|
+
*
|
|
58
|
+
* #### Example
|
|
59
|
+
*
|
|
60
|
+
* ```typescript
|
|
61
|
+
* import { actorCalled, Log } from '@serenity-js/core'
|
|
62
|
+
* import { Navigate, PageElement, By, Text } from '@serenity-js/web'
|
|
63
|
+
* import { includes } from '@serenity-js/assertions'
|
|
64
|
+
*
|
|
65
|
+
* await actorCalled('Debbie').attemptsTo(
|
|
66
|
+
* Navigate.to('https://serenity-js.org'),
|
|
67
|
+
*
|
|
68
|
+
* Log.the(
|
|
69
|
+
* PageElements.located(By.css('a'))
|
|
70
|
+
* .where(Text, includes('modular'))
|
|
71
|
+
* .eachMappedTo(PageElement.html())
|
|
72
|
+
* ),
|
|
73
|
+
* )
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
static html<NET>(): MetaQuestion<PageElement<NET>, QuestionAdapter<string>> {
|
|
77
|
+
return {
|
|
78
|
+
of: (pageElement: Answerable<PageElement<NET>>) =>
|
|
79
|
+
Question.about(`outer HTML of ${pageElement}`, async actor => {
|
|
80
|
+
const element = await actor.answer(pageElement);
|
|
81
|
+
return element.html();
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
54
86
|
constructor(public readonly locator: Locator<Native_Element_Type>) {
|
|
55
87
|
ensure('native element locator', locator, isDefined());
|
|
56
88
|
}
|
|
@@ -139,6 +171,27 @@ export abstract class PageElement<Native_Element_Type = any> implements Optional
|
|
|
139
171
|
abstract text(): Promise<string>;
|
|
140
172
|
abstract value(): Promise<string>;
|
|
141
173
|
|
|
174
|
+
/**
|
|
175
|
+
* An instance method that resolves to the value of the [`outerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML) property
|
|
176
|
+
* of the underlying element.
|
|
177
|
+
*
|
|
178
|
+
* #### Example
|
|
179
|
+
*
|
|
180
|
+
* ```typescript
|
|
181
|
+
* import { actorCalled, Log } from '@serenity-js/core'
|
|
182
|
+
* import { Navigate, PageElement, By } from '@serenity-js/web'
|
|
183
|
+
*
|
|
184
|
+
* await actorCalled('Debbie').attemptsTo(
|
|
185
|
+
* Navigate.to('https://serenity-js.org'),
|
|
186
|
+
*
|
|
187
|
+
* Log.the(
|
|
188
|
+
* PageElement.located(By.css('h1')).html()
|
|
189
|
+
* ),
|
|
190
|
+
* )
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
abstract html(): Promise<string>;
|
|
194
|
+
|
|
142
195
|
/**
|
|
143
196
|
* When the element represents an [`iframe`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe),
|
|
144
197
|
* calling this method switches the current browsing context to the given `iframe` context.
|