@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
|
@@ -5,10 +5,10 @@ const core_1 = require("@serenity-js/core");
|
|
|
5
5
|
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
6
|
const models_1 = require("../models");
|
|
7
7
|
/**
|
|
8
|
-
* Uses the
|
|
8
|
+
* Uses the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to retrieve
|
|
9
9
|
* the visible (i.e. not hidden by CSS) [`innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText) of:
|
|
10
|
-
* - a given
|
|
11
|
-
* - a group of
|
|
10
|
+
* - a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
11
|
+
* - a group of [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
12
12
|
*
|
|
13
13
|
* The result includes the visible text of any sub-elements, without any leading or trailing whitespace.
|
|
14
14
|
*
|
|
@@ -23,7 +23,7 @@ const models_1 = require("../models");
|
|
|
23
23
|
* </ul>
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
26
|
-
* ## Retrieve text of a single
|
|
26
|
+
* ## Retrieve text of a single [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
27
27
|
*
|
|
28
28
|
* ```ts
|
|
29
29
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -41,7 +41,7 @@ const models_1 = require("../models");
|
|
|
41
41
|
* )
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
|
-
* ## Retrieve text of multiple
|
|
44
|
+
* ## Retrieve text of multiple [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
45
45
|
*
|
|
46
46
|
* ```ts
|
|
47
47
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -61,7 +61,7 @@ const models_1 = require("../models");
|
|
|
61
61
|
* )
|
|
62
62
|
* ```
|
|
63
63
|
*
|
|
64
|
-
* ## Using as filter in
|
|
64
|
+
* ## Using as filter in [Page Element Query Language](https://serenity-js.org/handbook/web-testing/page-element-query-language/)
|
|
65
65
|
*
|
|
66
66
|
* ```ts
|
|
67
67
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -84,21 +84,21 @@ const models_1 = require("../models");
|
|
|
84
84
|
* ```
|
|
85
85
|
*
|
|
86
86
|
* ## Learn more
|
|
87
|
-
* -
|
|
88
|
-
* -
|
|
89
|
-
* -
|
|
90
|
-
* -
|
|
87
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
88
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
89
|
+
* - [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
90
|
+
* - [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
91
91
|
*
|
|
92
92
|
* @group Questions
|
|
93
93
|
*/
|
|
94
94
|
class Text {
|
|
95
95
|
/**
|
|
96
|
-
* Instantiates a
|
|
97
|
-
* the
|
|
98
|
-
* the text of a single
|
|
96
|
+
* Instantiates a [`Question`](https://serenity-js.org/api/core/class/Question/) that uses
|
|
97
|
+
* the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to retrieve
|
|
98
|
+
* the text of a single [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
99
99
|
*
|
|
100
100
|
* #### Learn more
|
|
101
|
-
* -
|
|
101
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
102
102
|
*
|
|
103
103
|
* @param pageElement
|
|
104
104
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { MetaQuestionAdapter, QuestionAdapter } from '@serenity-js/core';
|
|
2
2
|
import { PageElement } from '../models';
|
|
3
3
|
/**
|
|
4
|
-
* Uses the
|
|
5
|
-
* the `value` attribute of a given
|
|
4
|
+
* Uses the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to retrieve
|
|
5
|
+
* the `value` attribute of a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
6
6
|
*
|
|
7
7
|
* ## Example widget
|
|
8
8
|
* ```html
|
|
9
9
|
* <input type="text" id="username" value="Alice" />
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
|
-
* ## Retrieve the `value` of a given
|
|
12
|
+
* ## Retrieve the `value` of a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
13
13
|
*
|
|
14
14
|
* ```ts
|
|
15
15
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -26,7 +26,7 @@ import { PageElement } from '../models';
|
|
|
26
26
|
* )
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
|
-
* ## Using Value as
|
|
29
|
+
* ## Using Value as [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
30
30
|
*
|
|
31
31
|
* ```ts
|
|
32
32
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -47,21 +47,21 @@ import { PageElement } from '../models';
|
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
49
|
* ## Learn more
|
|
50
|
-
* -
|
|
51
|
-
* -
|
|
52
|
-
* -
|
|
53
|
-
* -
|
|
50
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
51
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
52
|
+
* - [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
53
|
+
* - [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
54
54
|
*
|
|
55
55
|
* @group Questions
|
|
56
56
|
*/
|
|
57
57
|
export declare class Value {
|
|
58
58
|
/**
|
|
59
|
-
* Instantiates a
|
|
60
|
-
* the
|
|
61
|
-
* the `value` attribute of a given
|
|
59
|
+
* Instantiates a [`Question`](https://serenity-js.org/api/core/class/Question/) that uses
|
|
60
|
+
* the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to retrieve
|
|
61
|
+
* the `value` attribute of a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
62
62
|
*
|
|
63
63
|
* #### Learn more
|
|
64
|
-
* -
|
|
64
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
65
65
|
*
|
|
66
66
|
* @param pageElement
|
|
67
67
|
*/
|
|
@@ -4,15 +4,15 @@ exports.Value = void 0;
|
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
const models_1 = require("../models");
|
|
6
6
|
/**
|
|
7
|
-
* Uses the
|
|
8
|
-
* the `value` attribute of a given
|
|
7
|
+
* Uses the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to retrieve
|
|
8
|
+
* the `value` attribute of a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
9
9
|
*
|
|
10
10
|
* ## Example widget
|
|
11
11
|
* ```html
|
|
12
12
|
* <input type="text" id="username" value="Alice" />
|
|
13
13
|
* ```
|
|
14
14
|
*
|
|
15
|
-
* ## Retrieve the `value` of a given
|
|
15
|
+
* ## Retrieve the `value` of a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
16
16
|
*
|
|
17
17
|
* ```ts
|
|
18
18
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -29,7 +29,7 @@ const models_1 = require("../models");
|
|
|
29
29
|
* )
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
|
-
* ## Using Value as
|
|
32
|
+
* ## Using Value as [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
33
33
|
*
|
|
34
34
|
* ```ts
|
|
35
35
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -50,21 +50,21 @@ const models_1 = require("../models");
|
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
52
|
* ## Learn more
|
|
53
|
-
* -
|
|
54
|
-
* -
|
|
55
|
-
* -
|
|
56
|
-
* -
|
|
53
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
54
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
55
|
+
* - [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
56
|
+
* - [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
57
57
|
*
|
|
58
58
|
* @group Questions
|
|
59
59
|
*/
|
|
60
60
|
class Value {
|
|
61
61
|
/**
|
|
62
|
-
* Instantiates a
|
|
63
|
-
* the
|
|
64
|
-
* the `value` attribute of a given
|
|
62
|
+
* Instantiates a [`Question`](https://serenity-js.org/api/core/class/Question/) that uses
|
|
63
|
+
* the [actor's](https://serenity-js.org/api/core/class/Actor/) [ability](https://serenity-js.org/api/core/class/Ability/) to [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) to retrieve
|
|
64
|
+
* the `value` attribute of a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
65
65
|
*
|
|
66
66
|
* #### Learn more
|
|
67
|
-
* -
|
|
67
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
68
68
|
*
|
|
69
69
|
* @param pageElement
|
|
70
70
|
*/
|
|
@@ -2,8 +2,9 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
|
|
|
2
2
|
import type { Stage, StageCrewMember } from '@serenity-js/core/lib/stage';
|
|
3
3
|
import * as strategies from './strategies';
|
|
4
4
|
/**
|
|
5
|
-
* The Photographer is a
|
|
6
|
-
* using the web browser associated with the
|
|
5
|
+
* The Photographer is a [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) who takes screenshots
|
|
6
|
+
* using the web browser associated with the [actor](https://serenity-js.org/api/core/class/Actor/) that is
|
|
7
|
+
* currently [in the spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/).
|
|
7
8
|
*
|
|
8
9
|
* ## Registering Photographer programmatically
|
|
9
10
|
*
|
|
@@ -49,7 +50,7 @@ import * as strategies from './strategies';
|
|
|
49
50
|
* ```
|
|
50
51
|
*
|
|
51
52
|
* #### Learn more
|
|
52
|
-
* -
|
|
53
|
+
* - [`SerenityOptions`](https://serenity-js.org/api/playwright-test/interface/SerenityOptions/)
|
|
53
54
|
*
|
|
54
55
|
* ## Using Photographer with WebdriverIO
|
|
55
56
|
*
|
|
@@ -140,11 +141,11 @@ import * as strategies from './strategies';
|
|
|
140
141
|
* ```
|
|
141
142
|
*
|
|
142
143
|
* ## Learn more
|
|
143
|
-
* -
|
|
144
|
-
* -
|
|
145
|
-
* -
|
|
146
|
-
* -
|
|
147
|
-
* -
|
|
144
|
+
* - [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
145
|
+
* - [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
146
|
+
* - [`TakePhotosBeforeAndAfterInteractions`](https://serenity-js.org/api/web/class/TakePhotosBeforeAndAfterInteractions/)
|
|
147
|
+
* - [`TakePhotosOfFailures`](https://serenity-js.org/api/web/class/TakePhotosOfFailures/)
|
|
148
|
+
* - [`TakePhotosOfInteractions`](https://serenity-js.org/api/web/class/TakePhotosOfInteractions/)
|
|
148
149
|
*
|
|
149
150
|
* @group Stage
|
|
150
151
|
*/
|
|
@@ -152,16 +153,16 @@ export declare class Photographer implements StageCrewMember {
|
|
|
152
153
|
private readonly photoTakingStrategy;
|
|
153
154
|
private stage?;
|
|
154
155
|
/**
|
|
155
|
-
* Instantiates a new
|
|
156
|
-
* as per the specified
|
|
156
|
+
* Instantiates a new [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) configured to take photos (screenshots)
|
|
157
|
+
* as per the specified [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/).
|
|
157
158
|
*
|
|
158
159
|
* @param strategy
|
|
159
|
-
* A no-arg constructor function that instantiates a
|
|
160
|
+
* A no-arg constructor function that instantiates a [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/)
|
|
160
161
|
*/
|
|
161
162
|
static whoWill(strategy: new () => strategies.PhotoTakingStrategy): StageCrewMember;
|
|
162
163
|
/**
|
|
163
|
-
* Instantiates a new
|
|
164
|
-
* as per the specified
|
|
164
|
+
* Instantiates a new [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) configured to take photos (screenshots)
|
|
165
|
+
* as per the specified [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/).
|
|
165
166
|
*
|
|
166
167
|
* @param config
|
|
167
168
|
*/
|
|
@@ -170,15 +171,15 @@ export declare class Photographer implements StageCrewMember {
|
|
|
170
171
|
}): StageCrewMember;
|
|
171
172
|
constructor(photoTakingStrategy: strategies.PhotoTakingStrategy, stage?: Stage);
|
|
172
173
|
/**
|
|
173
|
-
* Assigns this
|
|
174
|
+
* Assigns this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) to a given [`Stage`](https://serenity-js.org/api/core/class/Stage/).
|
|
174
175
|
*
|
|
175
176
|
* @param stage
|
|
176
|
-
* An instance of a
|
|
177
|
+
* An instance of a [`Stage`](https://serenity-js.org/api/core/class/Stage/) this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) will be assigned to
|
|
177
178
|
*/
|
|
178
179
|
assignedTo(stage: Stage): StageCrewMember;
|
|
179
180
|
/**
|
|
180
|
-
* Handles
|
|
181
|
-
* this
|
|
181
|
+
* Handles [`DomainEvent`](https://serenity-js.org/api/core-events/class/DomainEvent/) objects emitted by the [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
182
|
+
* this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) is assigned to.
|
|
182
183
|
*
|
|
183
184
|
* @param event
|
|
184
185
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Photographer.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/Photographer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"Photographer.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/Photographer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmJG;AACH,qBAAa,YAAa,YAAW,eAAe;IAqC5C,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,KAAK,CAAC;IApClB;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,UAAU,CAAC,mBAAmB,GAAG,eAAe;IAInF;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,OAAO,UAAU,EAAE,qBAAqB,CAAC,CAAA;KAAE,GAAG,eAAe;gBAkBzF,mBAAmB,EAAE,UAAU,CAAC,mBAAmB,EAC5D,KAAK,CAAC,EAAE,KAAK;IAIzB;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe;IAKzC;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CAarC"}
|
|
@@ -28,8 +28,9 @@ const core_1 = require("@serenity-js/core");
|
|
|
28
28
|
const events_1 = require("@serenity-js/core/lib/events");
|
|
29
29
|
const strategies = __importStar(require("./strategies"));
|
|
30
30
|
/**
|
|
31
|
-
* The Photographer is a
|
|
32
|
-
* using the web browser associated with the
|
|
31
|
+
* The Photographer is a [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) who takes screenshots
|
|
32
|
+
* using the web browser associated with the [actor](https://serenity-js.org/api/core/class/Actor/) that is
|
|
33
|
+
* currently [in the spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/).
|
|
33
34
|
*
|
|
34
35
|
* ## Registering Photographer programmatically
|
|
35
36
|
*
|
|
@@ -75,7 +76,7 @@ const strategies = __importStar(require("./strategies"));
|
|
|
75
76
|
* ```
|
|
76
77
|
*
|
|
77
78
|
* #### Learn more
|
|
78
|
-
* -
|
|
79
|
+
* - [`SerenityOptions`](https://serenity-js.org/api/playwright-test/interface/SerenityOptions/)
|
|
79
80
|
*
|
|
80
81
|
* ## Using Photographer with WebdriverIO
|
|
81
82
|
*
|
|
@@ -166,11 +167,11 @@ const strategies = __importStar(require("./strategies"));
|
|
|
166
167
|
* ```
|
|
167
168
|
*
|
|
168
169
|
* ## Learn more
|
|
169
|
-
* -
|
|
170
|
-
* -
|
|
171
|
-
* -
|
|
172
|
-
* -
|
|
173
|
-
* -
|
|
170
|
+
* - [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
171
|
+
* - [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
172
|
+
* - [`TakePhotosBeforeAndAfterInteractions`](https://serenity-js.org/api/web/class/TakePhotosBeforeAndAfterInteractions/)
|
|
173
|
+
* - [`TakePhotosOfFailures`](https://serenity-js.org/api/web/class/TakePhotosOfFailures/)
|
|
174
|
+
* - [`TakePhotosOfInteractions`](https://serenity-js.org/api/web/class/TakePhotosOfInteractions/)
|
|
174
175
|
*
|
|
175
176
|
* @group Stage
|
|
176
177
|
*/
|
|
@@ -178,18 +179,18 @@ class Photographer {
|
|
|
178
179
|
photoTakingStrategy;
|
|
179
180
|
stage;
|
|
180
181
|
/**
|
|
181
|
-
* Instantiates a new
|
|
182
|
-
* as per the specified
|
|
182
|
+
* Instantiates a new [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) configured to take photos (screenshots)
|
|
183
|
+
* as per the specified [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/).
|
|
183
184
|
*
|
|
184
185
|
* @param strategy
|
|
185
|
-
* A no-arg constructor function that instantiates a
|
|
186
|
+
* A no-arg constructor function that instantiates a [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/)
|
|
186
187
|
*/
|
|
187
188
|
static whoWill(strategy) {
|
|
188
189
|
return new Photographer(new strategy());
|
|
189
190
|
}
|
|
190
191
|
/**
|
|
191
|
-
* Instantiates a new
|
|
192
|
-
* as per the specified
|
|
192
|
+
* Instantiates a new [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) configured to take photos (screenshots)
|
|
193
|
+
* as per the specified [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/).
|
|
193
194
|
*
|
|
194
195
|
* @param config
|
|
195
196
|
*/
|
|
@@ -209,18 +210,18 @@ class Photographer {
|
|
|
209
210
|
this.stage = stage;
|
|
210
211
|
}
|
|
211
212
|
/**
|
|
212
|
-
* Assigns this
|
|
213
|
+
* Assigns this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) to a given [`Stage`](https://serenity-js.org/api/core/class/Stage/).
|
|
213
214
|
*
|
|
214
215
|
* @param stage
|
|
215
|
-
* An instance of a
|
|
216
|
+
* An instance of a [`Stage`](https://serenity-js.org/api/core/class/Stage/) this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) will be assigned to
|
|
216
217
|
*/
|
|
217
218
|
assignedTo(stage) {
|
|
218
219
|
this.stage = stage;
|
|
219
220
|
return this;
|
|
220
221
|
}
|
|
221
222
|
/**
|
|
222
|
-
* Handles
|
|
223
|
-
* this
|
|
223
|
+
* Handles [`DomainEvent`](https://serenity-js.org/api/core-events/class/DomainEvent/) objects emitted by the [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
224
|
+
* this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) is assigned to.
|
|
224
225
|
*
|
|
225
226
|
* @param event
|
|
226
227
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Photographer.js","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/Photographer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAmE;AAEnE,yDAAgF;AAGhF,yDAA2C;AAE3C
|
|
1
|
+
{"version":3,"file":"Photographer.js","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/Photographer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAmE;AAEnE,yDAAgF;AAGhF,yDAA2C;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmJG;AACH,MAAa,YAAY;IAqCA;IACT;IApCZ;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,QAAkD;QAC7D,OAAO,IAAI,YAAY,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,MAA4E;QACxF,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC3B,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,KAAK,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA,CAAI,yBAAyB;YAErJ,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAkB,CAAC,EAAE;gBACzD,OAAO,IAAI,YAAY,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,QAAkB,CAAC,EAAE,CAAC,CAAC;aACxE;YAED,MAAM,IAAI,yBAAkB,CACxB,IAAK,MAAM,CAAC,QAAS,6CAA6C;gBAClE,yBAA0B,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAE,GAAG,CAC/D,CAAC;SACL;QAED,OAAO,IAAI,YAAY,CAAC,IAAI,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,YACqB,mBAAmD,EAC5D,KAAa;QADJ,wBAAmB,GAAnB,mBAAmB,CAAgC;QAC5D,UAAK,GAAL,KAAK,CAAQ;IAEzB,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,KAAY;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,KAAkB;QACvB,IAAI,CAAE,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,IAAI,iBAAU,CAAC,8FAA8F,CAAC,CAAC;SACxH;QAED,IAAI,CAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,EAAE;YAClC,OAAO,KAAK,CAAC,CAAC;SACjB;QAED,IAAI,KAAK,YAAY,uBAAc,IAAI,KAAK,YAAY,yBAAgB,EAAE;YACtE,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SACnE;IACL,CAAC;CACJ;AAxED,oCAwEC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { Stage } from '@serenity-js/core';
|
|
2
2
|
import type { ActivityFinished, ActivityStarts, DomainEvent } from '@serenity-js/core/lib/events';
|
|
3
3
|
/**
|
|
4
|
-
* Configures the
|
|
5
|
-
* of the
|
|
4
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos, a.k.a. screenshots,
|
|
5
|
+
* of the [`Activity`](https://serenity-js.org/api/core/class/Activity/) performed by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/)
|
|
6
6
|
* when desired conditions are met.
|
|
7
7
|
*
|
|
8
8
|
* @group Stage
|
|
9
9
|
*/
|
|
10
10
|
export declare abstract class PhotoTakingStrategy {
|
|
11
11
|
/**
|
|
12
|
-
* Takes a photo of the web browser used by the
|
|
12
|
+
* Takes a photo of the web browser used by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/).
|
|
13
13
|
*
|
|
14
14
|
* #### Learn more
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
15
|
+
* - [ActivityStarts](https://serenity-js.org/api/core-events/class/ActivityStarts/)
|
|
16
|
+
* - [ActivityFinished](https://serenity-js.org/api/core-events/class/ActivityFinished/)
|
|
17
|
+
* - [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
18
18
|
*
|
|
19
19
|
* @param event
|
|
20
20
|
* @param stage
|
|
@@ -6,20 +6,20 @@ const events_1 = require("@serenity-js/core/lib/events");
|
|
|
6
6
|
const model_1 = require("@serenity-js/core/lib/model");
|
|
7
7
|
const screenplay_1 = require("../../../../screenplay");
|
|
8
8
|
/**
|
|
9
|
-
* Configures the
|
|
10
|
-
* of the
|
|
9
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos, a.k.a. screenshots,
|
|
10
|
+
* of the [`Activity`](https://serenity-js.org/api/core/class/Activity/) performed by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/)
|
|
11
11
|
* when desired conditions are met.
|
|
12
12
|
*
|
|
13
13
|
* @group Stage
|
|
14
14
|
*/
|
|
15
15
|
class PhotoTakingStrategy {
|
|
16
16
|
/**
|
|
17
|
-
* Takes a photo of the web browser used by the
|
|
17
|
+
* Takes a photo of the web browser used by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/).
|
|
18
18
|
*
|
|
19
19
|
* #### Learn more
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
20
|
+
* - [ActivityStarts](https://serenity-js.org/api/core-events/class/ActivityStarts/)
|
|
21
|
+
* - [ActivityFinished](https://serenity-js.org/api/core-events/class/ActivityFinished/)
|
|
22
|
+
* - [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
23
23
|
*
|
|
24
24
|
* @param event
|
|
25
25
|
* @param stage
|
|
@@ -2,9 +2,9 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
|
|
|
2
2
|
import { InteractionFinished, InteractionStarts } from '@serenity-js/core/lib/events';
|
|
3
3
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
4
4
|
/**
|
|
5
|
-
* Configures the
|
|
6
|
-
* every single
|
|
7
|
-
* by the
|
|
5
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos (a.k.a. screenshots) **both before and after**
|
|
6
|
+
* every single [`Interaction`](https://serenity-js.org/api/core/class/Interaction/) performed
|
|
7
|
+
* by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/).
|
|
8
8
|
*
|
|
9
9
|
* **Please note** that this strategy will result in _a lot_ of screenshots being taken,
|
|
10
10
|
* which will seriously affect the performance of your tests.
|
|
@@ -4,9 +4,9 @@ exports.TakePhotosBeforeAndAfterInteractions = void 0;
|
|
|
4
4
|
const events_1 = require("@serenity-js/core/lib/events");
|
|
5
5
|
const PhotoTakingStrategy_1 = require("./PhotoTakingStrategy");
|
|
6
6
|
/**
|
|
7
|
-
* Configures the
|
|
8
|
-
* every single
|
|
9
|
-
* by the
|
|
7
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos (a.k.a. screenshots) **both before and after**
|
|
8
|
+
* every single [`Interaction`](https://serenity-js.org/api/core/class/Interaction/) performed
|
|
9
|
+
* by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/).
|
|
10
10
|
*
|
|
11
11
|
* **Please note** that this strategy will result in _a lot_ of screenshots being taken,
|
|
12
12
|
* which will seriously affect the performance of your tests.
|
|
@@ -2,9 +2,9 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
|
|
|
2
2
|
import { InteractionFinished } from '@serenity-js/core/lib/events';
|
|
3
3
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
4
4
|
/**
|
|
5
|
-
* Configures the
|
|
6
|
-
* when then
|
|
7
|
-
* by the
|
|
5
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos (a.k.a. screenshots)
|
|
6
|
+
* when then [`Interaction`](https://serenity-js.org/api/core/class/Interaction/) performed
|
|
7
|
+
* by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/)
|
|
8
8
|
* results in an error.
|
|
9
9
|
*
|
|
10
10
|
* This strategy works best when you are interested in the screenshots only when
|
|
@@ -5,9 +5,9 @@ const events_1 = require("@serenity-js/core/lib/events");
|
|
|
5
5
|
const model_1 = require("@serenity-js/core/lib/model");
|
|
6
6
|
const PhotoTakingStrategy_1 = require("./PhotoTakingStrategy");
|
|
7
7
|
/**
|
|
8
|
-
* Configures the
|
|
9
|
-
* when then
|
|
10
|
-
* by the
|
|
8
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos (a.k.a. screenshots)
|
|
9
|
+
* when then [`Interaction`](https://serenity-js.org/api/core/class/Interaction/) performed
|
|
10
|
+
* by the [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/)
|
|
11
11
|
* results in an error.
|
|
12
12
|
*
|
|
13
13
|
* This strategy works best when you are interested in the screenshots only when
|
|
@@ -2,9 +2,9 @@ import type { DomainEvent } from '@serenity-js/core/lib/events';
|
|
|
2
2
|
import { InteractionFinished } from '@serenity-js/core/lib/events';
|
|
3
3
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
4
4
|
/**
|
|
5
|
-
* Configures the
|
|
6
|
-
* when then
|
|
7
|
-
* performs any
|
|
5
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos (a.k.a. screenshots)
|
|
6
|
+
* when then [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/)
|
|
7
|
+
* performs any [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
8
8
|
*
|
|
9
9
|
* This strategy works best when you want the results of your automated tests
|
|
10
10
|
* to become comprehensive living documentation of your system.
|
|
@@ -4,9 +4,9 @@ exports.TakePhotosOfInteractions = void 0;
|
|
|
4
4
|
const events_1 = require("@serenity-js/core/lib/events");
|
|
5
5
|
const PhotoTakingStrategy_1 = require("./PhotoTakingStrategy");
|
|
6
6
|
/**
|
|
7
|
-
* Configures the
|
|
8
|
-
* when then
|
|
9
|
-
* performs any
|
|
7
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos (a.k.a. screenshots)
|
|
8
|
+
* when then [`Actor`](https://serenity-js.org/api/core/class/Actor/) in the [spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/)
|
|
9
|
+
* performs any [`Interaction`](https://serenity-js.org/api/core/class/Interaction/).
|
|
10
10
|
*
|
|
11
11
|
* This strategy works best when you want the results of your automated tests
|
|
12
12
|
* to become comprehensive living documentation of your system.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/web",
|
|
3
|
-
"version": "3.25.
|
|
4
|
-
"description": "Serenity/JS Screenplay Pattern
|
|
3
|
+
"version": "3.25.2",
|
|
4
|
+
"description": "Serenity/JS Screenplay Pattern library offering a flexible, web driver-agnostic approach to interacting with web-based user interfaces and components, suitable for various testing contexts",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
7
7
|
"email": "jan.molak@smartcodeltd.co.uk",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"node": "^16.13 || ^18.12 || ^20"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@serenity-js/assertions": "3.25.
|
|
49
|
-
"@serenity-js/core": "3.25.
|
|
48
|
+
"@serenity-js/assertions": "3.25.2",
|
|
49
|
+
"@serenity-js/core": "3.25.2",
|
|
50
50
|
"tiny-types": "1.22.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"ts-node": "10.9.2",
|
|
60
60
|
"typescript": "5.2.2"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "98b68da1e04a8fcbb255dca509b7bc9c322a3b6b"
|
|
63
63
|
}
|
|
@@ -5,8 +5,8 @@ import { LogicError } from '@serenity-js/core';
|
|
|
5
5
|
* that's already been closed.
|
|
6
6
|
*
|
|
7
7
|
* ## Learn more
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
8
|
+
* - [`TakeScreenshot`](https://serenity-js.org/api/web/class/TakeScreenshot/)
|
|
9
|
+
* - [`Page.takeScreenshot`](https://serenity-js.org/api/web/class/Page/#takeScreenshot)
|
|
10
10
|
*
|
|
11
11
|
* @group Errors
|
|
12
12
|
*/
|
|
@@ -5,8 +5,8 @@ import { RuntimeError } from '@serenity-js/core';
|
|
|
5
5
|
* you're trying to retrieve has not been set yet.
|
|
6
6
|
*
|
|
7
7
|
* ## Learn more
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
8
|
+
* - [`Cookie`](https://serenity-js.org/api/web/class/Cookie/)
|
|
9
|
+
* - [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/)
|
|
10
10
|
*
|
|
11
11
|
* @group Errors
|
|
12
12
|
*/
|
|
@@ -4,9 +4,9 @@ import { LogicError } from '@serenity-js/core';
|
|
|
4
4
|
* Thrown when the presence of a JavaScript dialog obstructs taking a screenshot.
|
|
5
5
|
*
|
|
6
6
|
* ## Learn more
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
7
|
+
* - [`Photographer`](https://serenity-js.org/api/web/class/Photographer/)
|
|
8
|
+
* - [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
9
|
+
* - [`TakeScreenshot`](https://serenity-js.org/api/web/class/TakeScreenshot/)
|
|
10
10
|
*
|
|
11
11
|
* @group Errors
|
|
12
12
|
*/
|
|
@@ -9,18 +9,18 @@ const isElementActive = 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 "active", 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.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive) 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.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive)
|
|
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
|
*/
|