@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
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.25.2](https://github.com/serenity-js/serenity-js/compare/v3.25.1...v3.25.2) (2024-07-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/web
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.25.1](https://github.com/serenity-js/serenity-js/compare/v3.25.0...v3.25.1) (2024-07-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **core:** all the API docs now link to the online Serenity/JS API documentation ([f8f451d](https://github.com/serenity-js/serenity-js/commit/f8f451dffdb4caaa2e31a860f59d59470f4856ad))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [3.25.0](https://github.com/serenity-js/serenity-js/compare/v3.24.1...v3.25.0) (2024-07-03)
|
|
7
26
|
|
|
8
27
|
|
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ of complex software systems faster, more collaborative and easier to scale.
|
|
|
17
17
|
👋 Join the Serenity/JS Community!
|
|
18
18
|
- Meet other Serenity/JS developers and maintainers on the [Serenity/JS Community chat channel](https://matrix.to/#/#serenity-js:gitter.im),
|
|
19
19
|
- Find answers to your Serenity/JS questions on the [Serenity/JS Forum](https://github.com/orgs/serenity-js/discussions/categories/how-do-i),
|
|
20
|
-
- Learn how to [contribute to Serenity/JS](https://serenity-js.org/contributing),
|
|
20
|
+
- Learn how to [contribute to Serenity/JS](https://serenity-js.org/community/contributing/),
|
|
21
21
|
- Support the project and gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks) by becoming a [Serenity/JS GitHub Sponsor](https://github.com/sponsors/serenity-js)!
|
|
22
22
|
|
|
23
23
|
## Serenity/JS Web
|
|
@@ -4,8 +4,8 @@ import { LogicError } from '@serenity-js/core';
|
|
|
4
4
|
* that's already been closed.
|
|
5
5
|
*
|
|
6
6
|
* ## Learn more
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - [`TakeScreenshot`](https://serenity-js.org/api/web/class/TakeScreenshot/)
|
|
8
|
+
* - [`Page.takeScreenshot`](https://serenity-js.org/api/web/class/Page/#takeScreenshot)
|
|
9
9
|
*
|
|
10
10
|
* @group Errors
|
|
11
11
|
*/
|
|
@@ -7,8 +7,8 @@ const core_1 = require("@serenity-js/core");
|
|
|
7
7
|
* that's already been closed.
|
|
8
8
|
*
|
|
9
9
|
* ## Learn more
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
10
|
+
* - [`TakeScreenshot`](https://serenity-js.org/api/web/class/TakeScreenshot/)
|
|
11
|
+
* - [`Page.takeScreenshot`](https://serenity-js.org/api/web/class/Page/#takeScreenshot)
|
|
12
12
|
*
|
|
13
13
|
* @group Errors
|
|
14
14
|
*/
|
|
@@ -4,8 +4,8 @@ import { RuntimeError } from '@serenity-js/core';
|
|
|
4
4
|
* you're trying to retrieve has not been set yet.
|
|
5
5
|
*
|
|
6
6
|
* ## Learn more
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - [`Cookie`](https://serenity-js.org/api/web/class/Cookie/)
|
|
8
|
+
* - [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/)
|
|
9
9
|
*
|
|
10
10
|
* @group Errors
|
|
11
11
|
*/
|
|
@@ -7,8 +7,8 @@ const core_1 = require("@serenity-js/core");
|
|
|
7
7
|
* you're trying to retrieve has not been set yet.
|
|
8
8
|
*
|
|
9
9
|
* ## Learn more
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
10
|
+
* - [`Cookie`](https://serenity-js.org/api/web/class/Cookie/)
|
|
11
|
+
* - [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/)
|
|
12
12
|
*
|
|
13
13
|
* @group Errors
|
|
14
14
|
*/
|
|
@@ -3,9 +3,9 @@ import { LogicError } from '@serenity-js/core';
|
|
|
3
3
|
* Thrown when the presence of a JavaScript dialog obstructs taking a screenshot.
|
|
4
4
|
*
|
|
5
5
|
* ## Learn more
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
6
|
+
* - [`Photographer`](https://serenity-js.org/api/web/class/Photographer/)
|
|
7
|
+
* - [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
8
|
+
* - [`TakeScreenshot`](https://serenity-js.org/api/web/class/TakeScreenshot/)
|
|
9
9
|
*
|
|
10
10
|
* @group Errors
|
|
11
11
|
*/
|
|
@@ -6,9 +6,9 @@ const core_1 = require("@serenity-js/core");
|
|
|
6
6
|
* Thrown when the presence of a JavaScript dialog obstructs taking a screenshot.
|
|
7
7
|
*
|
|
8
8
|
* ## Learn more
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
9
|
+
* - [`Photographer`](https://serenity-js.org/api/web/class/Photographer/)
|
|
10
|
+
* - [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
11
|
+
* - [`TakeScreenshot`](https://serenity-js.org/api/web/class/TakeScreenshot/)
|
|
12
12
|
*
|
|
13
13
|
* @group Errors
|
|
14
14
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Expectation } from '@serenity-js/core';
|
|
2
2
|
import type { PageElement } from '../screenplay';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* - the element
|
|
6
|
-
* -
|
|
4
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is "active", which means it resolves to `true` when:
|
|
5
|
+
* - 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)
|
|
6
|
+
* - [`PageElement.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive) resolves to `true`
|
|
7
7
|
*
|
|
8
8
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
11
|
+
* - [`PageElement.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive)
|
|
12
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
13
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
14
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
15
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
16
16
|
*
|
|
17
17
|
* @group Expectations
|
|
18
18
|
*/
|
|
@@ -5,18 +5,18 @@ const assertions_1 = require("@serenity-js/assertions");
|
|
|
5
5
|
const core_1 = require("@serenity-js/core");
|
|
6
6
|
const isElementActive = core_1.Expectation.define('isActive', 'become active', (actual) => actual.isActive());
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* - the element
|
|
10
|
-
* -
|
|
8
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is "active", which means it resolves to `true` when:
|
|
9
|
+
* - 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)
|
|
10
|
+
* - [`PageElement.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive) resolves to `true`
|
|
11
11
|
*
|
|
12
12
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
13
13
|
*
|
|
14
14
|
* ## Learn more
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
15
|
+
* - [`PageElement.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive)
|
|
16
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
17
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
18
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
19
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
20
20
|
*
|
|
21
21
|
* @group Expectations
|
|
22
22
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Expectation } from '@serenity-js/core';
|
|
2
2
|
import type { PageElement } from '../screenplay';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* - the element
|
|
6
|
-
* -
|
|
4
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is clickable, which means it resolves to `true` when:
|
|
5
|
+
* - 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)
|
|
6
|
+
* - [`PageElement.isClickable`](https://serenity-js.org/api/web/class/PageElement/#isClickable) resolves to `true`
|
|
7
7
|
*
|
|
8
8
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
11
|
+
* - [`PageElement.isClickable`](https://serenity-js.org/api/web/class/PageElement/#isClickable)
|
|
12
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
13
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
14
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
15
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
16
16
|
*
|
|
17
17
|
* @group Expectations
|
|
18
18
|
*/
|
|
@@ -5,18 +5,18 @@ const assertions_1 = require("@serenity-js/assertions");
|
|
|
5
5
|
const core_1 = require("@serenity-js/core");
|
|
6
6
|
const isElementClickable = core_1.Expectation.define('isClickable', 'become clickable', (actual) => actual.isClickable());
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* - the element
|
|
10
|
-
* -
|
|
8
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is clickable, which means it resolves to `true` when:
|
|
9
|
+
* - 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)
|
|
10
|
+
* - [`PageElement.isClickable`](https://serenity-js.org/api/web/class/PageElement/#isClickable) resolves to `true`
|
|
11
11
|
*
|
|
12
12
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
13
13
|
*
|
|
14
14
|
* ## Learn more
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
15
|
+
* - [`PageElement.isClickable`](https://serenity-js.org/api/web/class/PageElement/#isClickable)
|
|
16
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
17
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
18
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
19
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
20
20
|
*
|
|
21
21
|
* @group Expectations
|
|
22
22
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Expectation } from '@serenity-js/core';
|
|
2
2
|
import type { PageElement } from '../screenplay';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* - the element
|
|
6
|
-
* -
|
|
4
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is enabled, which means it resolves to `true` when:
|
|
5
|
+
* - 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)
|
|
6
|
+
* - [`PageElement.isEnabled`](https://serenity-js.org/api/web/class/PageElement/#isEnabled) resolves to `true`
|
|
7
7
|
*
|
|
8
8
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
11
|
+
* - [`PageElement.isEnabled`](https://serenity-js.org/api/web/class/PageElement/#isEnabled)
|
|
12
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
13
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
14
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
15
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
16
16
|
*
|
|
17
17
|
* @group Expectations
|
|
18
18
|
*/
|
|
@@ -5,18 +5,18 @@ const assertions_1 = require("@serenity-js/assertions");
|
|
|
5
5
|
const core_1 = require("@serenity-js/core");
|
|
6
6
|
const isElementEnabled = core_1.Expectation.define('isEnabled', 'become enabled', (actual) => actual.isEnabled());
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* - the element
|
|
10
|
-
* -
|
|
8
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is enabled, which means it resolves to `true` when:
|
|
9
|
+
* - 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)
|
|
10
|
+
* - [`PageElement.isEnabled`](https://serenity-js.org/api/web/class/PageElement/#isEnabled) resolves to `true`
|
|
11
11
|
*
|
|
12
12
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
13
13
|
*
|
|
14
14
|
* ## Learn more
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
15
|
+
* - [`PageElement.isEnabled`](https://serenity-js.org/api/web/class/PageElement/#isEnabled)
|
|
16
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
17
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
18
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
19
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
20
20
|
*
|
|
21
21
|
* @group Expectations
|
|
22
22
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Expectation } from '@serenity-js/core';
|
|
2
2
|
import type { PageElement } from '../screenplay';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* - the element
|
|
6
|
-
* -
|
|
4
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an `<option>` or `<input>` element is selected, which means it resolves to `true` when:
|
|
5
|
+
* - 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)
|
|
6
|
+
* - [`PageElement.isSelected`](https://serenity-js.org/api/web/class/PageElement/#isSelected) resolves to `true`
|
|
7
7
|
*
|
|
8
8
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
11
|
+
* - [`PageElement.isSelected`](https://serenity-js.org/api/web/class/PageElement/#isSelected)
|
|
12
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
13
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
14
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
15
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
16
16
|
*
|
|
17
17
|
* @group Expectations
|
|
18
18
|
*/
|
|
@@ -5,18 +5,18 @@ const assertions_1 = require("@serenity-js/assertions");
|
|
|
5
5
|
const core_1 = require("@serenity-js/core");
|
|
6
6
|
const isElementSelected = core_1.Expectation.define('isSelected', 'become selected', (actual) => actual.isSelected());
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* - the element
|
|
10
|
-
* -
|
|
8
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an `<option>` or `<input>` element is selected, which means it resolves to `true` when:
|
|
9
|
+
* - 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)
|
|
10
|
+
* - [`PageElement.isSelected`](https://serenity-js.org/api/web/class/PageElement/#isSelected) resolves to `true`
|
|
11
11
|
*
|
|
12
12
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
13
13
|
*
|
|
14
14
|
* ## Learn more
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
15
|
+
* - [`PageElement.isSelected`](https://serenity-js.org/api/web/class/PageElement/#isSelected)
|
|
16
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
17
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
18
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
19
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
20
20
|
*
|
|
21
21
|
* @group Expectations
|
|
22
22
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Expectation } from '@serenity-js/core';
|
|
2
2
|
import type { PageElement } from '../screenplay';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* - the element
|
|
6
|
-
* -
|
|
4
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is visible, which means it resolves to `true` when:
|
|
5
|
+
* - 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)
|
|
6
|
+
* - [`PageElement.isVisible`](https://serenity-js.org/api/web/class/PageElement/#isVisible) resolves to `true`
|
|
7
7
|
*
|
|
8
8
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
9
9
|
*
|
|
10
10
|
* ## Learn more
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
11
|
+
* - [`PageElement.isVisible`](https://serenity-js.org/api/web/class/PageElement/#isVisible)
|
|
12
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
13
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
14
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
15
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
16
16
|
*
|
|
17
17
|
* @group Expectations
|
|
18
18
|
*/
|
|
@@ -5,18 +5,18 @@ const assertions_1 = require("@serenity-js/assertions");
|
|
|
5
5
|
const core_1 = require("@serenity-js/core");
|
|
6
6
|
const isElementVisible = core_1.Expectation.define('isVisible', 'become visible', (actual) => actual.isVisible());
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* - the element
|
|
10
|
-
* -
|
|
8
|
+
* [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is visible, which means it resolves to `true` when:
|
|
9
|
+
* - 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)
|
|
10
|
+
* - [`PageElement.isVisible`](https://serenity-js.org/api/web/class/PageElement/#isVisible) resolves to `true`
|
|
11
11
|
*
|
|
12
12
|
* If the above conditions are not met, the expectation resolves to `false`.
|
|
13
13
|
*
|
|
14
14
|
* ## Learn more
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
15
|
+
* - [`PageElement.isVisible`](https://serenity-js.org/api/web/class/PageElement/#isVisible)
|
|
16
|
+
* - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
17
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
18
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
19
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
20
20
|
*
|
|
21
21
|
* @group Expectations
|
|
22
22
|
*/
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { Ability } from '@serenity-js/core';
|
|
2
2
|
import type { BrowserCapabilities, BrowsingSession, Page } from '../models';
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
5
|
-
* to
|
|
4
|
+
* The [ability](https://serenity-js.org/api/core/class/Ability/) to `BrowseTheWeb` enables an [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
5
|
+
* 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.
|
|
6
6
|
*
|
|
7
|
-
* `BrowseTheWeb` wraps test integration tools such as [Playwright](/api/playwright),
|
|
8
|
-
* [Protractor](/api/protractor), or [WebdriverIO](/api/webdriverio),
|
|
9
|
-
* and together with Serenity/JS Web models, such as
|
|
7
|
+
* `BrowseTheWeb` wraps test integration tools such as [Playwright](https://serenity-js.org/api/playwright),
|
|
8
|
+
* [Protractor](https://serenity-js.org/api/protractor), or [WebdriverIO](https://serenity-js.org/api/webdriverio),
|
|
9
|
+
* 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
|
|
10
10
|
* to write Web-based tests following the Screenplay Pattern.
|
|
11
11
|
*
|
|
12
|
-
* The consistent and portable design of abstractions provided by the [`@serenity-js/web` module](/api/web)
|
|
12
|
+
* The consistent and portable design of abstractions provided by the [`@serenity-js/web` module](https://serenity-js.org/api/web)
|
|
13
13
|
* also helps to make your tests portable across the various test integration tools and helps to make your test
|
|
14
14
|
* code easier to reuse across projects and teams.
|
|
15
15
|
*
|
|
16
16
|
* ## Giving the actors an ability to `BrowseTheWeb`
|
|
17
17
|
*
|
|
18
|
-
* To give an
|
|
19
|
-
* via
|
|
18
|
+
* To give an [actor](https://serenity-js.org/api/core/class/Actor/) an ability to `BrowseTheWeb`, provide the **integration tool-specific implementation**
|
|
19
|
+
* 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).
|
|
20
20
|
*
|
|
21
21
|
* ```ts
|
|
22
22
|
* import { beforeEach } from 'mocha'
|
|
@@ -37,21 +37,23 @@ import type { BrowserCapabilities, BrowsingSession, Page } from '../models';
|
|
|
37
37
|
*
|
|
38
38
|
* To learn more about using Serenity/JS with your chosen test integration tool, follow their respective documentation:
|
|
39
39
|
*
|
|
40
|
-
* -
|
|
41
|
-
* -
|
|
42
|
-
* -
|
|
40
|
+
* - [`BrowseTheWebWithPlaywright`](https://serenity-js.org/api/playwright/class/BrowseTheWebWithPlaywright/)
|
|
41
|
+
* - [`BrowseTheWebWithProtractor`](https://serenity-js.org/api/protractor/class/BrowseTheWebWithProtractor/)
|
|
42
|
+
* - [`BrowseTheWebWithWebdriverIO`](https://serenity-js.org/api/webdriverio/class/BrowseTheWebWithWebdriverIO/)
|
|
43
43
|
*
|
|
44
44
|
* ## Using the ability to `BrowseTheWeb`
|
|
45
45
|
*
|
|
46
|
-
* To use the ability to `BrowseTheWeb` in a custom
|
|
46
|
+
* To use the ability to `BrowseTheWeb` in a custom [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
47
|
+
* 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)
|
|
47
48
|
* to retrieve it.
|
|
48
49
|
*
|
|
49
|
-
* This generic method retrieves the integration tool-specific implementation of
|
|
50
|
-
* such as
|
|
50
|
+
* 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/),
|
|
51
|
+
* such as [`BrowseTheWebWithPlaywright`](https://serenity-js.org/api/playwright/class/BrowseTheWebWithPlaywright/)
|
|
52
|
+
* or [`BrowseTheWebWithWebdriverIO`](https://serenity-js.org/api/webdriverio/class/BrowseTheWebWithWebdriverIO/), using [`Actor.abilityTo`](https://serenity-js.org/api/core/class/Actor/#abilityTo).
|
|
51
53
|
*
|
|
52
54
|
* This decoupling mechanism helps to make your test code portable across test integration tools,
|
|
53
55
|
* since the only part of your test suite that needs to know about the test integration tool used are the actors.
|
|
54
|
-
* The rest of your test code, so
|
|
56
|
+
* 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/),
|
|
55
57
|
* remain fully agnostic of the underlying tool.
|
|
56
58
|
*
|
|
57
59
|
* ```ts
|
|
@@ -69,10 +71,10 @@ import type { BrowserCapabilities, BrowsingSession, Page } from '../models';
|
|
|
69
71
|
*
|
|
70
72
|
* ### Learn more
|
|
71
73
|
*
|
|
72
|
-
* -
|
|
73
|
-
* -
|
|
74
|
-
* -
|
|
75
|
-
* -
|
|
74
|
+
* - [`Ability`](https://serenity-js.org/api/core/class/Ability/)
|
|
75
|
+
* - [`Actor.whoCan`](https://serenity-js.org/api/core/class/Actor/#whoCan)
|
|
76
|
+
* - [`Cast.where`](https://serenity-js.org/api/core/class/Cast/#where)
|
|
77
|
+
* - [`Cast.prepare`](https://serenity-js.org/api/core/class/Cast/#prepare)
|
|
76
78
|
*
|
|
77
79
|
* @group Abilities
|
|
78
80
|
*/
|
|
@@ -80,16 +82,16 @@ export declare abstract class BrowseTheWeb<Native_Element_Type = any> extends Ab
|
|
|
80
82
|
protected readonly session: BrowsingSession<Page<Native_Element_Type>>;
|
|
81
83
|
constructor(session: BrowsingSession<Page<Native_Element_Type>>);
|
|
82
84
|
/**
|
|
83
|
-
* Returns a
|
|
85
|
+
* Returns a [`Page`](https://serenity-js.org/api/web/class/Page/) representing the currently active browser tab.
|
|
84
86
|
*/
|
|
85
87
|
currentPage(): Promise<Page<Native_Element_Type>>;
|
|
86
88
|
/**
|
|
87
|
-
* Returns an array of
|
|
88
|
-
* available in the current
|
|
89
|
+
* Returns an array of [pages](https://serenity-js.org/api/web/class/Page/) representing all the browser tabs
|
|
90
|
+
* available in the current [`BrowsingSession`](https://serenity-js.org/api/web/class/BrowsingSession/).
|
|
89
91
|
*/
|
|
90
92
|
allPages(): Promise<Array<Page<Native_Element_Type>>>;
|
|
91
93
|
/**
|
|
92
|
-
* Returns
|
|
94
|
+
* Returns [basic meta-data](https://serenity-js.org/api/web/interface/BrowserCapabilities/) about the browser associated with this ability.
|
|
93
95
|
*/
|
|
94
96
|
browserCapabilities(): Promise<BrowserCapabilities>;
|
|
95
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowseTheWeb.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/BrowseTheWeb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5E
|
|
1
|
+
{"version":3,"file":"BrowseTheWeb.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/BrowseTheWeb.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,8BAAsB,YAAY,CAAC,mBAAmB,GAAG,GAAG,CAAE,SAAQ,OAAO;IAE7D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBAAnD,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAIlF;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAIvD;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAIrD;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAG5D"}
|