@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
|
@@ -6,10 +6,10 @@ import type { PageElements } from '../models';
|
|
|
6
6
|
import { PageElement } from '../models';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Uses the
|
|
9
|
+
* 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
|
|
10
10
|
* the visible (i.e. not hidden by CSS) [`innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText) of:
|
|
11
|
-
* - a given
|
|
12
|
-
* - a group of
|
|
11
|
+
* - a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
12
|
+
* - a group of [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
13
13
|
*
|
|
14
14
|
* The result includes the visible text of any sub-elements, without any leading or trailing whitespace.
|
|
15
15
|
*
|
|
@@ -24,7 +24,7 @@ import { PageElement } from '../models';
|
|
|
24
24
|
* </ul>
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
|
-
* ## Retrieve text of a single
|
|
27
|
+
* ## Retrieve text of a single [`PageElement`](https://serenity-js.org/api/web/class/PageElement/)
|
|
28
28
|
*
|
|
29
29
|
* ```ts
|
|
30
30
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -42,7 +42,7 @@ import { PageElement } from '../models';
|
|
|
42
42
|
* )
|
|
43
43
|
* ```
|
|
44
44
|
*
|
|
45
|
-
* ## Retrieve text of multiple
|
|
45
|
+
* ## Retrieve text of multiple [`PageElement`](https://serenity-js.org/api/web/class/PageElements/)
|
|
46
46
|
*
|
|
47
47
|
* ```ts
|
|
48
48
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -62,7 +62,7 @@ import { PageElement } from '../models';
|
|
|
62
62
|
* )
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
|
-
* ## Using as filter in
|
|
65
|
+
* ## Using as filter in [Page Element Query Language](https://serenity-js.org/handbook/web-testing/page-element-query-language/)
|
|
66
66
|
*
|
|
67
67
|
* ```ts
|
|
68
68
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -85,22 +85,22 @@ import { PageElement } from '../models';
|
|
|
85
85
|
* ```
|
|
86
86
|
*
|
|
87
87
|
* ## Learn more
|
|
88
|
-
* -
|
|
89
|
-
* -
|
|
90
|
-
* -
|
|
91
|
-
* -
|
|
88
|
+
* - [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/)
|
|
89
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
90
|
+
* - [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
91
|
+
* - [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
92
92
|
*
|
|
93
93
|
* @group Questions
|
|
94
94
|
*/
|
|
95
95
|
export class Text {
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* Instantiates a
|
|
99
|
-
* the
|
|
100
|
-
* the text of a single
|
|
98
|
+
* Instantiates a [`Question`](https://serenity-js.org/api/core/class/Question/) that uses
|
|
99
|
+
* 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
|
|
100
|
+
* the text of a single [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
101
101
|
*
|
|
102
102
|
* #### Learn more
|
|
103
|
-
* -
|
|
103
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
104
104
|
*
|
|
105
105
|
* @param pageElement
|
|
106
106
|
*/
|
|
@@ -117,12 +117,12 @@ export class Text {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
* Instantiates a
|
|
121
|
-
* the
|
|
122
|
-
* the text of a group of
|
|
120
|
+
* Instantiates a [`Question`](https://serenity-js.org/api/core/class/Question/) that uses
|
|
121
|
+
* 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
|
|
122
|
+
* the text of a group of [`PageElement`](https://serenity-js.org/api/web/class/PageElements/).
|
|
123
123
|
*
|
|
124
124
|
* #### Learn more
|
|
125
|
-
* -
|
|
125
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
126
126
|
*
|
|
127
127
|
* @param pageElements
|
|
128
128
|
*/
|
|
@@ -4,15 +4,15 @@ import { Question, the } from '@serenity-js/core';
|
|
|
4
4
|
import { PageElement } from '../models';
|
|
5
5
|
|
|
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 @@ import { PageElement } from '../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,22 +50,22 @@ import { PageElement } from '../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
|
export class Value {
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Instantiates a
|
|
64
|
-
* the
|
|
65
|
-
* the `value` attribute of a given
|
|
63
|
+
* Instantiates a [`Question`](https://serenity-js.org/api/core/class/Question/) that uses
|
|
64
|
+
* 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
|
|
65
|
+
* the `value` attribute of a given [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
|
|
66
66
|
*
|
|
67
67
|
* #### Learn more
|
|
68
|
-
* -
|
|
68
|
+
* - [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/)
|
|
69
69
|
*
|
|
70
70
|
* @param pageElement
|
|
71
71
|
*/
|
|
@@ -6,8 +6,9 @@ import type { Stage, StageCrewMember } from '@serenity-js/core/lib/stage';
|
|
|
6
6
|
import * as strategies from './strategies';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* The Photographer is a
|
|
10
|
-
* using the web browser associated with the
|
|
9
|
+
* The Photographer is a [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) who takes screenshots
|
|
10
|
+
* using the web browser associated with the [actor](https://serenity-js.org/api/core/class/Actor/) that is
|
|
11
|
+
* currently [in the spotlight](https://serenity-js.org/api/core/function/actorInTheSpotlight/).
|
|
11
12
|
*
|
|
12
13
|
* ## Registering Photographer programmatically
|
|
13
14
|
*
|
|
@@ -53,7 +54,7 @@ import * as strategies from './strategies';
|
|
|
53
54
|
* ```
|
|
54
55
|
*
|
|
55
56
|
* #### Learn more
|
|
56
|
-
* -
|
|
57
|
+
* - [`SerenityOptions`](https://serenity-js.org/api/playwright-test/interface/SerenityOptions/)
|
|
57
58
|
*
|
|
58
59
|
* ## Using Photographer with WebdriverIO
|
|
59
60
|
*
|
|
@@ -144,30 +145,30 @@ import * as strategies from './strategies';
|
|
|
144
145
|
* ```
|
|
145
146
|
*
|
|
146
147
|
* ## Learn more
|
|
147
|
-
* -
|
|
148
|
-
* -
|
|
149
|
-
* -
|
|
150
|
-
* -
|
|
151
|
-
* -
|
|
148
|
+
* - [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
149
|
+
* - [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
150
|
+
* - [`TakePhotosBeforeAndAfterInteractions`](https://serenity-js.org/api/web/class/TakePhotosBeforeAndAfterInteractions/)
|
|
151
|
+
* - [`TakePhotosOfFailures`](https://serenity-js.org/api/web/class/TakePhotosOfFailures/)
|
|
152
|
+
* - [`TakePhotosOfInteractions`](https://serenity-js.org/api/web/class/TakePhotosOfInteractions/)
|
|
152
153
|
*
|
|
153
154
|
* @group Stage
|
|
154
155
|
*/
|
|
155
156
|
export class Photographer implements StageCrewMember {
|
|
156
157
|
|
|
157
158
|
/**
|
|
158
|
-
* Instantiates a new
|
|
159
|
-
* as per the specified
|
|
159
|
+
* Instantiates a new [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) configured to take photos (screenshots)
|
|
160
|
+
* as per the specified [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/).
|
|
160
161
|
*
|
|
161
162
|
* @param strategy
|
|
162
|
-
* A no-arg constructor function that instantiates a
|
|
163
|
+
* A no-arg constructor function that instantiates a [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/)
|
|
163
164
|
*/
|
|
164
165
|
static whoWill(strategy: new () => strategies.PhotoTakingStrategy): StageCrewMember {
|
|
165
166
|
return new Photographer(new strategy());
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
/**
|
|
169
|
-
* Instantiates a new
|
|
170
|
-
* as per the specified
|
|
170
|
+
* Instantiates a new [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) configured to take photos (screenshots)
|
|
171
|
+
* as per the specified [`PhotoTakingStrategy`](https://serenity-js.org/api/web/class/PhotoTakingStrategy/).
|
|
171
172
|
*
|
|
172
173
|
* @param config
|
|
173
174
|
*/
|
|
@@ -195,10 +196,10 @@ export class Photographer implements StageCrewMember {
|
|
|
195
196
|
}
|
|
196
197
|
|
|
197
198
|
/**
|
|
198
|
-
* Assigns this
|
|
199
|
+
* Assigns this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) to a given [`Stage`](https://serenity-js.org/api/core/class/Stage/).
|
|
199
200
|
*
|
|
200
201
|
* @param stage
|
|
201
|
-
* An instance of a
|
|
202
|
+
* 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
|
|
202
203
|
*/
|
|
203
204
|
assignedTo(stage: Stage): StageCrewMember {
|
|
204
205
|
this.stage = stage;
|
|
@@ -206,8 +207,8 @@ export class Photographer implements StageCrewMember {
|
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
/**
|
|
209
|
-
* Handles
|
|
210
|
-
* this
|
|
210
|
+
* Handles [`DomainEvent`](https://serenity-js.org/api/core-events/class/DomainEvent/) objects emitted by the [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
211
|
+
* this [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) is assigned to.
|
|
211
212
|
*
|
|
212
213
|
* @param event
|
|
213
214
|
*/
|
|
@@ -7,8 +7,8 @@ import { CorrelationId, Description, Name, Photo } from '@serenity-js/core/lib/m
|
|
|
7
7
|
import { BrowseTheWeb } from '../../../../screenplay';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Configures the
|
|
11
|
-
* of the
|
|
10
|
+
* Configures the [`Photographer`](https://serenity-js.org/api/web/class/Photographer/) to take photos, a.k.a. screenshots,
|
|
11
|
+
* 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/)
|
|
12
12
|
* when desired conditions are met.
|
|
13
13
|
*
|
|
14
14
|
* @group Stage
|
|
@@ -16,12 +16,12 @@ import { BrowseTheWeb } from '../../../../screenplay';
|
|
|
16
16
|
export abstract class PhotoTakingStrategy {
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Takes a photo of the web browser used by the
|
|
19
|
+
* 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/).
|
|
20
20
|
*
|
|
21
21
|
* #### Learn more
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
24
|
-
* -
|
|
22
|
+
* - [ActivityStarts](https://serenity-js.org/api/core-events/class/ActivityStarts/)
|
|
23
|
+
* - [ActivityFinished](https://serenity-js.org/api/core-events/class/ActivityFinished/)
|
|
24
|
+
* - [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
25
25
|
*
|
|
26
26
|
* @param event
|
|
27
27
|
* @param stage
|
|
@@ -4,9 +4,9 @@ import { InteractionFinished, InteractionStarts } from '@serenity-js/core/lib/ev
|
|
|
4
4
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
5
5
|
|
|
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.
|
|
@@ -5,9 +5,9 @@ import { ImplementationPending } from '@serenity-js/core/lib/model';
|
|
|
5
5
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
6
6
|
|
|
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
|
|
@@ -4,9 +4,9 @@ import { InteractionFinished } from '@serenity-js/core/lib/events';
|
|
|
4
4
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
5
5
|
|
|
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.
|