@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,19 +1,19 @@
|
|
|
1
1
|
import type { Answerable } from '@serenity-js/core';
|
|
2
2
|
import { Interaction } from '@serenity-js/core';
|
|
3
3
|
/**
|
|
4
|
-
* Instructs an
|
|
4
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
5
5
|
* to navigate to a specific destination, as well as back and forth in the browser history,
|
|
6
6
|
* or reload the current page.
|
|
7
7
|
*
|
|
8
8
|
* ## Learn more
|
|
9
9
|
*
|
|
10
|
-
* -
|
|
10
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
11
11
|
*
|
|
12
12
|
* @group Activities
|
|
13
13
|
*/
|
|
14
14
|
export declare class Navigate {
|
|
15
15
|
/**
|
|
16
|
-
* Instructs an
|
|
16
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
17
17
|
* to navigate to a given URL.
|
|
18
18
|
*
|
|
19
19
|
* The URL can be:
|
|
@@ -51,19 +51,19 @@ export declare class Navigate {
|
|
|
51
51
|
*
|
|
52
52
|
* #### Learn more
|
|
53
53
|
*
|
|
54
|
-
* -
|
|
54
|
+
* - [`Page.navigateTo`](https://serenity-js.org/api/web/class/Page/#navigateTo)
|
|
55
55
|
* - [WebdriverIO: Configuration Options](https://webdriver.io/docs/options/#baseurl)
|
|
56
56
|
* - [Playwright: Browser](https://playwright.dev/docs/api/class-browser#browser-new-context)
|
|
57
57
|
* - [Playwright: Test Options](https://playwright.dev/docs/api/class-testoptions#test-options-base-url)
|
|
58
58
|
* - [Protractor: Configuration](https://github.com/angular/protractor/blob/master/lib/config.ts)
|
|
59
59
|
*
|
|
60
60
|
* @param url
|
|
61
|
-
* An absolute URL or path an
|
|
61
|
+
* An absolute URL or path an [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
62
62
|
* should navigate to
|
|
63
63
|
*/
|
|
64
64
|
static to(url: Answerable<string>): Interaction;
|
|
65
65
|
/**
|
|
66
|
-
* Instructs an
|
|
66
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
67
67
|
* to navigate back one page in the joint session history of the current top-level browsing context.
|
|
68
68
|
*
|
|
69
69
|
* #### Navigate back in browsing history
|
|
@@ -87,7 +87,7 @@ export declare class Navigate {
|
|
|
87
87
|
*/
|
|
88
88
|
static back(): Interaction;
|
|
89
89
|
/**
|
|
90
|
-
* Instructs an
|
|
90
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
91
91
|
* to navigate forward one page in the joint session history of the current top-level browsing context.
|
|
92
92
|
*
|
|
93
93
|
* #### Navigate forward in browsing history
|
|
@@ -112,7 +112,7 @@ export declare class Navigate {
|
|
|
112
112
|
*/
|
|
113
113
|
static forward(): Interaction;
|
|
114
114
|
/**
|
|
115
|
-
* Instructs an
|
|
115
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
116
116
|
* to reload the current page.
|
|
117
117
|
*
|
|
118
118
|
* #### Navigate to path relative to baseUrl
|
|
@@ -4,19 +4,19 @@ exports.Navigate = void 0;
|
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
const abilities_1 = require("../abilities");
|
|
6
6
|
/**
|
|
7
|
-
* Instructs an
|
|
7
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
8
8
|
* to navigate to a specific destination, as well as back and forth in the browser history,
|
|
9
9
|
* or reload the current page.
|
|
10
10
|
*
|
|
11
11
|
* ## Learn more
|
|
12
12
|
*
|
|
13
|
-
* -
|
|
13
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
14
14
|
*
|
|
15
15
|
* @group Activities
|
|
16
16
|
*/
|
|
17
17
|
class Navigate {
|
|
18
18
|
/**
|
|
19
|
-
* Instructs an
|
|
19
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
20
20
|
* to navigate to a given URL.
|
|
21
21
|
*
|
|
22
22
|
* The URL can be:
|
|
@@ -54,21 +54,21 @@ class Navigate {
|
|
|
54
54
|
*
|
|
55
55
|
* #### Learn more
|
|
56
56
|
*
|
|
57
|
-
* -
|
|
57
|
+
* - [`Page.navigateTo`](https://serenity-js.org/api/web/class/Page/#navigateTo)
|
|
58
58
|
* - [WebdriverIO: Configuration Options](https://webdriver.io/docs/options/#baseurl)
|
|
59
59
|
* - [Playwright: Browser](https://playwright.dev/docs/api/class-browser#browser-new-context)
|
|
60
60
|
* - [Playwright: Test Options](https://playwright.dev/docs/api/class-testoptions#test-options-base-url)
|
|
61
61
|
* - [Protractor: Configuration](https://github.com/angular/protractor/blob/master/lib/config.ts)
|
|
62
62
|
*
|
|
63
63
|
* @param url
|
|
64
|
-
* An absolute URL or path an
|
|
64
|
+
* An absolute URL or path an [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
65
65
|
* should navigate to
|
|
66
66
|
*/
|
|
67
67
|
static to(url) {
|
|
68
68
|
return new NavigateToUrl(url);
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
|
-
* Instructs an
|
|
71
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
72
72
|
* to navigate back one page in the joint session history of the current top-level browsing context.
|
|
73
73
|
*
|
|
74
74
|
* #### Navigate back in browsing history
|
|
@@ -97,7 +97,7 @@ class Navigate {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* Instructs an
|
|
100
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
101
101
|
* to navigate forward one page in the joint session history of the current top-level browsing context.
|
|
102
102
|
*
|
|
103
103
|
* #### Navigate forward in browsing history
|
|
@@ -127,7 +127,7 @@ class Navigate {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
|
-
* Instructs an
|
|
130
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
131
131
|
* to reload the current page.
|
|
132
132
|
*
|
|
133
133
|
* #### Navigate to path relative to baseUrl
|
|
@@ -3,17 +3,17 @@ import { Interaction } from '@serenity-js/core';
|
|
|
3
3
|
import type { FileSystemLocation } from '@serenity-js/core/lib/io';
|
|
4
4
|
import type { PageElement } from '../models';
|
|
5
5
|
/**
|
|
6
|
-
* A base class for interactions with
|
|
6
|
+
* A base class for interactions with [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) objects.
|
|
7
7
|
*
|
|
8
8
|
* **Note:** The recommended way to implement custom interactions
|
|
9
|
-
* in your code is to use the
|
|
9
|
+
* in your code is to use the [`Interaction.where`](https://serenity-js.org/api/core/class/Interaction/#where) factory method.
|
|
10
10
|
*
|
|
11
11
|
* @group Activities
|
|
12
12
|
*/
|
|
13
13
|
export declare abstract class PageElementInteraction extends Interaction {
|
|
14
14
|
protected constructor(description: Answerable<string>, location?: FileSystemLocation);
|
|
15
15
|
/**
|
|
16
|
-
* Returns the resolved
|
|
16
|
+
* Returns the resolved [`PageElement`](https://serenity-js.org/api/web/class/PageElement/), or throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
17
17
|
* if the element is `undefined`.
|
|
18
18
|
*
|
|
19
19
|
* @param actor
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageElementInteraction = void 0;
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
/**
|
|
6
|
-
* A base class for interactions with
|
|
6
|
+
* A base class for interactions with [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) objects.
|
|
7
7
|
*
|
|
8
8
|
* **Note:** The recommended way to implement custom interactions
|
|
9
|
-
* in your code is to use the
|
|
9
|
+
* in your code is to use the [`Interaction.where`](https://serenity-js.org/api/core/class/Interaction/#where) factory method.
|
|
10
10
|
*
|
|
11
11
|
* @group Activities
|
|
12
12
|
*/
|
|
@@ -15,7 +15,7 @@ class PageElementInteraction extends core_1.Interaction {
|
|
|
15
15
|
super(description, location);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Returns the resolved
|
|
18
|
+
* Returns the resolved [`PageElement`](https://serenity-js.org/api/web/class/PageElement/), or throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
19
19
|
* if the element is `undefined`.
|
|
20
20
|
*
|
|
21
21
|
* @param actor
|
|
@@ -4,16 +4,16 @@ import type { PageElement } from '../models';
|
|
|
4
4
|
import { Key } from '../models';
|
|
5
5
|
import { PageElementInteraction } from './PageElementInteraction';
|
|
6
6
|
/**
|
|
7
|
-
* Instructs an
|
|
7
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
8
8
|
* to send a key press or a sequence of keys to a Web element.
|
|
9
9
|
*
|
|
10
10
|
* **Note:** On macOS, some keyboard shortcuts might not work
|
|
11
11
|
* with the [`devtools` protocol](https://webdriver.io/docs/automationProtocols/#devtools-protocol).
|
|
12
12
|
*
|
|
13
13
|
* For example:
|
|
14
|
-
* - to *copy*, instead of
|
|
15
|
-
* - to *cut*, instead of
|
|
16
|
-
* - to *paste*, instead of
|
|
14
|
+
* - to *copy*, instead of [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta)+`C`, use [`Key.Control`](https://serenity-js.org/api/web/class/Key/#Control)+[`Key.Insert`](https://serenity-js.org/api/web/class/Key/#Insert)
|
|
15
|
+
* - to *cut*, instead of [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta)+`X`, use [`Key.Control`](https://serenity-js.org/api/web/class/Key/#Control)+[`Key.Delete`](https://serenity-js.org/api/web/class/Key/#Delete)
|
|
16
|
+
* - to *paste*, instead of [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta)+`V`, use [`Key.Shift`](https://serenity-js.org/api/web/class/Key/#Shift)+[`Key.Insert`](https://serenity-js.org/api/web/class/Key/#Insert)
|
|
17
17
|
*
|
|
18
18
|
* ## Example widget
|
|
19
19
|
*
|
|
@@ -51,18 +51,18 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
51
51
|
*
|
|
52
52
|
* ## Learn more
|
|
53
53
|
*
|
|
54
|
-
* -
|
|
55
|
-
* -
|
|
56
|
-
* -
|
|
54
|
+
* - [`Key`](https://serenity-js.org/api/web/class/Key/)
|
|
55
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
56
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
57
57
|
*
|
|
58
58
|
* @group Activities
|
|
59
59
|
*/
|
|
60
60
|
export declare class Press extends PageElementInteraction {
|
|
61
61
|
private readonly keys;
|
|
62
62
|
/**
|
|
63
|
-
* Instantiates an
|
|
64
|
-
* that instructs the
|
|
65
|
-
* to press a sequence of
|
|
63
|
+
* Instantiates an [interaction](https://serenity-js.org/api/core/class/Interaction/)
|
|
64
|
+
* that instructs the [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
65
|
+
* to press a sequence of [keys](https://serenity-js.org/api/web/class/Key/),
|
|
66
66
|
*
|
|
67
67
|
* When no `field` is specified, the key sequence will be sent to the currently focused element,
|
|
68
68
|
* and if no element is focused - to the `document.body` to handle.
|
|
@@ -7,16 +7,16 @@ const abilities_1 = require("../abilities");
|
|
|
7
7
|
const models_1 = require("../models");
|
|
8
8
|
const PageElementInteraction_1 = require("./PageElementInteraction");
|
|
9
9
|
/**
|
|
10
|
-
* Instructs an
|
|
10
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
11
11
|
* to send a key press or a sequence of keys to a Web element.
|
|
12
12
|
*
|
|
13
13
|
* **Note:** On macOS, some keyboard shortcuts might not work
|
|
14
14
|
* with the [`devtools` protocol](https://webdriver.io/docs/automationProtocols/#devtools-protocol).
|
|
15
15
|
*
|
|
16
16
|
* For example:
|
|
17
|
-
* - to *copy*, instead of
|
|
18
|
-
* - to *cut*, instead of
|
|
19
|
-
* - to *paste*, instead of
|
|
17
|
+
* - to *copy*, instead of [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta)+`C`, use [`Key.Control`](https://serenity-js.org/api/web/class/Key/#Control)+[`Key.Insert`](https://serenity-js.org/api/web/class/Key/#Insert)
|
|
18
|
+
* - to *cut*, instead of [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta)+`X`, use [`Key.Control`](https://serenity-js.org/api/web/class/Key/#Control)+[`Key.Delete`](https://serenity-js.org/api/web/class/Key/#Delete)
|
|
19
|
+
* - to *paste*, instead of [`Key.Meta`](https://serenity-js.org/api/web/class/Key/#Meta)+`V`, use [`Key.Shift`](https://serenity-js.org/api/web/class/Key/#Shift)+[`Key.Insert`](https://serenity-js.org/api/web/class/Key/#Insert)
|
|
20
20
|
*
|
|
21
21
|
* ## Example widget
|
|
22
22
|
*
|
|
@@ -54,18 +54,18 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
|
|
|
54
54
|
*
|
|
55
55
|
* ## Learn more
|
|
56
56
|
*
|
|
57
|
-
* -
|
|
58
|
-
* -
|
|
59
|
-
* -
|
|
57
|
+
* - [`Key`](https://serenity-js.org/api/web/class/Key/)
|
|
58
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
59
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
60
60
|
*
|
|
61
61
|
* @group Activities
|
|
62
62
|
*/
|
|
63
63
|
class Press extends PageElementInteraction_1.PageElementInteraction {
|
|
64
64
|
keys;
|
|
65
65
|
/**
|
|
66
|
-
* Instantiates an
|
|
67
|
-
* that instructs the
|
|
68
|
-
* to press a sequence of
|
|
66
|
+
* Instantiates an [interaction](https://serenity-js.org/api/core/class/Interaction/)
|
|
67
|
+
* that instructs the [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
68
|
+
* to press a sequence of [keys](https://serenity-js.org/api/web/class/Key/),
|
|
69
69
|
*
|
|
70
70
|
* When no `field` is specified, the key sequence will be sent to the currently focused element,
|
|
71
71
|
* and if no element is focused - to the `document.body` to handle.
|
|
@@ -2,8 +2,8 @@ import type { Answerable, AnswersQuestions, Interaction, UsesAbilities } from '@
|
|
|
2
2
|
import type { PageElement } from '../models';
|
|
3
3
|
import { PageElementInteraction } from './PageElementInteraction';
|
|
4
4
|
/**
|
|
5
|
-
* Instructs an
|
|
6
|
-
* to perform a right click on a given
|
|
5
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
6
|
+
* to perform a right click on a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
7
7
|
*
|
|
8
8
|
* This is typically used to open a [custom context menu](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event)
|
|
9
9
|
* on a given Web element, since it's not possible to interact with the standard context menu offered by your browser.
|
|
@@ -60,15 +60,15 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
60
60
|
*
|
|
61
61
|
* ## Learn more
|
|
62
62
|
*
|
|
63
|
-
* -
|
|
64
|
-
* -
|
|
63
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
64
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
65
65
|
*
|
|
66
66
|
* @group Activities
|
|
67
67
|
*/
|
|
68
68
|
export declare class RightClick extends PageElementInteraction {
|
|
69
69
|
private readonly pageElement;
|
|
70
70
|
/**
|
|
71
|
-
* Instantiates this
|
|
71
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
72
72
|
*
|
|
73
73
|
* @param pageElement
|
|
74
74
|
* The element to be right-clicked on
|
|
@@ -4,8 +4,8 @@ exports.RightClick = void 0;
|
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
const PageElementInteraction_1 = require("./PageElementInteraction");
|
|
6
6
|
/**
|
|
7
|
-
* Instructs an
|
|
8
|
-
* to perform a right click on a given
|
|
7
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
8
|
+
* to perform a right click on a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
9
9
|
*
|
|
10
10
|
* This is typically used to open a [custom context menu](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event)
|
|
11
11
|
* on a given Web element, since it's not possible to interact with the standard context menu offered by your browser.
|
|
@@ -62,15 +62,15 @@ const PageElementInteraction_1 = require("./PageElementInteraction");
|
|
|
62
62
|
*
|
|
63
63
|
* ## Learn more
|
|
64
64
|
*
|
|
65
|
-
* -
|
|
66
|
-
* -
|
|
65
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
66
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
67
67
|
*
|
|
68
68
|
* @group Activities
|
|
69
69
|
*/
|
|
70
70
|
class RightClick extends PageElementInteraction_1.PageElementInteraction {
|
|
71
71
|
pageElement;
|
|
72
72
|
/**
|
|
73
|
-
* Instantiates this
|
|
73
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
74
74
|
*
|
|
75
75
|
* @param pageElement
|
|
76
76
|
* The element to be right-clicked on
|
|
@@ -2,8 +2,8 @@ import type { Answerable, AnswersQuestions, UsesAbilities } from '@serenity-js/c
|
|
|
2
2
|
import { Interaction } from '@serenity-js/core';
|
|
3
3
|
import type { PageElement } from '../models';
|
|
4
4
|
/**
|
|
5
|
-
* Instructs an
|
|
6
|
-
* to scroll until a given
|
|
5
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
6
|
+
* to scroll until a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) comes into view.
|
|
7
7
|
*
|
|
8
8
|
* ## Example widget
|
|
9
9
|
*
|
|
@@ -43,15 +43,15 @@ import type { PageElement } from '../models';
|
|
|
43
43
|
*
|
|
44
44
|
* ## Learn more
|
|
45
45
|
*
|
|
46
|
-
* -
|
|
47
|
-
* -
|
|
46
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
47
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
48
48
|
*
|
|
49
49
|
* @group Activities
|
|
50
50
|
*/
|
|
51
51
|
export declare class Scroll extends Interaction {
|
|
52
52
|
private readonly element;
|
|
53
53
|
/**
|
|
54
|
-
* Instantiates this
|
|
54
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
55
55
|
*
|
|
56
56
|
* @param pageElement
|
|
57
57
|
* The element to scroll to
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Scroll = void 0;
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
/**
|
|
6
|
-
* Instructs an
|
|
7
|
-
* to scroll until a given
|
|
6
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
7
|
+
* to scroll until a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) comes into view.
|
|
8
8
|
*
|
|
9
9
|
* ## Example widget
|
|
10
10
|
*
|
|
@@ -44,15 +44,15 @@ const core_1 = require("@serenity-js/core");
|
|
|
44
44
|
*
|
|
45
45
|
* ## Learn more
|
|
46
46
|
*
|
|
47
|
-
* -
|
|
48
|
-
* -
|
|
47
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
48
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
49
49
|
*
|
|
50
50
|
* @group Activities
|
|
51
51
|
*/
|
|
52
52
|
class Scroll extends core_1.Interaction {
|
|
53
53
|
element;
|
|
54
54
|
/**
|
|
55
|
-
* Instantiates this
|
|
55
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
56
56
|
*
|
|
57
57
|
* @param pageElement
|
|
58
58
|
* The element to scroll to
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { type Answerable, Interaction } from '@serenity-js/core';
|
|
2
2
|
import type { PageElement } from '../models';
|
|
3
3
|
/**
|
|
4
|
-
* Instructs an
|
|
4
|
+
* Instructs an [actor](https://serenity-js.org/api/core/class/Actor/) who has the [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
5
5
|
* to select an option from a [HTML `<select>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select),
|
|
6
6
|
* either by its display name, or by value.
|
|
7
7
|
*
|
|
8
8
|
* ## Learn more
|
|
9
|
-
* -
|
|
9
|
+
* - [`Selected`](https://serenity-js.org/api/web/class/Selected/)
|
|
10
10
|
*
|
|
11
11
|
* @group Activities
|
|
12
12
|
*/
|
|
13
13
|
export declare class Select {
|
|
14
14
|
/**
|
|
15
|
-
* Instantiates an
|
|
16
|
-
* that instructs the
|
|
15
|
+
* Instantiates an [interaction](https://serenity-js.org/api/core/class/Interaction/)
|
|
16
|
+
* that instructs the [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
17
17
|
* to select a single [`<option>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
18
18
|
* with a given [`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#attr-value).,
|
|
19
19
|
*
|
|
@@ -54,19 +54,19 @@ export declare class Select {
|
|
|
54
54
|
* ```
|
|
55
55
|
*
|
|
56
56
|
* #### Learn more
|
|
57
|
-
* -
|
|
58
|
-
* -
|
|
57
|
+
* - [`Selected.valueOf`](https://serenity-js.org/api/web/class/Selected/#valueOf)
|
|
58
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
59
59
|
*
|
|
60
60
|
* @param value
|
|
61
61
|
* A value of the [`option` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
62
|
-
* for the
|
|
62
|
+
* for the [`Actor`](https://serenity-js.org/api/core/class/Actor/) to select
|
|
63
63
|
*/
|
|
64
64
|
static value(value: Answerable<string>): {
|
|
65
65
|
from: (pageElement: Answerable<PageElement>) => Interaction;
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
68
|
-
* Instantiates an
|
|
69
|
-
* that instructs the
|
|
68
|
+
* Instantiates an [interaction](https://serenity-js.org/api/core/class/Interaction/)
|
|
69
|
+
* that instructs the [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
70
70
|
* to select multiple [`<option>` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
71
71
|
* identified by their [`value`s](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#attr-value).
|
|
72
72
|
*
|
|
@@ -108,19 +108,19 @@ export declare class Select {
|
|
|
108
108
|
*
|
|
109
109
|
* #### Learn more
|
|
110
110
|
*
|
|
111
|
-
* -
|
|
112
|
-
* -
|
|
111
|
+
* - [`Selected.valuesOf`](https://serenity-js.org/api/web/class/Selected/#valuesOf)
|
|
112
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
113
113
|
*
|
|
114
114
|
* @param values
|
|
115
115
|
* Values of the [`option` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
116
|
-
* for the
|
|
116
|
+
* for the [`Actor`](https://serenity-js.org/api/core/class/Actor/) to select
|
|
117
117
|
*/
|
|
118
118
|
static values(...values: Array<Answerable<string[] | string>>): {
|
|
119
119
|
from: (pageElement: Answerable<PageElement>) => Interaction;
|
|
120
120
|
};
|
|
121
121
|
/**
|
|
122
|
-
* Instantiates an
|
|
123
|
-
* that instructs the
|
|
122
|
+
* Instantiates an [interaction](https://serenity-js.org/api/core/class/Interaction/)
|
|
123
|
+
* that instructs the [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
124
124
|
* to select a single [`<option>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
125
125
|
* with a given description.
|
|
126
126
|
*
|
|
@@ -164,19 +164,19 @@ export declare class Select {
|
|
|
164
164
|
* ```
|
|
165
165
|
*
|
|
166
166
|
* #### Learn more
|
|
167
|
-
* -
|
|
168
|
-
* -
|
|
167
|
+
* - [`Selected.optionIn`](https://serenity-js.org/api/web/class/Selected/#optionIn)
|
|
168
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
169
169
|
*
|
|
170
170
|
* @param value
|
|
171
171
|
* Text of the [`option` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
172
|
-
* for the
|
|
172
|
+
* for the [`Actor`](https://serenity-js.org/api/core/class/Actor/) to select
|
|
173
173
|
*/
|
|
174
174
|
static option(value: Answerable<string>): {
|
|
175
175
|
from: (pageElement: Answerable<PageElement>) => Interaction;
|
|
176
176
|
};
|
|
177
177
|
/**
|
|
178
|
-
* Instantiates an
|
|
179
|
-
* that instructs the
|
|
178
|
+
* Instantiates an [interaction](https://serenity-js.org/api/core/class/Interaction/)
|
|
179
|
+
* that instructs the [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
180
180
|
* to select multiple [`<option>` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
181
181
|
* identified by their descriptions.
|
|
182
182
|
*
|
|
@@ -221,12 +221,12 @@ export declare class Select {
|
|
|
221
221
|
* ```
|
|
222
222
|
*
|
|
223
223
|
* #### Learn more
|
|
224
|
-
* -
|
|
225
|
-
* -
|
|
224
|
+
* - [`Selected.optionsIn`](https://serenity-js.org/api/web/class/Selected/#optionsIn)
|
|
225
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
226
226
|
*
|
|
227
227
|
* @param values
|
|
228
228
|
* Text of the [`option` elements ](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
229
|
-
* for the
|
|
229
|
+
* for the [`Actor`](https://serenity-js.org/api/core/class/Actor/) to select
|
|
230
230
|
*/
|
|
231
231
|
static options(...values: Array<Answerable<string[] | string>>): {
|
|
232
232
|
from: (pageElement: Answerable<PageElement>) => Interaction;
|