@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
|
@@ -9,18 +9,18 @@ const isElementClickable = Expectation.define(
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* - the element
|
|
14
|
-
* -
|
|
12
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is clickable, which means it resolves to `true` when:
|
|
13
|
+
* - the element [is present](https://serenity-js.org/api/assertions/function/isPresent/) in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
|
|
14
|
+
* - [`PageElement.isClickable`](https://serenity-js.org/api/web/class/PageElement/#isClickable) resolves to `true`
|
|
15
15
|
*
|
|
16
16
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
17
17
|
*
|
|
18
18
|
* ## Learn more
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
19
|
+
* - [`PageElement.isClickable`](https://serenity-js.org/api/web/class/PageElement/#isClickable)
|
|
20
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
21
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
22
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
23
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
24
24
|
*
|
|
25
25
|
* @group Expectations
|
|
26
26
|
*/
|
|
@@ -9,18 +9,18 @@ const isElementEnabled = Expectation.define(
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* - the element
|
|
14
|
-
* -
|
|
12
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is enabled, which means it resolves to `true` when:
|
|
13
|
+
* - the element [is present](https://serenity-js.org/api/assertions/function/isPresent/) in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
|
|
14
|
+
* - [`PageElement.isEnabled`](https://serenity-js.org/api/web/class/PageElement/#isEnabled) resolves to `true`
|
|
15
15
|
*
|
|
16
16
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
17
17
|
*
|
|
18
18
|
* ## Learn more
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
19
|
+
* - [`PageElement.isEnabled`](https://serenity-js.org/api/web/class/PageElement/#isEnabled)
|
|
20
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
21
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
22
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
23
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
24
24
|
*
|
|
25
25
|
* @group Expectations
|
|
26
26
|
*/
|
|
@@ -9,18 +9,18 @@ const isElementSelected = Expectation.define(
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* - the element
|
|
14
|
-
* -
|
|
12
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an `<option>` or `<input>` element is selected, which means it resolves to `true` when:
|
|
13
|
+
* - the element [is present](https://serenity-js.org/api/assertions/function/isPresent/) in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
|
|
14
|
+
* - [`PageElement.isSelected`](https://serenity-js.org/api/web/class/PageElement/#isSelected) resolves to `true`
|
|
15
15
|
*
|
|
16
16
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
17
17
|
*
|
|
18
18
|
* ## Learn more
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
19
|
+
* - [`PageElement.isSelected`](https://serenity-js.org/api/web/class/PageElement/#isSelected)
|
|
20
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
21
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
22
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
23
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
24
24
|
*
|
|
25
25
|
* @group Expectations
|
|
26
26
|
*/
|
|
@@ -9,18 +9,18 @@ const isElementVisible = Expectation.define(
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* - the element
|
|
14
|
-
* -
|
|
12
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is visible, which means it resolves to `true` when:
|
|
13
|
+
* - the element [is present](https://serenity-js.org/api/assertions/function/isPresent/) in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model)
|
|
14
|
+
* - [`PageElement.isVisible`](https://serenity-js.org/api/web/class/PageElement/#isVisible) resolves to `true`
|
|
15
15
|
*
|
|
16
16
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
17
17
|
*
|
|
18
18
|
* ## Learn more
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
19
|
+
* - [`PageElement.isVisible`](https://serenity-js.org/api/web/class/PageElement/#isVisible)
|
|
20
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
21
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
22
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
23
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
24
24
|
*
|
|
25
25
|
* @group Expectations
|
|
26
26
|
*/
|
|
@@ -3,22 +3,22 @@ import { Ability } from '@serenity-js/core';
|
|
|
3
3
|
import type { BrowserCapabilities, BrowsingSession, Page } from '../models';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
7
|
-
* to
|
|
6
|
+
* The [ability](https://serenity-js.org/api/core/class/Ability/) to `BrowseTheWeb` enables an [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
7
|
+
* to [interact with](https://serenity-js.org/api/core/class/Interaction/) and [retrieve information from](https://serenity-js.org/api/core/class/Question/) Web-based user interfaces.
|
|
8
8
|
*
|
|
9
|
-
* `BrowseTheWeb` wraps test integration tools such as [Playwright](/api/playwright),
|
|
10
|
-
* [Protractor](/api/protractor), or [WebdriverIO](/api/webdriverio),
|
|
11
|
-
* and together with Serenity/JS Web models, such as
|
|
9
|
+
* `BrowseTheWeb` wraps test integration tools such as [Playwright](https://serenity-js.org/api/playwright),
|
|
10
|
+
* [Protractor](https://serenity-js.org/api/protractor), or [WebdriverIO](https://serenity-js.org/api/webdriverio),
|
|
11
|
+
* and together with Serenity/JS Web models, such as [`Page`](https://serenity-js.org/api/web/class/Page/) or [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) - offers a standardised way
|
|
12
12
|
* to write Web-based tests following the Screenplay Pattern.
|
|
13
13
|
*
|
|
14
|
-
* The consistent and portable design of abstractions provided by the [`@serenity-js/web` module](/api/web)
|
|
14
|
+
* The consistent and portable design of abstractions provided by the [`@serenity-js/web` module](https://serenity-js.org/api/web)
|
|
15
15
|
* also helps to make your tests portable across the various test integration tools and helps to make your test
|
|
16
16
|
* code easier to reuse across projects and teams.
|
|
17
17
|
*
|
|
18
18
|
* ## Giving the actors an ability to `BrowseTheWeb`
|
|
19
19
|
*
|
|
20
|
-
* To give an
|
|
21
|
-
* via
|
|
20
|
+
* To give an [actor](https://serenity-js.org/api/core/class/Actor/) an ability to `BrowseTheWeb`, provide the **integration tool-specific implementation**
|
|
21
|
+
* via [`Actor.whoCan`](https://serenity-js.org/api/core/class/Actor/#whoCan) in [`Cast.prepare`](https://serenity-js.org/api/core/class/Cast/#prepare), or via [`Cast.where`](https://serenity-js.org/api/core/class/Cast/#where).
|
|
22
22
|
*
|
|
23
23
|
* ```ts
|
|
24
24
|
* import { beforeEach } from 'mocha'
|
|
@@ -39,21 +39,23 @@ import type { BrowserCapabilities, BrowsingSession, Page } from '../models';
|
|
|
39
39
|
*
|
|
40
40
|
* To learn more about using Serenity/JS with your chosen test integration tool, follow their respective documentation:
|
|
41
41
|
*
|
|
42
|
-
* -
|
|
43
|
-
* -
|
|
44
|
-
* -
|
|
42
|
+
* - [`BrowseTheWebWithPlaywright`](https://serenity-js.org/api/playwright/class/BrowseTheWebWithPlaywright/)
|
|
43
|
+
* - [`BrowseTheWebWithProtractor`](https://serenity-js.org/api/protractor/class/BrowseTheWebWithProtractor/)
|
|
44
|
+
* - [`BrowseTheWebWithWebdriverIO`](https://serenity-js.org/api/webdriverio/class/BrowseTheWebWithWebdriverIO/)
|
|
45
45
|
*
|
|
46
46
|
* ## Using the ability to `BrowseTheWeb`
|
|
47
47
|
*
|
|
48
|
-
* To use the ability to `BrowseTheWeb` in a custom
|
|
48
|
+
* To use the ability to `BrowseTheWeb` in a custom [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
49
|
+
* or [`Question`](https://serenity-js.org/api/core/class/Question/), use the **generic** method [`BrowseTheWeb.as`](https://serenity-js.org/api/core/class/Ability/#as)
|
|
49
50
|
* to retrieve it.
|
|
50
51
|
*
|
|
51
|
-
* This generic method retrieves the integration tool-specific implementation of
|
|
52
|
-
* such as
|
|
52
|
+
* This generic method retrieves the integration tool-specific implementation of [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) present on the [`Actor`](https://serenity-js.org/api/core/class/Actor/),
|
|
53
|
+
* such as [`BrowseTheWebWithPlaywright`](https://serenity-js.org/api/playwright/class/BrowseTheWebWithPlaywright/)
|
|
54
|
+
* or [`BrowseTheWebWithWebdriverIO`](https://serenity-js.org/api/webdriverio/class/BrowseTheWebWithWebdriverIO/), using [`Actor.abilityTo`](https://serenity-js.org/api/core/class/Actor/#abilityTo).
|
|
53
55
|
*
|
|
54
56
|
* This decoupling mechanism helps to make your test code portable across test integration tools,
|
|
55
57
|
* since the only part of your test suite that needs to know about the test integration tool used are the actors.
|
|
56
|
-
* The rest of your test code, so
|
|
58
|
+
* The rest of your test code, so [tasks](https://serenity-js.org/api/core/class/Task/), [interactions](https://serenity-js.org/api/core/class/Interaction/), and [questions](https://serenity-js.org/api/core/class/Question/),
|
|
57
59
|
* remain fully agnostic of the underlying tool.
|
|
58
60
|
*
|
|
59
61
|
* ```ts
|
|
@@ -71,10 +73,10 @@ import type { BrowserCapabilities, BrowsingSession, Page } from '../models';
|
|
|
71
73
|
*
|
|
72
74
|
* ### Learn more
|
|
73
75
|
*
|
|
74
|
-
* -
|
|
75
|
-
* -
|
|
76
|
-
* -
|
|
77
|
-
* -
|
|
76
|
+
* - [`Ability`](https://serenity-js.org/api/core/class/Ability/)
|
|
77
|
+
* - [`Actor.whoCan`](https://serenity-js.org/api/core/class/Actor/#whoCan)
|
|
78
|
+
* - [`Cast.where`](https://serenity-js.org/api/core/class/Cast/#where)
|
|
79
|
+
* - [`Cast.prepare`](https://serenity-js.org/api/core/class/Cast/#prepare)
|
|
78
80
|
*
|
|
79
81
|
* @group Abilities
|
|
80
82
|
*/
|
|
@@ -85,22 +87,22 @@ export abstract class BrowseTheWeb<Native_Element_Type = any> extends Ability {
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
/**
|
|
88
|
-
* Returns a
|
|
90
|
+
* Returns a [`Page`](https://serenity-js.org/api/web/class/Page/) representing the currently active browser tab.
|
|
89
91
|
*/
|
|
90
92
|
async currentPage(): Promise<Page<Native_Element_Type>> {
|
|
91
93
|
return this.session.currentPage();
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
/**
|
|
95
|
-
* Returns an array of
|
|
96
|
-
* available in the current
|
|
97
|
+
* Returns an array of [pages](https://serenity-js.org/api/web/class/Page/) representing all the browser tabs
|
|
98
|
+
* available in the current [`BrowsingSession`](https://serenity-js.org/api/web/class/BrowsingSession/).
|
|
97
99
|
*/
|
|
98
100
|
allPages(): Promise<Array<Page<Native_Element_Type>>> {
|
|
99
101
|
return this.session.allPages();
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
/**
|
|
103
|
-
* Returns
|
|
105
|
+
* Returns [basic meta-data](https://serenity-js.org/api/web/interface/BrowserCapabilities/) about the browser associated with this ability.
|
|
104
106
|
*/
|
|
105
107
|
async browserCapabilities(): Promise<BrowserCapabilities> {
|
|
106
108
|
return this.session.browserCapabilities();
|
|
@@ -5,7 +5,7 @@ import type { PageElement } from '../models';
|
|
|
5
5
|
import { PageElementInteraction } from './PageElementInteraction';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Instructs an
|
|
8
|
+
* 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/)
|
|
9
9
|
* to clear the `value` of a [form `input` field](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
|
10
10
|
*
|
|
11
11
|
* ## Example widget
|
|
@@ -48,18 +48,18 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
48
48
|
*
|
|
49
49
|
* ## Learn more
|
|
50
50
|
*
|
|
51
|
-
* -
|
|
52
|
-
* -
|
|
53
|
-
* -
|
|
54
|
-
* -
|
|
51
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
52
|
+
* - [`Enter`](https://serenity-js.org/api/web/class/Enter/)
|
|
53
|
+
* - [`Value`](https://serenity-js.org/api/web/class/Value/)
|
|
54
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
55
55
|
*
|
|
56
56
|
* @group Activities
|
|
57
57
|
*/
|
|
58
58
|
export class Clear extends PageElementInteraction {
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* Instantiates an
|
|
62
|
-
* that instructs the
|
|
61
|
+
* Instantiates an [interaction](https://serenity-js.org/api/core/class/Interaction/)
|
|
62
|
+
* that instructs the [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
63
63
|
* to clear the value of an input `field`,
|
|
64
64
|
*
|
|
65
65
|
* @param field
|
|
@@ -5,8 +5,8 @@ import type { PageElement } from '../models';
|
|
|
5
5
|
import { PageElementInteraction } from './PageElementInteraction';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Instructs an
|
|
9
|
-
* to scroll the given
|
|
8
|
+
* 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/)
|
|
9
|
+
* to scroll the given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) into view and then [click](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) on it.
|
|
10
10
|
*
|
|
11
11
|
* ## Example widget
|
|
12
12
|
*
|
|
@@ -44,15 +44,15 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
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
|
export class Click extends PageElementInteraction {
|
|
53
53
|
|
|
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 be clicked on
|
|
@@ -5,8 +5,8 @@ import type { PageElement } from '../models';
|
|
|
5
5
|
import { PageElementInteraction } from './PageElementInteraction';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Instructs an
|
|
9
|
-
* to perform a double click on a given
|
|
8
|
+
* 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/)
|
|
9
|
+
* to perform a double click on a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
10
10
|
*
|
|
11
11
|
* ## Example widget
|
|
12
12
|
* ```html
|
|
@@ -67,15 +67,15 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
67
67
|
*
|
|
68
68
|
* ## Learn more
|
|
69
69
|
*
|
|
70
|
-
* -
|
|
71
|
-
* -
|
|
70
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
71
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
72
72
|
*
|
|
73
73
|
* @group Activities
|
|
74
74
|
*/
|
|
75
75
|
export class DoubleClick extends PageElementInteraction {
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Instantiates this
|
|
78
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
79
79
|
*
|
|
80
80
|
* @param pageElement
|
|
81
81
|
* The element to be double-clicked on
|
|
@@ -6,7 +6,7 @@ import type { PageElement } from '../models';
|
|
|
6
6
|
import { PageElementInteraction } from './PageElementInteraction';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Instructs an
|
|
9
|
+
* 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/)
|
|
10
10
|
* to enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
|
|
11
11
|
*
|
|
12
12
|
* ## Example widget
|
|
@@ -43,7 +43,7 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
43
43
|
* ## Handling sensitive information
|
|
44
44
|
*
|
|
45
45
|
* By design, any data handled by an actor appears in Serenity/JS reports.
|
|
46
|
-
* To prevent the exposure of any sensitive information, such as passwords or tokens, you should use
|
|
46
|
+
* To prevent the exposure of any sensitive information, such as passwords or tokens, you should use [`Masked`](https://serenity-js.org/api/core/class/Masked/).
|
|
47
47
|
*
|
|
48
48
|
* ```ts
|
|
49
49
|
* import { actorCalled, Masked } from '@serenity-js/core'
|
|
@@ -59,15 +59,15 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
59
59
|
*
|
|
60
60
|
* ## Learn more
|
|
61
61
|
*
|
|
62
|
-
* -
|
|
63
|
-
* -
|
|
62
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
63
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
64
64
|
*
|
|
65
65
|
* @group Activities
|
|
66
66
|
*/
|
|
67
67
|
export class Enter extends PageElementInteraction {
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
* Instantiates this
|
|
70
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
71
71
|
*
|
|
72
72
|
* @param values
|
|
73
73
|
* The text value to be entered
|
|
@@ -6,20 +6,20 @@ import { Name, TextData } from '@serenity-js/core/lib/model';
|
|
|
6
6
|
import { BrowseTheWeb } from '../abilities';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Instructs an
|
|
9
|
+
* 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/)
|
|
10
10
|
* to inject a script into the browser and execute it in the context of the current browser tab.
|
|
11
11
|
*
|
|
12
12
|
* ## Learn more
|
|
13
13
|
*
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
14
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
15
|
+
* - [`LastScriptExecution.result`](https://serenity-js.org/api/web/class/LastScriptExecution/#result)
|
|
16
16
|
*
|
|
17
17
|
* @group Activities
|
|
18
18
|
*/
|
|
19
19
|
export class ExecuteScript {
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Instantiates a version of this
|
|
22
|
+
* Instantiates a version of this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
23
23
|
* configured to load a script from `sourceUrl`.
|
|
24
24
|
*
|
|
25
25
|
* @param sourceUrl
|
|
@@ -30,7 +30,7 @@ export class ExecuteScript {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* Instructs an
|
|
33
|
+
* 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/)
|
|
34
34
|
* to execute an asynchronous script within the context of the current browser tab.
|
|
35
35
|
*
|
|
36
36
|
* The script fragment will be executed as the body of an anonymous function.
|
|
@@ -39,20 +39,20 @@ export class ExecuteScript {
|
|
|
39
39
|
*
|
|
40
40
|
* Any arguments provided in addition to the script will be included as script arguments and may be referenced
|
|
41
41
|
* using the `arguments` object. Arguments may be a `boolean`, `number`, `string`
|
|
42
|
-
* or
|
|
42
|
+
* or [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
43
43
|
* Arrays and objects may also be used as script arguments as long as each item adheres
|
|
44
44
|
* to the types previously mentioned.
|
|
45
45
|
*
|
|
46
|
-
* Unlike executing synchronous JavaScript with
|
|
46
|
+
* Unlike executing synchronous JavaScript with [`ExecuteScript.sync`](https://serenity-js.org/api/web/class/ExecuteScript/#sync),
|
|
47
47
|
* scripts executed with this function must explicitly signal they are finished by invoking the provided callback.
|
|
48
48
|
*
|
|
49
49
|
* This callback will always be injected into the executed function as the last argument,
|
|
50
50
|
* and thus may be referenced with `arguments[arguments.length - 1]`.
|
|
51
51
|
*
|
|
52
52
|
* If the script invokes the `callback` with a return value, this will be made available
|
|
53
|
-
* via the
|
|
53
|
+
* via the [`LastScriptExecution.result`](https://serenity-js.org/api/web/class/LastScriptExecution/#result).
|
|
54
54
|
*
|
|
55
|
-
* **Please note** that in order to signal an error in the `script` you need to throw an
|
|
55
|
+
* **Please note** that in order to signal an error in the `script` you need to throw an [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)
|
|
56
56
|
* instead of passing it to the callback function.
|
|
57
57
|
*
|
|
58
58
|
* #### Executing an async script
|
|
@@ -111,7 +111,7 @@ export class ExecuteScript {
|
|
|
111
111
|
*
|
|
112
112
|
* #### Passing PageElement arguments to an async script
|
|
113
113
|
*
|
|
114
|
-
* Serenity/JS automatically converts
|
|
114
|
+
* Serenity/JS automatically converts [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) objects passed as arguments to the script
|
|
115
115
|
* into their corresponding DOM elements.
|
|
116
116
|
*
|
|
117
117
|
* ```ts
|
|
@@ -135,7 +135,7 @@ export class ExecuteScript {
|
|
|
135
135
|
*
|
|
136
136
|
* #### Using nested data structures containing PageElement objects
|
|
137
137
|
*
|
|
138
|
-
* Serenity/JS automatically converts any
|
|
138
|
+
* Serenity/JS automatically converts any [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) objects
|
|
139
139
|
* contained in nested data structures passed to the script
|
|
140
140
|
* into their corresponding DOM elements.
|
|
141
141
|
*
|
|
@@ -165,7 +165,7 @@ export class ExecuteScript {
|
|
|
165
165
|
* ```
|
|
166
166
|
*
|
|
167
167
|
* #### Learn more
|
|
168
|
-
* -
|
|
168
|
+
* - [`LastScriptExecution.result`](https://serenity-js.org/api/web/class/LastScriptExecution/#result)
|
|
169
169
|
*
|
|
170
170
|
* @param script
|
|
171
171
|
* The script to be executed
|
|
@@ -178,10 +178,10 @@ export class ExecuteScript {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
|
-
* Instructs an
|
|
181
|
+
* 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/)
|
|
182
182
|
* to execute a synchronous script within the context of the current browser tab.
|
|
183
183
|
*
|
|
184
|
-
* If the script returns a value, it will be made available via
|
|
184
|
+
* If the script returns a value, it will be made available via [`LastScriptExecution.result`](https://serenity-js.org/api/web/class/LastScriptExecution/#result).
|
|
185
185
|
*
|
|
186
186
|
* #### Executing a sync script as string and reading the result
|
|
187
187
|
*
|
|
@@ -229,7 +229,7 @@ export class ExecuteScript {
|
|
|
229
229
|
*
|
|
230
230
|
* #### Passing PageElement arguments to a sync script
|
|
231
231
|
*
|
|
232
|
-
* Serenity/JS automatically converts
|
|
232
|
+
* Serenity/JS automatically converts [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) objects passed as arguments to the script
|
|
233
233
|
* into their corresponding DOM elements.
|
|
234
234
|
*
|
|
235
235
|
* ```ts
|
|
@@ -250,7 +250,7 @@ export class ExecuteScript {
|
|
|
250
250
|
*
|
|
251
251
|
* #### Using nested data structures containing PageElement objects
|
|
252
252
|
*
|
|
253
|
-
* Serenity/JS automatically converts any
|
|
253
|
+
* Serenity/JS automatically converts any [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) objects
|
|
254
254
|
* contained in nested data structures passed to the script
|
|
255
255
|
* into their corresponding DOM elements.
|
|
256
256
|
*
|
|
@@ -277,7 +277,7 @@ export class ExecuteScript {
|
|
|
277
277
|
* ```
|
|
278
278
|
*
|
|
279
279
|
* #### Learn more
|
|
280
|
-
* -
|
|
280
|
+
* - [`LastScriptExecution.result`](https://serenity-js.org/api/web/class/LastScriptExecution/#result)
|
|
281
281
|
*
|
|
282
282
|
* @param script
|
|
283
283
|
* The script to be executed
|
|
@@ -294,7 +294,7 @@ export class ExecuteScript {
|
|
|
294
294
|
* Allows for a script to be executed to be parametrised.
|
|
295
295
|
*
|
|
296
296
|
* ## Learn more
|
|
297
|
-
* -
|
|
297
|
+
* - [`ExecuteScript`](https://serenity-js.org/api/web/class/ExecuteScript/)
|
|
298
298
|
*
|
|
299
299
|
* @group Activities
|
|
300
300
|
*/
|
|
@@ -309,7 +309,7 @@ export abstract class ExecuteScriptWithArguments extends Interaction {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
/**
|
|
312
|
-
* Instantiates this
|
|
312
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
313
313
|
*
|
|
314
314
|
* @param args
|
|
315
315
|
* Arguments to parametrise the script with
|
|
@@ -5,8 +5,8 @@ import type { PageElement } from '../models';
|
|
|
5
5
|
import { PageElementInteraction } from './PageElementInteraction';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Instructs an
|
|
9
|
-
* to hover the mouse pointer over a given
|
|
8
|
+
* 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/)
|
|
9
|
+
* to hover the mouse pointer over a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
10
10
|
*
|
|
11
11
|
* ## Example widget
|
|
12
12
|
* ```html
|
|
@@ -48,15 +48,15 @@ import { PageElementInteraction } from './PageElementInteraction';
|
|
|
48
48
|
*
|
|
49
49
|
* ## Learn more
|
|
50
50
|
*
|
|
51
|
-
* -
|
|
52
|
-
* -
|
|
51
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
52
|
+
* - [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
53
53
|
*
|
|
54
54
|
* @group Activities
|
|
55
55
|
*/
|
|
56
56
|
export class Hover extends PageElementInteraction {
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* Instantiates this
|
|
59
|
+
* Instantiates this [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
60
60
|
*
|
|
61
61
|
* @param pageElement
|
|
62
62
|
* The element to be hovered over
|
|
@@ -4,20 +4,20 @@ import { Interaction, TestCompromisedError, the } from '@serenity-js/core';
|
|
|
4
4
|
import { BrowseTheWeb } from '../abilities';
|
|
5
5
|
|
|
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
|
export class Navigate {
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Instructs an
|
|
20
|
+
* 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/)
|
|
21
21
|
* to navigate to a given URL.
|
|
22
22
|
*
|
|
23
23
|
* The URL can be:
|
|
@@ -55,14 +55,14 @@ export class Navigate {
|
|
|
55
55
|
*
|
|
56
56
|
* #### Learn more
|
|
57
57
|
*
|
|
58
|
-
* -
|
|
58
|
+
* - [`Page.navigateTo`](https://serenity-js.org/api/web/class/Page/#navigateTo)
|
|
59
59
|
* - [WebdriverIO: Configuration Options](https://webdriver.io/docs/options/#baseurl)
|
|
60
60
|
* - [Playwright: Browser](https://playwright.dev/docs/api/class-browser#browser-new-context)
|
|
61
61
|
* - [Playwright: Test Options](https://playwright.dev/docs/api/class-testoptions#test-options-base-url)
|
|
62
62
|
* - [Protractor: Configuration](https://github.com/angular/protractor/blob/master/lib/config.ts)
|
|
63
63
|
*
|
|
64
64
|
* @param url
|
|
65
|
-
* An absolute URL or path an
|
|
65
|
+
* An absolute URL or path an [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
66
66
|
* should navigate to
|
|
67
67
|
*/
|
|
68
68
|
static to(url: Answerable<string>): Interaction {
|
|
@@ -70,7 +70,7 @@ export class Navigate {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* Instructs an
|
|
73
|
+
* 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/)
|
|
74
74
|
* to navigate back one page in the joint session history of the current top-level browsing context.
|
|
75
75
|
*
|
|
76
76
|
* #### Navigate back in browsing history
|
|
@@ -101,7 +101,7 @@ export class Navigate {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
* Instructs an
|
|
104
|
+
* 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/)
|
|
105
105
|
* to navigate forward one page in the joint session history of the current top-level browsing context.
|
|
106
106
|
*
|
|
107
107
|
* #### Navigate forward in browsing history
|
|
@@ -133,7 +133,7 @@ export class Navigate {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
-
* Instructs an
|
|
136
|
+
* 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/)
|
|
137
137
|
* to reload the current page.
|
|
138
138
|
*
|
|
139
139
|
* #### Navigate to path relative to baseUrl
|
|
@@ -5,10 +5,10 @@ import type { FileSystemLocation } from '@serenity-js/core/lib/io';
|
|
|
5
5
|
import type { PageElement } from '../models';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* A base class for interactions with
|
|
8
|
+
* A base class for interactions with [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) objects.
|
|
9
9
|
*
|
|
10
10
|
* **Note:** The recommended way to implement custom interactions
|
|
11
|
-
* in your code is to use the
|
|
11
|
+
* in your code is to use the [`Interaction.where`](https://serenity-js.org/api/core/class/Interaction/#where) factory method.
|
|
12
12
|
*
|
|
13
13
|
* @group Activities
|
|
14
14
|
*/
|
|
@@ -19,7 +19,7 @@ export abstract class PageElementInteraction extends Interaction {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Returns the resolved
|
|
22
|
+
* Returns the resolved [`PageElement`](https://serenity-js.org/api/web/class/PageElement/), or throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
23
23
|
* if the element is `undefined`.
|
|
24
24
|
*
|
|
25
25
|
* @param actor
|