@serenity-js/web 3.25.0 → 3.25.1
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/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 +4 -4
- 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
|
@@ -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;
|
|
@@ -5,13 +5,13 @@ import type { Selector } from './selectors';
|
|
|
5
5
|
import type { Switchable } from './Switchable';
|
|
6
6
|
import type { SwitchableOrigin } from './SwitchableOrigin';
|
|
7
7
|
/**
|
|
8
|
-
* Uses the
|
|
9
|
-
* a single Web element located by
|
|
8
|
+
* Uses the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to identify
|
|
9
|
+
* a single Web element located by [`Selector`](https://serenity-js.org/api/web/class/Selector/).
|
|
10
10
|
*
|
|
11
11
|
* ## Learn more
|
|
12
|
-
* - [Page Element Query Language](/handbook/web-testing/page-element-query-language)
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
12
|
+
* - [Page Element Query Language](https://serenity-js.org/handbook/web-testing/page-element-query-language)
|
|
13
|
+
* - [`Optional`](https://serenity-js.org/api/core/interface/Optional/)
|
|
14
|
+
* - [`Switchable`](https://serenity-js.org/api/web/interface/Switchable/)
|
|
15
15
|
*
|
|
16
16
|
* @group Models
|
|
17
17
|
*/
|
|
@@ -21,7 +21,7 @@ export declare abstract class PageElement<Native_Element_Type = any> implements
|
|
|
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
23
|
/**
|
|
24
|
-
* A static method producing a
|
|
24
|
+
* A static method producing a [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/) that can be used with [`PageElements.eachMappedTo`](https://serenity-js.org/api/web/class/PageElements/#eachMappedTo) method
|
|
25
25
|
* to extract the HTML of each element in a collection.
|
|
26
26
|
*
|
|
27
27
|
* #### Example
|
|
@@ -54,7 +54,7 @@ export declare abstract class PageElement<Native_Element_Type = any> implements
|
|
|
54
54
|
abstract of(parentElement: PageElement<Native_Element_Type>): PageElement<Native_Element_Type>;
|
|
55
55
|
/**
|
|
56
56
|
* Traverses the element and its parents, heading toward the document root,
|
|
57
|
-
* until it finds a parent
|
|
57
|
+
* until it finds a parent [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) that matches its associated CSS selector.
|
|
58
58
|
*
|
|
59
59
|
* #### Example
|
|
60
60
|
*
|
|
@@ -89,9 +89,9 @@ export declare abstract class PageElement<Native_Element_Type = any> implements
|
|
|
89
89
|
* :::info
|
|
90
90
|
* This method relies on [Element: closest() API](https://developer.mozilla.org/en-US/docs/Web/API/Element/closest),
|
|
91
91
|
* and so is only compatible with locating parent elements specified using the following CSS selectors:
|
|
92
|
-
* -
|
|
93
|
-
* -
|
|
94
|
-
* -
|
|
92
|
+
* - [`ByCss`](https://serenity-js.org/api/web/class/ByCss/)
|
|
93
|
+
* - [`ById`](https://serenity-js.org/api/web/class/ById/)
|
|
94
|
+
* - [`ByTagName`](https://serenity-js.org/api/web/class/ByTagName/)
|
|
95
95
|
* :::
|
|
96
96
|
*
|
|
97
97
|
* @param childElement
|
|
@@ -150,8 +150,8 @@ export declare abstract class PageElement<Native_Element_Type = any> implements
|
|
|
150
150
|
* to the previous context if needed.
|
|
151
151
|
*
|
|
152
152
|
* #### Learn more
|
|
153
|
-
* -
|
|
154
|
-
* -
|
|
153
|
+
* - [`Switch`](https://serenity-js.org/api/web/class/Switch/)
|
|
154
|
+
* - [`Switchable`](https://serenity-js.org/api/web/interface/Switchable/)
|
|
155
155
|
*/
|
|
156
156
|
abstract switchTo(): Promise<SwitchableOrigin>;
|
|
157
157
|
/**
|
|
@@ -174,7 +174,7 @@ export declare abstract class PageElement<Native_Element_Type = any> implements
|
|
|
174
174
|
*/
|
|
175
175
|
abstract isEnabled(): Promise<boolean>;
|
|
176
176
|
/**
|
|
177
|
-
* Returns a
|
|
177
|
+
* Returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to `true` when the element
|
|
178
178
|
* is present in the [Document Object Model (DOM)](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model),
|
|
179
179
|
* `false` otherwise.
|
|
180
180
|
*/
|
|
@@ -5,13 +5,13 @@ const core_1 = require("@serenity-js/core");
|
|
|
5
5
|
const tiny_types_1 = require("tiny-types");
|
|
6
6
|
const abilities_1 = require("../abilities");
|
|
7
7
|
/**
|
|
8
|
-
* Uses the
|
|
9
|
-
* a single Web element located by
|
|
8
|
+
* Uses the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to identify
|
|
9
|
+
* a single Web element located by [`Selector`](https://serenity-js.org/api/web/class/Selector/).
|
|
10
10
|
*
|
|
11
11
|
* ## Learn more
|
|
12
|
-
* - [Page Element Query Language](/handbook/web-testing/page-element-query-language)
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
12
|
+
* - [Page Element Query Language](https://serenity-js.org/handbook/web-testing/page-element-query-language)
|
|
13
|
+
* - [`Optional`](https://serenity-js.org/api/core/interface/Optional/)
|
|
14
|
+
* - [`Switchable`](https://serenity-js.org/api/web/interface/Switchable/)
|
|
15
15
|
*
|
|
16
16
|
* @group Models
|
|
17
17
|
*/
|
|
@@ -38,7 +38,7 @@ class PageElement {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* A static method producing a
|
|
41
|
+
* A static method producing a [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/) that can be used with [`PageElements.eachMappedTo`](https://serenity-js.org/api/web/class/PageElements/#eachMappedTo) method
|
|
42
42
|
* to extract the HTML of each element in a collection.
|
|
43
43
|
*
|
|
44
44
|
* #### Example
|
|
@@ -81,7 +81,7 @@ class PageElement {
|
|
|
81
81
|
return `PageElement located ${this.locator.toString()}`;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Returns a
|
|
84
|
+
* Returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to `true` when the element
|
|
85
85
|
* is present in the [Document Object Model (DOM)](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model),
|
|
86
86
|
* `false` otherwise.
|
|
87
87
|
*/
|
|
@@ -3,15 +3,15 @@ import { MetaList } from '@serenity-js/core';
|
|
|
3
3
|
import type { PageElement } from './PageElement';
|
|
4
4
|
import type { Selector } from './selectors';
|
|
5
5
|
/**
|
|
6
|
-
* Uses the
|
|
7
|
-
* a group of Web elements located by
|
|
6
|
+
* Uses the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to identify
|
|
7
|
+
* a group of Web elements located by [`Selector`](https://serenity-js.org/api/web/class/Selector/).
|
|
8
8
|
*
|
|
9
9
|
* ## Learn more
|
|
10
10
|
*
|
|
11
|
-
* - [Page Element Query Language](/handbook/web-testing/page-element-query-language)
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
11
|
+
* - [Page Element Query Language](https://serenity-js.org/handbook/web-testing/page-element-query-language)
|
|
12
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)}
|
|
13
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
14
|
+
* - [`ChainableMetaQuestion`](https://serenity-js.org/api/core/interface/ChainableMetaQuestion/)
|
|
15
15
|
*
|
|
16
16
|
* @group Models
|
|
17
17
|
*/
|
|
@@ -4,15 +4,15 @@ exports.PageElements = void 0;
|
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
const PageElementsLocator_1 = require("./PageElementsLocator");
|
|
6
6
|
/**
|
|
7
|
-
* Uses the
|
|
8
|
-
* a group of Web elements located by
|
|
7
|
+
* Uses the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to identify
|
|
8
|
+
* a group of Web elements located by [`Selector`](https://serenity-js.org/api/web/class/Selector/).
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
11
|
*
|
|
12
|
-
* - [Page Element Query Language](/handbook/web-testing/page-element-query-language)
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
12
|
+
* - [Page Element Query Language](https://serenity-js.org/handbook/web-testing/page-element-query-language)
|
|
13
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)}
|
|
14
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
15
|
+
* - [`ChainableMetaQuestion`](https://serenity-js.org/api/core/interface/ChainableMetaQuestion/)
|
|
16
16
|
*
|
|
17
17
|
* @group Models
|
|
18
18
|
*/
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import type { Optional } from '@serenity-js/core';
|
|
3
3
|
import * as util from 'util';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/) represents the context in which [`Locator`](https://serenity-js.org/api/web/class/Locator/) looks for [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) or [`PageElement`](https://serenity-js.org/api/web/class/PageElements/).
|
|
6
6
|
* This context is either a parent element, or some representation of the top-level browsing context.
|
|
7
7
|
*
|
|
8
8
|
* ## Learn more
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
9
|
+
* - [`Locator`](https://serenity-js.org/api/web/class/Locator/)
|
|
10
|
+
* - [`Page.locate`](https://serenity-js.org/api/web/class/Page/#locate)
|
|
11
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
12
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
13
13
|
*
|
|
14
14
|
* @group Models
|
|
15
15
|
*/
|
|
@@ -27,14 +27,14 @@ exports.RootLocator = void 0;
|
|
|
27
27
|
const io_1 = require("@serenity-js/core/lib/io");
|
|
28
28
|
const util = __importStar(require("util")); // eslint-disable-line unicorn/import-style
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/) represents the context in which [`Locator`](https://serenity-js.org/api/web/class/Locator/) looks for [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) or [`PageElement`](https://serenity-js.org/api/web/class/PageElements/).
|
|
31
31
|
* This context is either a parent element, or some representation of the top-level browsing context.
|
|
32
32
|
*
|
|
33
33
|
* ## Learn more
|
|
34
|
-
* -
|
|
35
|
-
* -
|
|
36
|
-
* -
|
|
37
|
-
* -
|
|
34
|
+
* - [`Locator`](https://serenity-js.org/api/web/class/Locator/)
|
|
35
|
+
* - [`Page.locate`](https://serenity-js.org/api/web/class/Page/#locate)
|
|
36
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
37
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
38
38
|
*
|
|
39
39
|
* @group Models
|
|
40
40
|
*/
|