@serenity-js/web 3.25.0 → 3.25.2
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 +19 -0
- package/README.md +1 -1
- package/lib/errors/BrowserWindowClosedError.d.ts +2 -2
- package/lib/errors/BrowserWindowClosedError.js +2 -2
- package/lib/errors/CookieMissingError.d.ts +2 -2
- package/lib/errors/CookieMissingError.js +2 -2
- package/lib/errors/ModalDialogObstructsScreenshotError.d.ts +3 -3
- package/lib/errors/ModalDialogObstructsScreenshotError.js +3 -3
- package/lib/expectations/isActive.d.ts +8 -8
- package/lib/expectations/isActive.js +8 -8
- package/lib/expectations/isClickable.d.ts +8 -8
- package/lib/expectations/isClickable.js +8 -8
- package/lib/expectations/isEnabled.d.ts +8 -8
- package/lib/expectations/isEnabled.js +8 -8
- package/lib/expectations/isSelected.d.ts +8 -8
- package/lib/expectations/isSelected.js +8 -8
- package/lib/expectations/isVisible.d.ts +8 -8
- package/lib/expectations/isVisible.js +8 -8
- package/lib/screenplay/abilities/BrowseTheWeb.d.ts +25 -23
- package/lib/screenplay/abilities/BrowseTheWeb.d.ts.map +1 -1
- package/lib/screenplay/abilities/BrowseTheWeb.js +25 -23
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +1 -1
- package/lib/screenplay/interactions/Clear.d.ts +7 -7
- package/lib/screenplay/interactions/Clear.js +7 -7
- package/lib/screenplay/interactions/Click.d.ts +5 -5
- package/lib/screenplay/interactions/Click.js +5 -5
- package/lib/screenplay/interactions/DoubleClick.d.ts +5 -5
- package/lib/screenplay/interactions/DoubleClick.js +5 -5
- package/lib/screenplay/interactions/Enter.d.ts +5 -5
- package/lib/screenplay/interactions/Enter.js +5 -5
- package/lib/screenplay/interactions/ExecuteScript.d.ts +19 -19
- package/lib/screenplay/interactions/ExecuteScript.js +18 -18
- package/lib/screenplay/interactions/Hover.d.ts +5 -5
- package/lib/screenplay/interactions/Hover.js +5 -5
- package/lib/screenplay/interactions/Navigate.d.ts +8 -8
- package/lib/screenplay/interactions/Navigate.js +8 -8
- package/lib/screenplay/interactions/PageElementInteraction.d.ts +3 -3
- package/lib/screenplay/interactions/PageElementInteraction.js +3 -3
- package/lib/screenplay/interactions/Press.d.ts +10 -10
- package/lib/screenplay/interactions/Press.js +10 -10
- package/lib/screenplay/interactions/RightClick.d.ts +5 -5
- package/lib/screenplay/interactions/RightClick.js +5 -5
- package/lib/screenplay/interactions/Scroll.d.ts +5 -5
- package/lib/screenplay/interactions/Scroll.js +5 -5
- package/lib/screenplay/interactions/Select.d.ts +22 -22
- package/lib/screenplay/interactions/Select.js +22 -22
- package/lib/screenplay/interactions/Switch.d.ts +16 -16
- package/lib/screenplay/interactions/Switch.js +16 -16
- package/lib/screenplay/interactions/TakeScreenshot.d.ts +11 -10
- package/lib/screenplay/interactions/TakeScreenshot.d.ts.map +1 -1
- package/lib/screenplay/interactions/TakeScreenshot.js +11 -10
- package/lib/screenplay/interactions/TakeScreenshot.js.map +1 -1
- package/lib/screenplay/models/BrowserCapabilities.d.ts +1 -1
- package/lib/screenplay/models/BrowsingSession.d.ts +8 -8
- package/lib/screenplay/models/BrowsingSession.js +6 -6
- package/lib/screenplay/models/Cookie.d.ts +10 -10
- package/lib/screenplay/models/Cookie.js +9 -9
- package/lib/screenplay/models/CookieData.d.ts +4 -4
- package/lib/screenplay/models/Key.d.ts +4 -4
- package/lib/screenplay/models/Key.js +4 -4
- package/lib/screenplay/models/Locator.d.ts +8 -8
- package/lib/screenplay/models/Locator.js +8 -8
- package/lib/screenplay/models/Page.d.ts +32 -32
- package/lib/screenplay/models/Page.js +14 -14
- package/lib/screenplay/models/PageElement.d.ts +13 -13
- package/lib/screenplay/models/PageElement.js +7 -7
- package/lib/screenplay/models/PageElements.d.ts +6 -6
- package/lib/screenplay/models/PageElements.js +6 -6
- package/lib/screenplay/models/RootLocator.d.ts +5 -5
- package/lib/screenplay/models/RootLocator.js +5 -5
- package/lib/screenplay/models/SelectOption.d.ts +4 -4
- package/lib/screenplay/models/SelectOption.js +4 -4
- package/lib/screenplay/models/Switchable.d.ts +6 -6
- package/lib/screenplay/models/SwitchableOrigin.d.ts +4 -4
- package/lib/screenplay/models/dialogs/AbsentModalDialog.d.ts +2 -2
- package/lib/screenplay/models/dialogs/AbsentModalDialog.js +2 -2
- package/lib/screenplay/models/dialogs/AcceptedModalDialog.d.ts +3 -3
- package/lib/screenplay/models/dialogs/AcceptedModalDialog.js +3 -3
- package/lib/screenplay/models/dialogs/DismissedModalDialog.d.ts +3 -3
- package/lib/screenplay/models/dialogs/DismissedModalDialog.js +3 -3
- package/lib/screenplay/models/dialogs/ModalDialog.d.ts +12 -9
- package/lib/screenplay/models/dialogs/ModalDialog.d.ts.map +1 -1
- package/lib/screenplay/models/dialogs/ModalDialog.js +10 -7
- package/lib/screenplay/models/dialogs/ModalDialog.js.map +1 -1
- package/lib/screenplay/models/dialogs/ModalDialogHandler.d.ts +5 -5
- package/lib/screenplay/models/dialogs/ModalDialogHandler.js +5 -5
- package/lib/screenplay/models/selectors/By.d.ts +14 -14
- package/lib/screenplay/models/selectors/By.js +14 -14
- package/lib/screenplay/models/selectors/ByCss.d.ts +2 -2
- package/lib/screenplay/models/selectors/ByCss.js +2 -2
- package/lib/screenplay/models/selectors/ByCssContainingText.d.ts +2 -2
- package/lib/screenplay/models/selectors/ByCssContainingText.js +2 -2
- package/lib/screenplay/models/selectors/ByDeepCss.d.ts +2 -2
- package/lib/screenplay/models/selectors/ByDeepCss.js +2 -2
- package/lib/screenplay/models/selectors/ById.d.ts +2 -2
- package/lib/screenplay/models/selectors/ById.js +2 -2
- package/lib/screenplay/models/selectors/ByTagName.d.ts +2 -2
- package/lib/screenplay/models/selectors/ByTagName.js +2 -2
- package/lib/screenplay/models/selectors/ByXPath.d.ts +2 -2
- package/lib/screenplay/models/selectors/ByXPath.js +2 -2
- package/lib/screenplay/models/selectors/Selector.d.ts +1 -1
- package/lib/screenplay/models/selectors/Selector.js +1 -1
- package/lib/screenplay/questions/Attribute.d.ts +13 -13
- package/lib/screenplay/questions/Attribute.js +13 -13
- package/lib/screenplay/questions/ComputedStyle.d.ts +16 -16
- package/lib/screenplay/questions/ComputedStyle.js +16 -16
- package/lib/screenplay/questions/CssClasses.d.ts +13 -13
- package/lib/screenplay/questions/CssClasses.js +13 -13
- package/lib/screenplay/questions/LastScriptExecution.d.ts +7 -7
- package/lib/screenplay/questions/LastScriptExecution.js +7 -7
- package/lib/screenplay/questions/Selected.d.ts +17 -17
- package/lib/screenplay/questions/Selected.js +17 -17
- package/lib/screenplay/questions/Text.d.ts +18 -18
- package/lib/screenplay/questions/Text.js +14 -14
- package/lib/screenplay/questions/Value.d.ts +12 -12
- package/lib/screenplay/questions/Value.js +12 -12
- package/lib/stage/crew/photographer/Photographer.d.ts +18 -17
- package/lib/stage/crew/photographer/Photographer.d.ts.map +1 -1
- package/lib/stage/crew/photographer/Photographer.js +18 -17
- package/lib/stage/crew/photographer/Photographer.js.map +1 -1
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +6 -6
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +6 -6
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +3 -3
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +3 -3
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +3 -3
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +3 -3
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +3 -3
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +3 -3
- package/package.json +5 -5
- package/src/errors/BrowserWindowClosedError.ts +2 -2
- package/src/errors/CookieMissingError.ts +2 -2
- package/src/errors/ModalDialogObstructsScreenshotError.ts +3 -3
- package/src/expectations/isActive.ts +8 -8
- package/src/expectations/isClickable.ts +8 -8
- package/src/expectations/isEnabled.ts +8 -8
- package/src/expectations/isSelected.ts +8 -8
- package/src/expectations/isVisible.ts +8 -8
- package/src/screenplay/abilities/BrowseTheWeb.ts +25 -23
- package/src/screenplay/interactions/Clear.ts +7 -7
- package/src/screenplay/interactions/Click.ts +5 -5
- package/src/screenplay/interactions/DoubleClick.ts +5 -5
- package/src/screenplay/interactions/Enter.ts +5 -5
- package/src/screenplay/interactions/ExecuteScript.ts +19 -19
- package/src/screenplay/interactions/Hover.ts +5 -5
- package/src/screenplay/interactions/Navigate.ts +8 -8
- package/src/screenplay/interactions/PageElementInteraction.ts +3 -3
- package/src/screenplay/interactions/Press.ts +10 -10
- package/src/screenplay/interactions/RightClick.ts +5 -5
- package/src/screenplay/interactions/Scroll.ts +5 -5
- package/src/screenplay/interactions/Select.ts +22 -22
- package/src/screenplay/interactions/Switch.ts +16 -16
- package/src/screenplay/interactions/TakeScreenshot.ts +11 -10
- package/src/screenplay/models/BrowserCapabilities.ts +1 -1
- package/src/screenplay/models/BrowsingSession.ts +8 -8
- package/src/screenplay/models/Cookie.ts +10 -10
- package/src/screenplay/models/CookieData.ts +4 -4
- package/src/screenplay/models/Key.ts +4 -4
- package/src/screenplay/models/Locator.ts +8 -8
- package/src/screenplay/models/Page.ts +32 -32
- package/src/screenplay/models/PageElement.ts +13 -13
- package/src/screenplay/models/PageElements.ts +6 -6
- package/src/screenplay/models/RootLocator.ts +5 -5
- package/src/screenplay/models/SelectOption.ts +4 -4
- package/src/screenplay/models/Switchable.ts +6 -6
- package/src/screenplay/models/SwitchableOrigin.ts +4 -4
- package/src/screenplay/models/dialogs/AbsentModalDialog.ts +2 -2
- package/src/screenplay/models/dialogs/AcceptedModalDialog.ts +3 -3
- package/src/screenplay/models/dialogs/DismissedModalDialog.ts +3 -3
- package/src/screenplay/models/dialogs/ModalDialog.ts +12 -9
- package/src/screenplay/models/dialogs/ModalDialogHandler.ts +5 -5
- package/src/screenplay/models/selectors/By.ts +14 -14
- package/src/screenplay/models/selectors/ByCss.ts +2 -2
- package/src/screenplay/models/selectors/ByCssContainingText.ts +2 -2
- package/src/screenplay/models/selectors/ByDeepCss.ts +2 -2
- package/src/screenplay/models/selectors/ById.ts +2 -2
- package/src/screenplay/models/selectors/ByTagName.ts +2 -2
- package/src/screenplay/models/selectors/ByXPath.ts +2 -2
- package/src/screenplay/models/selectors/Selector.ts +1 -1
- package/src/screenplay/questions/Attribute.ts +13 -13
- package/src/screenplay/questions/ComputedStyle.ts +16 -16
- package/src/screenplay/questions/CssClasses.ts +13 -13
- package/src/screenplay/questions/LastScriptExecution.ts +7 -7
- package/src/screenplay/questions/Selected.ts +17 -17
- package/src/screenplay/questions/Text.ts +18 -18
- package/src/screenplay/questions/Value.ts +12 -12
- package/src/stage/crew/photographer/Photographer.ts +18 -17
- package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +6 -6
- package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +3 -3
- package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +3 -3
- package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +3 -3
|
@@ -2,7 +2,7 @@ import type { Answerable, Optional, QuestionAdapter, WithAnswerableProperties }
|
|
|
2
2
|
import { Interaction, Timestamp } from '@serenity-js/core';
|
|
3
3
|
import type { CookieData } from './CookieData';
|
|
4
4
|
/**
|
|
5
|
-
* A Screenplay Pattern-style model responsible for managing cookies available to the current
|
|
5
|
+
* A Screenplay Pattern-style model responsible for managing cookies available to the current [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
6
6
|
*
|
|
7
7
|
* ## Checking if a cookie exists
|
|
8
8
|
*
|
|
@@ -63,21 +63,21 @@ import type { CookieData } from './CookieData';
|
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
65
|
* ## Learn more
|
|
66
|
-
* -
|
|
67
|
-
* -
|
|
66
|
+
* - [`CookieData`](https://serenity-js.org/api/web/interface/CookieData/)
|
|
67
|
+
* - [`Page.cookie`](https://serenity-js.org/api/web/class/Page/#cookie)
|
|
68
68
|
*
|
|
69
69
|
* @group Models
|
|
70
70
|
*/
|
|
71
71
|
export declare abstract class Cookie implements Optional {
|
|
72
72
|
protected readonly cookieName: string;
|
|
73
73
|
/**
|
|
74
|
-
* Creates a
|
|
74
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to [`Cookie`](https://serenity-js.org/api/web/class/Cookie/) identified by `name`.
|
|
75
75
|
*
|
|
76
76
|
* @param name
|
|
77
77
|
*/
|
|
78
78
|
static called(name: Answerable<string>): QuestionAdapter<Cookie>;
|
|
79
79
|
/**
|
|
80
|
-
* Sets a cookie for the current
|
|
80
|
+
* Sets a cookie for the current [`Page`](https://serenity-js.org/api/web/class/Page/). Note that [`CookieData`](https://serenity-js.org/api/web/interface/CookieData/) can be either a plain-old JavaScript object, or an [`Answerable`](https://serenity-js.org/api/core/#Answerable) [`WithAnswerableProperties`](https://serenity-js.org/api/core/#WithAnswerableProperties).
|
|
81
81
|
*
|
|
82
82
|
* :::info
|
|
83
83
|
* Make sure that the actor performing this interaction is on the page that should receive the cookie.
|
|
@@ -88,7 +88,7 @@ export declare abstract class Cookie implements Optional {
|
|
|
88
88
|
*/
|
|
89
89
|
static set(cookieData: Answerable<WithAnswerableProperties<CookieData>>): Interaction;
|
|
90
90
|
/**
|
|
91
|
-
* Creates an
|
|
91
|
+
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to delete all cookies available to the current [`Page`](https://serenity-js.org/api/web/class/Page/)..
|
|
92
92
|
*/
|
|
93
93
|
static deleteAll(): Interaction;
|
|
94
94
|
private cookie;
|
|
@@ -101,7 +101,7 @@ export declare abstract class Cookie implements Optional {
|
|
|
101
101
|
* Checks if a given cookie is set.
|
|
102
102
|
*
|
|
103
103
|
* #### Learn more
|
|
104
|
-
* -
|
|
104
|
+
* - [`Optional`](https://serenity-js.org/api/core/interface/Optional/)
|
|
105
105
|
*/
|
|
106
106
|
isPresent(): Promise<boolean>;
|
|
107
107
|
/**
|
|
@@ -134,7 +134,7 @@ export declare abstract class Cookie implements Optional {
|
|
|
134
134
|
* Returns the expiry date of a given cookie
|
|
135
135
|
*
|
|
136
136
|
* #### Learn more
|
|
137
|
-
* -
|
|
137
|
+
* - [`Timestamp`](https://serenity-js.org/api/core/class/Timestamp/)
|
|
138
138
|
*/
|
|
139
139
|
expiry(): Promise<Timestamp>;
|
|
140
140
|
/**
|
|
@@ -147,11 +147,11 @@ export declare abstract class Cookie implements Optional {
|
|
|
147
147
|
* This method is to be implemented by test integration tool-specific adapters.
|
|
148
148
|
*
|
|
149
149
|
* **Please note**: you don't need to implement any response caching here
|
|
150
|
-
* since it is covered by
|
|
150
|
+
* since it is covered by [`Cookie`](https://serenity-js.org/api/web/class/Cookie/).lazyLoadCookie} method.
|
|
151
151
|
*/
|
|
152
152
|
protected abstract read(): Promise<CookieData>;
|
|
153
153
|
/**
|
|
154
|
-
* Invokes
|
|
154
|
+
* Invokes `Cookie.read` and caches the result in memory.
|
|
155
155
|
*/
|
|
156
156
|
private lazyLoadCookie;
|
|
157
157
|
}
|
|
@@ -6,7 +6,7 @@ const tiny_types_1 = require("tiny-types");
|
|
|
6
6
|
const errors_1 = require("../../errors");
|
|
7
7
|
const abilities_1 = require("../abilities");
|
|
8
8
|
/**
|
|
9
|
-
* A Screenplay Pattern-style model responsible for managing cookies available to the current
|
|
9
|
+
* A Screenplay Pattern-style model responsible for managing cookies available to the current [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
10
10
|
*
|
|
11
11
|
* ## Checking if a cookie exists
|
|
12
12
|
*
|
|
@@ -67,15 +67,15 @@ const abilities_1 = require("../abilities");
|
|
|
67
67
|
* ```
|
|
68
68
|
*
|
|
69
69
|
* ## Learn more
|
|
70
|
-
* -
|
|
71
|
-
* -
|
|
70
|
+
* - [`CookieData`](https://serenity-js.org/api/web/interface/CookieData/)
|
|
71
|
+
* - [`Page.cookie`](https://serenity-js.org/api/web/class/Page/#cookie)
|
|
72
72
|
*
|
|
73
73
|
* @group Models
|
|
74
74
|
*/
|
|
75
75
|
class Cookie {
|
|
76
76
|
cookieName;
|
|
77
77
|
/**
|
|
78
|
-
* Creates a
|
|
78
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to [`Cookie`](https://serenity-js.org/api/web/class/Cookie/) identified by `name`.
|
|
79
79
|
*
|
|
80
80
|
* @param name
|
|
81
81
|
*/
|
|
@@ -87,7 +87,7 @@ class Cookie {
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* Sets a cookie for the current
|
|
90
|
+
* Sets a cookie for the current [`Page`](https://serenity-js.org/api/web/class/Page/). Note that [`CookieData`](https://serenity-js.org/api/web/interface/CookieData/) can be either a plain-old JavaScript object, or an [`Answerable`](https://serenity-js.org/api/core/#Answerable) [`WithAnswerableProperties`](https://serenity-js.org/api/core/#WithAnswerableProperties).
|
|
91
91
|
*
|
|
92
92
|
* :::info
|
|
93
93
|
* Make sure that the actor performing this interaction is on the page that should receive the cookie.
|
|
@@ -114,7 +114,7 @@ class Cookie {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
* Creates an
|
|
117
|
+
* Creates an [interaction](https://serenity-js.org/api/core/class/Interaction/) to delete all cookies available to the current [`Page`](https://serenity-js.org/api/web/class/Page/)..
|
|
118
118
|
*/
|
|
119
119
|
static deleteAll() {
|
|
120
120
|
return core_1.Interaction.where(`#actor deletes all cookies`, async (actor) => {
|
|
@@ -137,7 +137,7 @@ class Cookie {
|
|
|
137
137
|
* Checks if a given cookie is set.
|
|
138
138
|
*
|
|
139
139
|
* #### Learn more
|
|
140
|
-
* -
|
|
140
|
+
* - [`Optional`](https://serenity-js.org/api/core/interface/Optional/)
|
|
141
141
|
*/
|
|
142
142
|
async isPresent() {
|
|
143
143
|
try {
|
|
@@ -196,14 +196,14 @@ class Cookie {
|
|
|
196
196
|
* Returns the expiry date of a given cookie
|
|
197
197
|
*
|
|
198
198
|
* #### Learn more
|
|
199
|
-
* -
|
|
199
|
+
* - [`Timestamp`](https://serenity-js.org/api/core/class/Timestamp/)
|
|
200
200
|
*/
|
|
201
201
|
async expiry() {
|
|
202
202
|
const cookie = await this.lazyLoadCookie();
|
|
203
203
|
return cookie.expiry;
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
|
-
* Invokes
|
|
206
|
+
* Invokes `Cookie.read` and caches the result in memory.
|
|
207
207
|
*/
|
|
208
208
|
async lazyLoadCookie() {
|
|
209
209
|
if (!this.cookie) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Timestamp } from '@serenity-js/core';
|
|
2
2
|
/**
|
|
3
|
-
* A data structure describing a
|
|
3
|
+
* A data structure describing a [`Cookie`](https://serenity-js.org/api/web/class/Cookie/) to be set, or one that's been read.
|
|
4
4
|
*
|
|
5
5
|
* ## Learn more
|
|
6
6
|
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - [`Cookie`](https://serenity-js.org/api/web/class/Cookie/)
|
|
8
|
+
* - [`Page.cookie`](https://serenity-js.org/api/web/class/Page/#cookie)
|
|
9
9
|
*
|
|
10
10
|
* @group Models
|
|
11
11
|
*/
|
|
@@ -29,7 +29,7 @@ export interface CookieData {
|
|
|
29
29
|
*/
|
|
30
30
|
path?: string;
|
|
31
31
|
/**
|
|
32
|
-
* The
|
|
32
|
+
* The [timestamp](https://serenity-js.org/api/core/class/Timestamp/) describing the point in time when this cookie expires.
|
|
33
33
|
*/
|
|
34
34
|
expiry?: Timestamp;
|
|
35
35
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Represents keyboard keys that aren't text, and that can be used with the
|
|
2
|
+
* Represents keyboard keys that aren't text, and that can be used with the [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`Press`](https://serenity-js.org/api/web/class/Press/).
|
|
3
3
|
*
|
|
4
|
-
* **Note:** Modifier keys like
|
|
4
|
+
* **Note:** Modifier keys like [`Key.Shift`](https://serenity-js.org/api/web/class/Key/#Shift), [`Key.Alt`](https://serenity-js.org/api/web/class/Key/#Alt) and [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta) (a.k.a. "Command" on Mac) will stay pressed,
|
|
5
5
|
* so there's no need to depress them.
|
|
6
6
|
*
|
|
7
7
|
* ## Learn more
|
|
8
8
|
*
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
9
|
+
* - [`Press`](https://serenity-js.org/api/web/class/Press/)
|
|
10
|
+
* - [`Page.sendKeys`](https://serenity-js.org/api/web/class/Page/#sendKeys)
|
|
11
11
|
* - [W3C WebDriver Spec: Keyboard Actions](https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions)
|
|
12
12
|
* - [Selenium WebDriver: Inputs](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/lib/input.js#L46)
|
|
13
13
|
* - [WebdriverIO: Constants](https://github.com/webdriverio/webdriverio/blob/main/packages/wdio-utils/src/constants.ts#L5)
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Key = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Represents keyboard keys that aren't text, and that can be used with the
|
|
5
|
+
* Represents keyboard keys that aren't text, and that can be used with the [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`Press`](https://serenity-js.org/api/web/class/Press/).
|
|
6
6
|
*
|
|
7
|
-
* **Note:** Modifier keys like
|
|
7
|
+
* **Note:** Modifier keys like [`Key.Shift`](https://serenity-js.org/api/web/class/Key/#Shift), [`Key.Alt`](https://serenity-js.org/api/web/class/Key/#Alt) and [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta) (a.k.a. "Command" on Mac) will stay pressed,
|
|
8
8
|
* so there's no need to depress them.
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
11
|
*
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
12
|
+
* - [`Press`](https://serenity-js.org/api/web/class/Press/)
|
|
13
|
+
* - [`Page.sendKeys`](https://serenity-js.org/api/web/class/Page/#sendKeys)
|
|
14
14
|
* - [W3C WebDriver Spec: Keyboard Actions](https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions)
|
|
15
15
|
* - [Selenium WebDriver: Inputs](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/lib/input.js#L46)
|
|
16
16
|
* - [WebdriverIO: Constants](https://github.com/webdriverio/webdriverio/blob/main/packages/wdio-utils/src/constants.ts#L5)
|
|
@@ -4,14 +4,14 @@ import type { PageElement } from './PageElement';
|
|
|
4
4
|
import { RootLocator } from './RootLocator';
|
|
5
5
|
import { ByCss, type Selector } from './selectors';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* within the
|
|
7
|
+
* [`Locator`](https://serenity-js.org/api/web/class/Locator/) uses a [`Selector`](https://serenity-js.org/api/web/class/Selector/) to locate a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) or [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
8
|
+
* within the [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
11
|
+
* - [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/)
|
|
12
|
+
* - [`Page.locate`](https://serenity-js.org/api/web/class/Page/#locate)
|
|
13
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
14
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
15
15
|
*
|
|
16
16
|
* @group Models
|
|
17
17
|
*/
|
|
@@ -29,10 +29,10 @@ export declare abstract class Locator<Native_Element_Type, Native_Selector_Type
|
|
|
29
29
|
abstract closestTo(child: Locator<Native_Element_Type>): Locator<Native_Element_Type>;
|
|
30
30
|
abstract locate(child: Locator<Native_Element_Type>): Locator<Native_Element_Type>;
|
|
31
31
|
/**
|
|
32
|
-
* Expresses
|
|
32
|
+
* Expresses [`ByCss`](https://serenity-js.org/api/web/class/ByCss/), [`ById`](https://serenity-js.org/api/web/class/ById/), or [`ByTagName`](https://serenity-js.org/api/web/class/ByTagName/) as a [`ByCss`](https://serenity-js.org/api/web/class/ByCss/) selector.
|
|
33
33
|
*
|
|
34
34
|
* @throws LogicError
|
|
35
|
-
* if the `selector` can't be expressed as
|
|
35
|
+
* if the `selector` can't be expressed as [`ByCss`](https://serenity-js.org/api/web/class/ByCss/)
|
|
36
36
|
*
|
|
37
37
|
* @param selector
|
|
38
38
|
* @protected
|
|
@@ -30,14 +30,14 @@ const util = __importStar(require("util")); // eslint-disable-line unicorn/impor
|
|
|
30
30
|
const RootLocator_1 = require("./RootLocator");
|
|
31
31
|
const selectors_1 = require("./selectors");
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
* within the
|
|
33
|
+
* [`Locator`](https://serenity-js.org/api/web/class/Locator/) uses a [`Selector`](https://serenity-js.org/api/web/class/Selector/) to locate a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) or [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
34
|
+
* within the [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
35
35
|
*
|
|
36
36
|
* ## Learn more
|
|
37
|
-
* -
|
|
38
|
-
* -
|
|
39
|
-
* -
|
|
40
|
-
* -
|
|
37
|
+
* - [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/)
|
|
38
|
+
* - [`Page.locate`](https://serenity-js.org/api/web/class/Page/#locate)
|
|
39
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
40
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
41
41
|
*
|
|
42
42
|
* @group Models
|
|
43
43
|
*/
|
|
@@ -59,10 +59,10 @@ class Locator extends RootLocator_1.RootLocator {
|
|
|
59
59
|
await this.parent.switchToMainFrame();
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Expresses
|
|
62
|
+
* Expresses [`ByCss`](https://serenity-js.org/api/web/class/ByCss/), [`ById`](https://serenity-js.org/api/web/class/ById/), or [`ByTagName`](https://serenity-js.org/api/web/class/ByTagName/) as a [`ByCss`](https://serenity-js.org/api/web/class/ByCss/) selector.
|
|
63
63
|
*
|
|
64
64
|
* @throws LogicError
|
|
65
|
-
* if the `selector` can't be expressed as
|
|
65
|
+
* if the `selector` can't be expressed as [`ByCss`](https://serenity-js.org/api/web/class/ByCss/)
|
|
66
66
|
*
|
|
67
67
|
* @param selector
|
|
68
68
|
* @protected
|
|
@@ -119,10 +119,10 @@ import type { SwitchableOrigin } from './SwitchableOrigin';
|
|
|
119
119
|
*
|
|
120
120
|
* ## Learn more
|
|
121
121
|
*
|
|
122
|
-
* -
|
|
123
|
-
* -
|
|
124
|
-
* -
|
|
125
|
-
* -
|
|
122
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
123
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
124
|
+
* - [`Optional`](https://serenity-js.org/api/core/interface/Optional/)
|
|
125
|
+
* - [`Switchable`](https://serenity-js.org/api/web/interface/Switchable/)
|
|
126
126
|
*
|
|
127
127
|
* @group Models
|
|
128
128
|
*/
|
|
@@ -132,12 +132,12 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
132
132
|
protected modalDialogHandler: ModalDialogHandler;
|
|
133
133
|
readonly id: CorrelationId;
|
|
134
134
|
/**
|
|
135
|
-
* Creates a
|
|
135
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) representing the currently active [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
136
136
|
*/
|
|
137
137
|
static current(): QuestionAdapter<Page>;
|
|
138
138
|
/**
|
|
139
|
-
* Creates a
|
|
140
|
-
* meets the
|
|
139
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a [`Page`](https://serenity-js.org/api/web/class/Page/) which [`Page.name`](https://serenity-js.org/api/web/class/Page/#name)
|
|
140
|
+
* meets the [expectation](https://serenity-js.org/api/core/class/Expectation/).
|
|
141
141
|
*
|
|
142
142
|
* #### Switching to a page with the desired name
|
|
143
143
|
*
|
|
@@ -155,8 +155,8 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
155
155
|
*/
|
|
156
156
|
static whichName(expectation: Expectation<string>): QuestionAdapter<Page>;
|
|
157
157
|
/**
|
|
158
|
-
* Creates a
|
|
159
|
-
* meets the
|
|
158
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a [`Page`](https://serenity-js.org/api/web/class/Page/) which [`Page.title`](https://serenity-js.org/api/web/class/Page/#title)
|
|
159
|
+
* meets the [expectation](https://serenity-js.org/api/core/class/Expectation/).
|
|
160
160
|
*
|
|
161
161
|
* #### Switching to a page with the desired title
|
|
162
162
|
*
|
|
@@ -174,8 +174,8 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
174
174
|
*/
|
|
175
175
|
static whichTitle(expectation: Expectation<string>): QuestionAdapter<Page>;
|
|
176
176
|
/**
|
|
177
|
-
* Creates a
|
|
178
|
-
* meets the
|
|
177
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a [`Page`](https://serenity-js.org/api/web/class/Page/) which [`Page.url`](https://serenity-js.org/api/web/class/Page/#url)
|
|
178
|
+
* meets the [expectation](https://serenity-js.org/api/core/class/Expectation/).
|
|
179
179
|
*
|
|
180
180
|
* #### Switching to a page with the desired URL
|
|
181
181
|
*
|
|
@@ -195,19 +195,19 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
195
195
|
private static findMatchingPage;
|
|
196
196
|
constructor(session: BrowsingSession<Page<Native_Element_Type>>, rootLocator: RootLocator<Native_Element_Type>, modalDialogHandler: ModalDialogHandler, id: CorrelationId);
|
|
197
197
|
/**
|
|
198
|
-
* Creates a
|
|
198
|
+
* Creates a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) wrapping a native element.
|
|
199
199
|
*
|
|
200
200
|
* @param nativeElement
|
|
201
201
|
*/
|
|
202
202
|
abstract createPageElement(nativeElement: Native_Element_Type): PageElement<Native_Element_Type>;
|
|
203
203
|
/**
|
|
204
|
-
* Creates a
|
|
204
|
+
* Creates a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/), retrieving an element located by [`Selector`](https://serenity-js.org/api/web/class/Selector/).
|
|
205
205
|
*
|
|
206
206
|
* @param selector
|
|
207
207
|
*/
|
|
208
208
|
abstract locate(selector: Selector): PageElement<Native_Element_Type>;
|
|
209
209
|
/**
|
|
210
|
-
* Creates
|
|
210
|
+
* Creates [`PageElement`](https://serenity-js.org/api/web/class/PageElements/), retrieving a collection of elements located by [`Selector`](https://serenity-js.org/api/web/class/Selector/).
|
|
211
211
|
*
|
|
212
212
|
* @param selector
|
|
213
213
|
*/
|
|
@@ -228,7 +228,7 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
228
228
|
abstract navigateTo(destination: string): Promise<void>;
|
|
229
229
|
/**
|
|
230
230
|
* Causes the browser to traverse one step backward in the joint session history
|
|
231
|
-
* of the current
|
|
231
|
+
* of the current [`Page`](https://serenity-js.org/api/web/class/Page/) (the current top-level browsing context).
|
|
232
232
|
*
|
|
233
233
|
* This is equivalent to pressing the back button in the browser UI,
|
|
234
234
|
* or calling [`window.history.back`](https://developer.mozilla.org/en-US/docs/Web/API/History/back).
|
|
@@ -236,18 +236,18 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
236
236
|
abstract navigateBack(): Promise<void>;
|
|
237
237
|
/**
|
|
238
238
|
* Causes the browser to traverse one step forward in the joint session history
|
|
239
|
-
* of the current
|
|
239
|
+
* of the current [`Page`](https://serenity-js.org/api/web/class/Page/) (the current top-level browsing context).
|
|
240
240
|
*
|
|
241
241
|
* This is equivalent to pressing the back button in the browser UI,
|
|
242
242
|
* or calling [`window.history.forward`](https://developer.mozilla.org/en-US/docs/Web/API/History/forward).
|
|
243
243
|
*/
|
|
244
244
|
abstract navigateForward(): Promise<void>;
|
|
245
245
|
/**
|
|
246
|
-
* Causes the browser to reload the
|
|
246
|
+
* Causes the browser to reload the [`Page`](https://serenity-js.org/api/web/class/Page/) in the current top-level browsing context.
|
|
247
247
|
*/
|
|
248
248
|
abstract reload(): Promise<void>;
|
|
249
249
|
/**
|
|
250
|
-
* Send a sequence of
|
|
250
|
+
* Send a sequence of [`Key`](https://serenity-js.org/api/web/class/Key/) strokes to the active element.
|
|
251
251
|
*
|
|
252
252
|
* @param keys
|
|
253
253
|
* Keys to enter
|
|
@@ -273,7 +273,7 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
273
273
|
* If the script has a return value (i.e. if the script contains a `return` statement),
|
|
274
274
|
* then the following steps will be taken for resolving this functions return value:
|
|
275
275
|
*
|
|
276
|
-
* - For a
|
|
276
|
+
* - For a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/), the value will resolve to a [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement)
|
|
277
277
|
* - `null` and `undefined` return values will resolve to `null`
|
|
278
278
|
* - `boolean`, `number`, and `string` values will resolve as is
|
|
279
279
|
* - Functions will resolve to their string representation
|
|
@@ -291,7 +291,7 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
291
291
|
*
|
|
292
292
|
* #### Learn more
|
|
293
293
|
* - [Selenium WebDriver: JavaScript Executor](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/JavascriptExecutor.html#executeAsyncScript-java.lang.String-java.lang.Object...-)
|
|
294
|
-
* -
|
|
294
|
+
* - [`Page.lastScriptExecutionResult`](https://serenity-js.org/api/web/class/Page/#lastScriptExecutionResult)
|
|
295
295
|
*
|
|
296
296
|
* @param script
|
|
297
297
|
* @param args
|
|
@@ -309,7 +309,7 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
309
309
|
* Arrays and objects may also be used as script arguments as long as each item adheres
|
|
310
310
|
* to the types previously mentioned.
|
|
311
311
|
*
|
|
312
|
-
* Unlike executing synchronous JavaScript with
|
|
312
|
+
* Unlike executing synchronous JavaScript with [`Page.executeScript`](https://serenity-js.org/api/web/class/Page/#executeScript),
|
|
313
313
|
* scripts executed with this function must explicitly signal they are finished by invoking the provided callback.
|
|
314
314
|
*
|
|
315
315
|
* This callback will always be injected into the executed function as the last argument,
|
|
@@ -318,7 +318,7 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
318
318
|
* The following steps will be taken for resolving this functions return value against
|
|
319
319
|
* the first argument to the script's callback function:
|
|
320
320
|
*
|
|
321
|
-
* - For a
|
|
321
|
+
* - For a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/), the value will resolve to a [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement)
|
|
322
322
|
* - `null` and `undefined` return values will resolve to `null`
|
|
323
323
|
* - `boolean`, `number`, and `string` values will resolve as is
|
|
324
324
|
* - Functions will resolve to their string representation
|
|
@@ -347,21 +347,21 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
347
347
|
*
|
|
348
348
|
* #### Learn more
|
|
349
349
|
* - [Selenium WebDriver: JavaScript Executor](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/JavascriptExecutor.html#executeAsyncScript-java.lang.String-java.lang.Object...-)
|
|
350
|
-
* -
|
|
350
|
+
* - [`Page.lastScriptExecutionResult`](https://serenity-js.org/api/web/class/Page/#lastScriptExecutionResult)
|
|
351
351
|
*
|
|
352
352
|
* @param script
|
|
353
353
|
* @param args
|
|
354
354
|
*/
|
|
355
355
|
abstract executeAsyncScript<Result, Parameters extends any[]>(script: string | ((...args: [...parameters: Parameters, callback: (result: Result) => void]) => void), ...args: Parameters): Promise<Result>;
|
|
356
356
|
/**
|
|
357
|
-
* Returns the last result of calling
|
|
358
|
-
* or
|
|
357
|
+
* Returns the last result of calling [`Page.executeAsyncScript`](https://serenity-js.org/api/web/class/Page/#executeAsyncScript)
|
|
358
|
+
* or [`Page.executeScript`](https://serenity-js.org/api/web/class/Page/#executeScript)
|
|
359
359
|
*/
|
|
360
360
|
abstract lastScriptExecutionResult<R = any>(): R;
|
|
361
361
|
/**
|
|
362
362
|
* Take a screenshot of the top-level browsing context's viewport.
|
|
363
363
|
*
|
|
364
|
-
* @throws
|
|
364
|
+
* @throws [`BrowserWindowClosedError`](https://serenity-js.org/api/web/class/BrowserWindowClosedError/)
|
|
365
365
|
* When the page you're trying to take the screenshot of has already been closed
|
|
366
366
|
*
|
|
367
367
|
* @return
|
|
@@ -369,14 +369,14 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
369
369
|
*/
|
|
370
370
|
abstract takeScreenshot(): Promise<string>;
|
|
371
371
|
/**
|
|
372
|
-
* Retrieves a cookie identified by `name` and visible to this
|
|
372
|
+
* Retrieves a cookie identified by `name` and visible to this [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
373
373
|
*
|
|
374
374
|
* @param name
|
|
375
375
|
*/
|
|
376
376
|
abstract cookie(name: string): Promise<Cookie>;
|
|
377
377
|
/**
|
|
378
|
-
* Adds a single cookie with
|
|
379
|
-
* with the active
|
|
378
|
+
* Adds a single cookie with [`CookieData`](https://serenity-js.org/api/web/interface/CookieData/) to the cookie store associated
|
|
379
|
+
* with the active [`Page`](https://serenity-js.org/api/web/class/Page/)'s address.
|
|
380
380
|
*
|
|
381
381
|
* @param cookieData
|
|
382
382
|
*/
|
|
@@ -427,8 +427,8 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
427
427
|
* to the previous context when needed.
|
|
428
428
|
*
|
|
429
429
|
* ## Learn more
|
|
430
|
-
* -
|
|
431
|
-
* -
|
|
430
|
+
* - [`Switch`](https://serenity-js.org/api/web/class/Switch/)
|
|
431
|
+
* - [`Switchable`](https://serenity-js.org/api/web/interface/Switchable/)
|
|
432
432
|
*/
|
|
433
433
|
switchTo(): Promise<SwitchableOrigin>;
|
|
434
434
|
/**
|
|
@@ -440,7 +440,7 @@ export declare abstract class Page<Native_Element_Type = any> implements Optiona
|
|
|
440
440
|
*/
|
|
441
441
|
abstract closeOthers(): Promise<void>;
|
|
442
442
|
/**
|
|
443
|
-
* Returns the
|
|
443
|
+
* Returns the [`ModalDialogHandler`](https://serenity-js.org/api/web/class/ModalDialogHandler/) for the current [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
444
444
|
*/
|
|
445
445
|
modalDialog(): ModalDialogHandler;
|
|
446
446
|
/**
|
|
@@ -110,10 +110,10 @@ const abilities_1 = require("../abilities");
|
|
|
110
110
|
*
|
|
111
111
|
* ## Learn more
|
|
112
112
|
*
|
|
113
|
-
* -
|
|
114
|
-
* -
|
|
115
|
-
* -
|
|
116
|
-
* -
|
|
113
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
114
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
115
|
+
* - [`Optional`](https://serenity-js.org/api/core/interface/Optional/)
|
|
116
|
+
* - [`Switchable`](https://serenity-js.org/api/web/interface/Switchable/)
|
|
117
117
|
*
|
|
118
118
|
* @group Models
|
|
119
119
|
*/
|
|
@@ -123,7 +123,7 @@ class Page {
|
|
|
123
123
|
modalDialogHandler;
|
|
124
124
|
id;
|
|
125
125
|
/**
|
|
126
|
-
* Creates a
|
|
126
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) representing the currently active [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
127
127
|
*/
|
|
128
128
|
static current() {
|
|
129
129
|
return core_1.Question.about('current page', actor => {
|
|
@@ -131,8 +131,8 @@ class Page {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
* Creates a
|
|
135
|
-
* meets the
|
|
134
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a [`Page`](https://serenity-js.org/api/web/class/Page/) which [`Page.name`](https://serenity-js.org/api/web/class/Page/#name)
|
|
135
|
+
* meets the [expectation](https://serenity-js.org/api/core/class/Expectation/).
|
|
136
136
|
*
|
|
137
137
|
* #### Switching to a page with the desired name
|
|
138
138
|
*
|
|
@@ -155,8 +155,8 @@ class Page {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* Creates a
|
|
159
|
-
* meets the
|
|
158
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a [`Page`](https://serenity-js.org/api/web/class/Page/) which [`Page.title`](https://serenity-js.org/api/web/class/Page/#title)
|
|
159
|
+
* meets the [expectation](https://serenity-js.org/api/core/class/Expectation/).
|
|
160
160
|
*
|
|
161
161
|
* #### Switching to a page with the desired title
|
|
162
162
|
*
|
|
@@ -179,8 +179,8 @@ class Page {
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
|
-
* Creates a
|
|
183
|
-
* meets the
|
|
182
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a [`Page`](https://serenity-js.org/api/web/class/Page/) which [`Page.url`](https://serenity-js.org/api/web/class/Page/#url)
|
|
183
|
+
* meets the [expectation](https://serenity-js.org/api/core/class/Expectation/).
|
|
184
184
|
*
|
|
185
185
|
* #### Switching to a page with the desired URL
|
|
186
186
|
*
|
|
@@ -227,8 +227,8 @@ class Page {
|
|
|
227
227
|
* to the previous context when needed.
|
|
228
228
|
*
|
|
229
229
|
* ## Learn more
|
|
230
|
-
* -
|
|
231
|
-
* -
|
|
230
|
+
* - [`Switch`](https://serenity-js.org/api/web/class/Switch/)
|
|
231
|
+
* - [`Switchable`](https://serenity-js.org/api/web/interface/Switchable/)
|
|
232
232
|
*/
|
|
233
233
|
async switchTo() {
|
|
234
234
|
const originalPage = await this.session.currentPage();
|
|
@@ -240,7 +240,7 @@ class Page {
|
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
|
-
* Returns the
|
|
243
|
+
* Returns the [`ModalDialogHandler`](https://serenity-js.org/api/web/class/ModalDialogHandler/) for the current [`Page`](https://serenity-js.org/api/web/class/Page/).
|
|
244
244
|
*/
|
|
245
245
|
modalDialog() {
|
|
246
246
|
return this.modalDialogHandler;
|