@serenity-js/protractor 2.32.4 → 3.0.0-rc.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 +75 -0
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/screenplay/abilities/{BrowseTheWeb.d.ts → BrowseTheWebWithProtractor.d.ts} +52 -160
- package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithProtractor.js} +169 -218
- package/lib/screenplay/abilities/BrowseTheWebWithProtractor.js.map +1 -0
- package/lib/screenplay/abilities/index.d.ts +1 -1
- package/lib/screenplay/abilities/index.js +1 -1
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/index.d.ts +1 -0
- package/lib/screenplay/index.js +1 -0
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/interactions/UseAngular.js +2 -2
- package/lib/screenplay/interactions/UseAngular.js.map +1 -1
- package/lib/screenplay/interactions/index.d.ts +0 -19
- package/lib/screenplay/interactions/index.js +0 -19
- package/lib/screenplay/interactions/index.js.map +1 -1
- package/lib/screenplay/models/ProtractorCookie.d.ts +11 -0
- package/lib/screenplay/models/ProtractorCookie.js +39 -0
- package/lib/screenplay/models/ProtractorCookie.js.map +1 -0
- package/lib/screenplay/models/ProtractorModalDialog.d.ts +11 -0
- package/lib/screenplay/models/ProtractorModalDialog.js +43 -0
- package/lib/screenplay/models/ProtractorModalDialog.js.map +1 -0
- package/lib/screenplay/models/ProtractorNativeElementRoot.d.ts +5 -0
- package/lib/screenplay/{interactions/EnterBuilder.js → models/ProtractorNativeElementRoot.js} +1 -1
- package/lib/screenplay/models/ProtractorNativeElementRoot.js.map +1 -0
- package/lib/screenplay/models/ProtractorPage.d.ts +24 -0
- package/lib/screenplay/models/ProtractorPage.js +92 -0
- package/lib/screenplay/models/ProtractorPage.js.map +1 -0
- package/lib/screenplay/models/ProtractorPageElement.d.ts +23 -0
- package/lib/screenplay/models/ProtractorPageElement.js +112 -0
- package/lib/screenplay/models/ProtractorPageElement.js.map +1 -0
- package/lib/screenplay/models/ProtractorPageElements.d.ts +16 -0
- package/lib/screenplay/models/ProtractorPageElements.js +62 -0
- package/lib/screenplay/models/ProtractorPageElements.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +6 -0
- package/lib/{expectations → screenplay/models}/index.js +6 -6
- package/lib/screenplay/models/index.js.map +1 -0
- package/lib/{promiseOf.d.ts → screenplay/promised.d.ts} +1 -1
- package/lib/{promiseOf.js → screenplay/promised.js} +4 -4
- package/lib/screenplay/promised.js.map +1 -0
- package/lib/screenplay/promisedWebElement.d.ts +11 -0
- package/lib/screenplay/promisedWebElement.js +27 -0
- package/lib/screenplay/promisedWebElement.js.map +1 -0
- package/lib/screenplay/questions/ProtractorParam.d.ts +24 -29
- package/lib/screenplay/questions/ProtractorParam.js +26 -33
- package/lib/screenplay/questions/ProtractorParam.js.map +1 -1
- package/lib/screenplay/questions/index.d.ts +0 -13
- package/lib/screenplay/questions/index.js +0 -16
- package/lib/screenplay/questions/index.js.map +1 -1
- package/package.json +19 -21
- package/src/index.ts +0 -2
- package/src/screenplay/abilities/{BrowseTheWeb.ts → BrowseTheWebWithProtractor.ts} +216 -241
- package/src/screenplay/abilities/index.ts +1 -1
- package/src/screenplay/index.ts +1 -0
- package/src/screenplay/interactions/UseAngular.ts +3 -3
- package/src/screenplay/interactions/index.ts +0 -19
- package/src/screenplay/models/ProtractorCookie.ts +41 -0
- package/src/screenplay/models/ProtractorModalDialog.ts +49 -0
- package/src/screenplay/models/ProtractorNativeElementRoot.ts +6 -0
- package/src/screenplay/models/ProtractorPage.ts +116 -0
- package/src/screenplay/models/ProtractorPageElement.ts +167 -0
- package/src/screenplay/models/ProtractorPageElements.ts +86 -0
- package/src/screenplay/models/index.ts +7 -0
- package/src/{promiseOf.ts → screenplay/promised.ts} +1 -1
- package/src/screenplay/promisedWebElement.ts +28 -0
- package/src/screenplay/questions/ProtractorParam.ts +29 -38
- package/src/screenplay/questions/index.ts +0 -13
- package/lib/expectations/ElementFinderExpectation.d.ts +0 -11
- package/lib/expectations/ElementFinderExpectation.js +0 -24
- package/lib/expectations/ElementFinderExpectation.js.map +0 -1
- package/lib/expectations/index.d.ts +0 -6
- package/lib/expectations/index.js.map +0 -1
- package/lib/expectations/isActive.d.ts +0 -13
- package/lib/expectations/isActive.js +0 -19
- package/lib/expectations/isActive.js.map +0 -1
- package/lib/expectations/isClickable.d.ts +0 -13
- package/lib/expectations/isClickable.js +0 -22
- package/lib/expectations/isClickable.js.map +0 -1
- package/lib/expectations/isEnabled.d.ts +0 -13
- package/lib/expectations/isEnabled.js +0 -19
- package/lib/expectations/isEnabled.js.map +0 -1
- package/lib/expectations/isPresent.d.ts +0 -14
- package/lib/expectations/isPresent.js +0 -20
- package/lib/expectations/isPresent.js.map +0 -1
- package/lib/expectations/isSelected.d.ts +0 -13
- package/lib/expectations/isSelected.js +0 -22
- package/lib/expectations/isSelected.js.map +0 -1
- package/lib/expectations/isVisible.d.ts +0 -13
- package/lib/expectations/isVisible.js +0 -25
- package/lib/expectations/isVisible.js.map +0 -1
- package/lib/promiseOf.js.map +0 -1
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +0 -1
- package/lib/screenplay/interactions/Accept.d.ts +0 -81
- package/lib/screenplay/interactions/Accept.js +0 -95
- package/lib/screenplay/interactions/Accept.js.map +0 -1
- package/lib/screenplay/interactions/Clear.d.ts +0 -88
- package/lib/screenplay/interactions/Clear.js +0 -121
- package/lib/screenplay/interactions/Clear.js.map +0 -1
- package/lib/screenplay/interactions/Click.d.ts +0 -81
- package/lib/screenplay/interactions/Click.js +0 -95
- package/lib/screenplay/interactions/Click.js.map +0 -1
- package/lib/screenplay/interactions/Close.d.ts +0 -89
- package/lib/screenplay/interactions/Close.js +0 -169
- package/lib/screenplay/interactions/Close.js.map +0 -1
- package/lib/screenplay/interactions/DeleteCookies.d.ts +0 -72
- package/lib/screenplay/interactions/DeleteCookies.js +0 -149
- package/lib/screenplay/interactions/DeleteCookies.js.map +0 -1
- package/lib/screenplay/interactions/Dismiss.d.ts +0 -85
- package/lib/screenplay/interactions/Dismiss.js +0 -99
- package/lib/screenplay/interactions/Dismiss.js.map +0 -1
- package/lib/screenplay/interactions/DoubleClick.d.ts +0 -99
- package/lib/screenplay/interactions/DoubleClick.js +0 -121
- package/lib/screenplay/interactions/DoubleClick.js.map +0 -1
- package/lib/screenplay/interactions/Enter.d.ts +0 -81
- package/lib/screenplay/interactions/Enter.js +0 -96
- package/lib/screenplay/interactions/Enter.js.map +0 -1
- package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -27
- package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ExecuteScript.d.ts +0 -171
- package/lib/screenplay/interactions/ExecuteScript.js +0 -291
- package/lib/screenplay/interactions/ExecuteScript.js.map +0 -1
- package/lib/screenplay/interactions/Hover.d.ts +0 -86
- package/lib/screenplay/interactions/Hover.js +0 -103
- package/lib/screenplay/interactions/Hover.js.map +0 -1
- package/lib/screenplay/interactions/Navigate.d.ts +0 -149
- package/lib/screenplay/interactions/Navigate.js +0 -345
- package/lib/screenplay/interactions/Navigate.js.map +0 -1
- package/lib/screenplay/interactions/Press.d.ts +0 -90
- package/lib/screenplay/interactions/Press.js +0 -127
- package/lib/screenplay/interactions/Press.js.map +0 -1
- package/lib/screenplay/interactions/PressBuilder.d.ts +0 -27
- package/lib/screenplay/interactions/PressBuilder.js +0 -3
- package/lib/screenplay/interactions/PressBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ResizeBrowserWindow.d.ts +0 -69
- package/lib/screenplay/interactions/ResizeBrowserWindow.js +0 -144
- package/lib/screenplay/interactions/ResizeBrowserWindow.js.map +0 -1
- package/lib/screenplay/interactions/RightClick.d.ts +0 -97
- package/lib/screenplay/interactions/RightClick.js +0 -113
- package/lib/screenplay/interactions/RightClick.js.map +0 -1
- package/lib/screenplay/interactions/Scroll.d.ts +0 -83
- package/lib/screenplay/interactions/Scroll.js +0 -98
- package/lib/screenplay/interactions/Scroll.js.map +0 -1
- package/lib/screenplay/interactions/Select.d.ts +0 -212
- package/lib/screenplay/interactions/Select.js +0 -342
- package/lib/screenplay/interactions/Select.js.map +0 -1
- package/lib/screenplay/interactions/SelectBuilder.d.ts +0 -33
- package/lib/screenplay/interactions/SelectBuilder.js +0 -3
- package/lib/screenplay/interactions/SelectBuilder.js.map +0 -1
- package/lib/screenplay/interactions/Switch.d.ts +0 -210
- package/lib/screenplay/interactions/Switch.js +0 -345
- package/lib/screenplay/interactions/Switch.js.map +0 -1
- package/lib/screenplay/interactions/TakeScreenshot.d.ts +0 -67
- package/lib/screenplay/interactions/TakeScreenshot.js +0 -86
- package/lib/screenplay/interactions/TakeScreenshot.js.map +0 -1
- package/lib/screenplay/interactions/Wait.d.ts +0 -147
- package/lib/screenplay/interactions/Wait.js +0 -247
- package/lib/screenplay/interactions/Wait.js.map +0 -1
- package/lib/screenplay/interactions/WaitBuilder.d.ts +0 -33
- package/lib/screenplay/interactions/WaitBuilder.js +0 -3
- package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
- package/lib/screenplay/questions/Attribute.d.ts +0 -29
- package/lib/screenplay/questions/Attribute.js +0 -56
- package/lib/screenplay/questions/Attribute.js.map +0 -1
- package/lib/screenplay/questions/Browser.d.ts +0 -47
- package/lib/screenplay/questions/Browser.js +0 -55
- package/lib/screenplay/questions/Browser.js.map +0 -1
- package/lib/screenplay/questions/CSSClasses.d.ts +0 -94
- package/lib/screenplay/questions/CSSClasses.js +0 -118
- package/lib/screenplay/questions/CSSClasses.js.map +0 -1
- package/lib/screenplay/questions/Cookie.d.ts +0 -9
- package/lib/screenplay/questions/Cookie.js +0 -65
- package/lib/screenplay/questions/Cookie.js.map +0 -1
- package/lib/screenplay/questions/LastScriptExecution.d.ts +0 -14
- package/lib/screenplay/questions/LastScriptExecution.js +0 -22
- package/lib/screenplay/questions/LastScriptExecution.js.map +0 -1
- package/lib/screenplay/questions/ModalDialog.d.ts +0 -120
- package/lib/screenplay/questions/ModalDialog.js +0 -142
- package/lib/screenplay/questions/ModalDialog.js.map +0 -1
- package/lib/screenplay/questions/Pick.d.ts +0 -72
- package/lib/screenplay/questions/Pick.js +0 -254
- package/lib/screenplay/questions/Pick.js.map +0 -1
- package/lib/screenplay/questions/Selected.d.ts +0 -185
- package/lib/screenplay/questions/Selected.js +0 -254
- package/lib/screenplay/questions/Selected.js.map +0 -1
- package/lib/screenplay/questions/Value.d.ts +0 -47
- package/lib/screenplay/questions/Value.js +0 -67
- package/lib/screenplay/questions/Value.js.map +0 -1
- package/lib/screenplay/questions/Website.d.ts +0 -15
- package/lib/screenplay/questions/Website.js +0 -25
- package/lib/screenplay/questions/Website.js.map +0 -1
- package/lib/screenplay/questions/Window.d.ts +0 -23
- package/lib/screenplay/questions/Window.js +0 -28
- package/lib/screenplay/questions/Window.js.map +0 -1
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.d.ts +0 -89
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js +0 -138
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js.map +0 -1
- package/lib/screenplay/questions/lists/index.d.ts +0 -1
- package/lib/screenplay/questions/lists/index.js +0 -14
- package/lib/screenplay/questions/lists/index.js.map +0 -1
- package/lib/screenplay/questions/targets/Target.d.ts +0 -168
- package/lib/screenplay/questions/targets/Target.js +0 -190
- package/lib/screenplay/questions/targets/Target.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetElement.d.ts +0 -50
- package/lib/screenplay/questions/targets/TargetElement.js +0 -62
- package/lib/screenplay/questions/targets/TargetElement.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetElements.d.ts +0 -102
- package/lib/screenplay/questions/targets/TargetElements.js +0 -124
- package/lib/screenplay/questions/targets/TargetElements.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetNestedElement.d.ts +0 -49
- package/lib/screenplay/questions/targets/TargetNestedElement.js +0 -61
- package/lib/screenplay/questions/targets/TargetNestedElement.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetNestedElements.d.ts +0 -101
- package/lib/screenplay/questions/targets/TargetNestedElements.js +0 -123
- package/lib/screenplay/questions/targets/TargetNestedElements.js.map +0 -1
- package/lib/screenplay/questions/targets/builders.d.ts +0 -8
- package/lib/screenplay/questions/targets/builders.js +0 -3
- package/lib/screenplay/questions/targets/builders.js.map +0 -1
- package/lib/screenplay/questions/targets/index.d.ts +0 -5
- package/lib/screenplay/questions/targets/index.js +0 -18
- package/lib/screenplay/questions/targets/index.js.map +0 -1
- package/lib/screenplay/questions/targets/override.d.ts +0 -7
- package/lib/screenplay/questions/targets/override.js +0 -21
- package/lib/screenplay/questions/targets/override.js.map +0 -1
- package/lib/screenplay/questions/text/Text.d.ts +0 -41
- package/lib/screenplay/questions/text/Text.js +0 -50
- package/lib/screenplay/questions/text/Text.js.map +0 -1
- package/lib/screenplay/questions/text/TextOfMultipleElements.d.ts +0 -23
- package/lib/screenplay/questions/text/TextOfMultipleElements.js +0 -37
- package/lib/screenplay/questions/text/TextOfMultipleElements.js.map +0 -1
- package/lib/screenplay/questions/text/TextOfSingleElement.d.ts +0 -23
- package/lib/screenplay/questions/text/TextOfSingleElement.js +0 -35
- package/lib/screenplay/questions/text/TextOfSingleElement.js.map +0 -1
- package/lib/screenplay/questions/text/index.d.ts +0 -1
- package/lib/screenplay/questions/text/index.js +0 -14
- package/lib/screenplay/questions/text/index.js.map +0 -1
- package/lib/screenplay/withAnswerOf.d.ts +0 -8
- package/lib/screenplay/withAnswerOf.js +0 -18
- package/lib/screenplay/withAnswerOf.js.map +0 -1
- package/lib/stage/crew/index.d.ts +0 -1
- package/lib/stage/crew/index.js +0 -14
- package/lib/stage/crew/index.js.map +0 -1
- package/lib/stage/crew/photographer/Photographer.d.ts +0 -83
- package/lib/stage/crew/photographer/Photographer.js +0 -102
- package/lib/stage/crew/photographer/Photographer.js.map +0 -1
- package/lib/stage/crew/photographer/index.d.ts +0 -2
- package/lib/stage/crew/photographer/index.js +0 -15
- package/lib/stage/crew/photographer/index.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +0 -28
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +0 -65
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +0 -18
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +0 -30
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +0 -17
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +0 -19
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/index.d.ts +0 -4
- package/lib/stage/crew/photographer/strategies/index.js +0 -17
- package/lib/stage/crew/photographer/strategies/index.js.map +0 -1
- package/lib/stage/index.d.ts +0 -1
- package/lib/stage/index.js +0 -14
- package/lib/stage/index.js.map +0 -1
- package/src/expectations/ElementFinderExpectation.ts +0 -29
- package/src/expectations/index.ts +0 -6
- package/src/expectations/isActive.ts +0 -24
- package/src/expectations/isClickable.ts +0 -20
- package/src/expectations/isEnabled.ts +0 -18
- package/src/expectations/isPresent.ts +0 -19
- package/src/expectations/isSelected.ts +0 -23
- package/src/expectations/isVisible.ts +0 -27
- package/src/screenplay/interactions/Accept.ts +0 -95
- package/src/screenplay/interactions/Clear.ts +0 -130
- package/src/screenplay/interactions/Click.ts +0 -96
- package/src/screenplay/interactions/Close.ts +0 -184
- package/src/screenplay/interactions/DeleteCookies.ts +0 -154
- package/src/screenplay/interactions/Dismiss.ts +0 -99
- package/src/screenplay/interactions/DoubleClick.ts +0 -124
- package/src/screenplay/interactions/Enter.ts +0 -104
- package/src/screenplay/interactions/EnterBuilder.ts +0 -29
- package/src/screenplay/interactions/ExecuteScript.ts +0 -325
- package/src/screenplay/interactions/Hover.ts +0 -106
- package/src/screenplay/interactions/Navigate.ts +0 -363
- package/src/screenplay/interactions/Press.ts +0 -137
- package/src/screenplay/interactions/PressBuilder.ts +0 -29
- package/src/screenplay/interactions/ResizeBrowserWindow.ts +0 -148
- package/src/screenplay/interactions/RightClick.ts +0 -114
- package/src/screenplay/interactions/Scroll.ts +0 -99
- package/src/screenplay/interactions/Select.ts +0 -402
- package/src/screenplay/interactions/SelectBuilder.ts +0 -35
- package/src/screenplay/interactions/Switch.ts +0 -393
- package/src/screenplay/interactions/TakeScreenshot.ts +0 -89
- package/src/screenplay/interactions/Wait.ts +0 -267
- package/src/screenplay/interactions/WaitBuilder.ts +0 -35
- package/src/screenplay/questions/Attribute.ts +0 -67
- package/src/screenplay/questions/Browser.ts +0 -55
- package/src/screenplay/questions/CSSClasses.ts +0 -121
- package/src/screenplay/questions/Cookie.ts +0 -70
- package/src/screenplay/questions/LastScriptExecution.ts +0 -21
- package/src/screenplay/questions/ModalDialog.ts +0 -149
- package/src/screenplay/questions/Pick.ts +0 -334
- package/src/screenplay/questions/Selected.ts +0 -268
- package/src/screenplay/questions/Value.ts +0 -73
- package/src/screenplay/questions/Website.ts +0 -27
- package/src/screenplay/questions/Window.ts +0 -29
- package/src/screenplay/questions/lists/ElementArrayFinderListAdapter.ts +0 -158
- package/src/screenplay/questions/lists/index.ts +0 -1
- package/src/screenplay/questions/targets/Target.ts +0 -198
- package/src/screenplay/questions/targets/TargetElement.ts +0 -70
- package/src/screenplay/questions/targets/TargetElements.ts +0 -142
- package/src/screenplay/questions/targets/TargetNestedElement.ts +0 -71
- package/src/screenplay/questions/targets/TargetNestedElements.ts +0 -142
- package/src/screenplay/questions/targets/builders.ts +0 -10
- package/src/screenplay/questions/targets/index.ts +0 -5
- package/src/screenplay/questions/targets/override.ts +0 -17
- package/src/screenplay/questions/text/Text.ts +0 -55
- package/src/screenplay/questions/text/TextOfMultipleElements.ts +0 -40
- package/src/screenplay/questions/text/TextOfSingleElement.ts +0 -37
- package/src/screenplay/questions/text/index.ts +0 -1
- package/src/screenplay/withAnswerOf.ts +0 -19
- package/src/stage/crew/index.ts +0 -1
- package/src/stage/crew/photographer/Photographer.ts +0 -108
- package/src/stage/crew/photographer/index.ts +0 -2
- package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +0 -102
- package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +0 -28
- package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +0 -26
- package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +0 -26
- package/src/stage/crew/photographer/strategies/index.ts +0 -4
- package/src/stage/index.ts +0 -1
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { MetaQuestion, Question } from '@serenity-js/core';
|
|
2
|
-
import { ElementArrayFinder, ElementFinder } from 'protractor';
|
|
3
|
-
|
|
4
|
-
import { TextOfMultipleElements } from './TextOfMultipleElements';
|
|
5
|
-
import { TextOfSingleElement } from './TextOfSingleElement';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* Resolves to the visible (i.e. not hidden by CSS) `innerText` of:
|
|
10
|
-
* - a given {@link WebElement}, represented by {@link ElementFinder} or `Question<ElementFinder>`,
|
|
11
|
-
* - a group of {@link WebElement}s, represented by {@link ElementArrayFinder} or `Question<ElementArrayFinder>`.
|
|
12
|
-
*
|
|
13
|
-
* The result includes the visible text of any sub-elements, without any leading or trailing whitespace.
|
|
14
|
-
*
|
|
15
|
-
* @public
|
|
16
|
-
*
|
|
17
|
-
* @extends {@serenity-js/core/lib/screenplay~Question}
|
|
18
|
-
* @implements {@serenity-js/core/lib/screenplay/questions~MetaQuestion}
|
|
19
|
-
*/
|
|
20
|
-
export class Text {
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @desc
|
|
24
|
-
* Retrieves text of a single {@link WebElement},
|
|
25
|
-
* represented by {@link ElementFinder}
|
|
26
|
-
* or `Question<ElementFinder>`.
|
|
27
|
-
*
|
|
28
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
29
|
-
* @returns {Question<Promise<string>> & MetaQuestion<Question<ElementFinder> | ElementFinder, Promise<string>>}
|
|
30
|
-
*
|
|
31
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~MetaQuestion}
|
|
32
|
-
*/
|
|
33
|
-
static of(target: Question<ElementFinder> | ElementFinder):
|
|
34
|
-
Question<Promise<string>> & MetaQuestion<Question<ElementFinder> | ElementFinder, Promise<string>> // eslint-disable-line @typescript-eslint/indent
|
|
35
|
-
{
|
|
36
|
-
return new TextOfSingleElement(target);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @desc
|
|
41
|
-
* Retrieves text of a group of {@link WebElement}s,
|
|
42
|
-
* represented by {@link ElementArrayFinder}
|
|
43
|
-
* or `Question<ElementArrayFinder>`
|
|
44
|
-
*
|
|
45
|
-
* @param {Question<ElementArrayFinder> | ElementArrayFinder} target
|
|
46
|
-
* @returns {Question<Promise<string[]>> & MetaQuestion<Question<ElementFinder> | ElementFinder, Promise<string[]>>}
|
|
47
|
-
*
|
|
48
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~MetaQuestion}
|
|
49
|
-
*/
|
|
50
|
-
static ofAll(target: Question<ElementArrayFinder> | ElementArrayFinder):
|
|
51
|
-
Question<Promise<string[]>> & MetaQuestion<Question<ElementFinder> | ElementFinder, Promise<string[]>> // eslint-disable-line @typescript-eslint/indent
|
|
52
|
-
{
|
|
53
|
-
return new TextOfMultipleElements(target);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { AnswersQuestions, MetaQuestion, Question, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { ElementArrayFinder, ElementFinder } from 'protractor';
|
|
3
|
-
|
|
4
|
-
import { withAnswerOf } from '../../withAnswerOf';
|
|
5
|
-
import { TargetNestedElements } from '../targets';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @package
|
|
9
|
-
*/
|
|
10
|
-
export class TextOfMultipleElements
|
|
11
|
-
extends Question<Promise<string[]>>
|
|
12
|
-
implements MetaQuestion<Question<ElementFinder> | ElementFinder, Promise<string[]>>
|
|
13
|
-
{
|
|
14
|
-
constructor(protected readonly target: Question<ElementArrayFinder> | ElementArrayFinder) {
|
|
15
|
-
super(`the text of ${ target }`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
of(parent: Question<ElementFinder> | ElementFinder): Question<Promise<string[]>> {
|
|
19
|
-
return new TextOfMultipleElements(new TargetNestedElements(parent, this.target));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @desc
|
|
24
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
25
|
-
* answer this {@link @serenity-js/core/lib/screenplay~Question}.
|
|
26
|
-
*
|
|
27
|
-
* @param {AnswersQuestions & UsesAbilities} actor
|
|
28
|
-
* @returns {Promise<void>}
|
|
29
|
-
*
|
|
30
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
31
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
32
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
33
|
-
*/
|
|
34
|
-
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<string[]> {
|
|
35
|
-
|
|
36
|
-
// protractor ignores type definitions for the ElementArrayFinder, hence the `any`
|
|
37
|
-
// https://github.com/angular/protractor/blob/c3978ec166760ac07db01e700c4aaaa19d9b5c38/lib/element.ts#L92
|
|
38
|
-
return withAnswerOf(actor, this.target, eaf => Promise.resolve(eaf.getText() as any) as Promise<string[]>);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { AnswersQuestions, MetaQuestion, Question, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { ElementFinder } from 'protractor';
|
|
3
|
-
|
|
4
|
-
import { withAnswerOf } from '../../withAnswerOf';
|
|
5
|
-
import { TargetNestedElement } from '../targets';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @package
|
|
9
|
-
*/
|
|
10
|
-
export class TextOfSingleElement
|
|
11
|
-
extends Question<Promise<string>>
|
|
12
|
-
implements MetaQuestion<Question<ElementFinder> | ElementFinder, Promise<string>>
|
|
13
|
-
{
|
|
14
|
-
constructor(protected readonly target: Question<ElementFinder> | ElementFinder) {
|
|
15
|
-
super(`the text of ${ target }`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
of(parent: Question<ElementFinder> | ElementFinder): Question<Promise<string>> {
|
|
19
|
-
return new TextOfSingleElement(new TargetNestedElement(parent, this.target));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @desc
|
|
24
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
25
|
-
* answer this {@link @serenity-js/core/lib/screenplay~Question}.
|
|
26
|
-
*
|
|
27
|
-
* @param {AnswersQuestions & UsesAbilities} actor
|
|
28
|
-
* @returns {Promise<void>}
|
|
29
|
-
*
|
|
30
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
31
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
32
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
33
|
-
*/
|
|
34
|
-
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<string> {
|
|
35
|
-
return withAnswerOf(actor, this.target, elf => elf.getText() as any);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Text';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AnswersQuestions, Question, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @private
|
|
5
|
-
* @param actor
|
|
6
|
-
* @param maybeQuestion
|
|
7
|
-
* @param fn
|
|
8
|
-
*/
|
|
9
|
-
export function withAnswerOf<T, O>(
|
|
10
|
-
actor: AnswersQuestions & UsesAbilities,
|
|
11
|
-
maybeQuestion: Question<T> | T,
|
|
12
|
-
fn: (item: T) => O,
|
|
13
|
-
): O {
|
|
14
|
-
const answer = Question.isAQuestion(maybeQuestion)
|
|
15
|
-
? maybeQuestion.answeredBy(actor)
|
|
16
|
-
: maybeQuestion;
|
|
17
|
-
|
|
18
|
-
return fn(answer);
|
|
19
|
-
}
|
package/src/stage/crew/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './photographer';
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { LogicError } from '@serenity-js/core';
|
|
2
|
-
import { ActivityFinished, ActivityStarts, DomainEvent } from '@serenity-js/core/lib/events';
|
|
3
|
-
import { Stage, StageCrewMember } from '@serenity-js/core/lib/stage';
|
|
4
|
-
|
|
5
|
-
import { PhotoTakingStrategy } from './strategies';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* The Photographer is a {@link @serenity-js/core/lib/stage~StageCrewMember} who takes screenshots
|
|
10
|
-
* of the web browser the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight is using.
|
|
11
|
-
*
|
|
12
|
-
* @example <caption>Assigning the Photographer to the Stage</caption>
|
|
13
|
-
*
|
|
14
|
-
* const { ArtifactArchiver } = require('@serenity-js/core');
|
|
15
|
-
* const { Photographer, TakePhotosOfFailures } = require('@serenity-js/protractor');
|
|
16
|
-
*
|
|
17
|
-
* exports.config = {
|
|
18
|
-
*
|
|
19
|
-
* serenity: {
|
|
20
|
-
* crew: [
|
|
21
|
-
* ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
|
|
22
|
-
* Photographer.whoWill(TakePhotosOfFailures),
|
|
23
|
-
* ]
|
|
24
|
-
* },
|
|
25
|
-
*
|
|
26
|
-
* // ... rest of the config omitted for brevity
|
|
27
|
-
* };
|
|
28
|
-
*
|
|
29
|
-
* @example <caption>Taking photos upon failures only</caption>
|
|
30
|
-
*
|
|
31
|
-
* const { Photographer, TakePhotosOfFailures } = require('@serenity-js/protractor');
|
|
32
|
-
*
|
|
33
|
-
* Photographer.whoWill(TakePhotosOfFailures)
|
|
34
|
-
*
|
|
35
|
-
* @example <caption>Taking photos of all the interactions</caption>
|
|
36
|
-
*
|
|
37
|
-
* const { Photographer, TakePhotosOfInteractions } = require('@serenity-js/protractor');
|
|
38
|
-
*
|
|
39
|
-
* Photographer.whoWill(TakePhotosOfInteractions)
|
|
40
|
-
*
|
|
41
|
-
* @example <caption>Taking photos before and after all the interactions</caption>
|
|
42
|
-
*
|
|
43
|
-
* const { Photographer, TakePhotosBeforeAndAfterInteractions } = require('@serenity-js/protractor');
|
|
44
|
-
*
|
|
45
|
-
* Photographer.whoWill(TakePhotosBeforeAndAfterInteractions)
|
|
46
|
-
*
|
|
47
|
-
* @see {@link @serenity-js/core/lib/stage~Stage}
|
|
48
|
-
* @see {@link TakePhotosBeforeAndAfterInteractions}
|
|
49
|
-
* @see {@link TakePhotosOfFailures}
|
|
50
|
-
* @see {@link TakePhotosOfInteractions}
|
|
51
|
-
*/
|
|
52
|
-
export class Photographer implements StageCrewMember {
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @desc
|
|
56
|
-
* Instantiates a new {@link Photographer} configured to take photos (screenshots)
|
|
57
|
-
* as per the specified {@link PhotoTakingStrategy}.
|
|
58
|
-
*
|
|
59
|
-
* @param {Function} strategy - A no-arg constructor function that instantiates a {@link PhotoTakingStrategy}.
|
|
60
|
-
* @returns {StageCrewMember}
|
|
61
|
-
*/
|
|
62
|
-
static whoWill(strategy: new () => PhotoTakingStrategy): StageCrewMember {
|
|
63
|
-
return new Photographer(new strategy());
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @param {PhotoTakingStrategy} photoTakingStrategy
|
|
68
|
-
* @param {Stage} stage
|
|
69
|
-
*/
|
|
70
|
-
constructor(
|
|
71
|
-
private readonly photoTakingStrategy: PhotoTakingStrategy,
|
|
72
|
-
private stage?: Stage,
|
|
73
|
-
) {
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* @desc
|
|
78
|
-
* Creates a new instance of this {@link StageCrewMember} and assigns it to a given {@link Stage}.
|
|
79
|
-
*
|
|
80
|
-
* @param {Stage} stage - An instance of a {@link Stage} this {@link StageCrewMember} will be assigned to
|
|
81
|
-
* @returns {StageCrewMember} - A new instance of this {@link StageCrewMember}
|
|
82
|
-
*/
|
|
83
|
-
assignedTo(stage: Stage): StageCrewMember {
|
|
84
|
-
return new Photographer(this.photoTakingStrategy, stage);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @desc
|
|
89
|
-
* Handles {@link DomainEvent} objects emitted by the {@link Stage}
|
|
90
|
-
* this {@link StageCrewMember} is assigned to.
|
|
91
|
-
*
|
|
92
|
-
* @param {DomainEvent} event
|
|
93
|
-
* @returns {void}
|
|
94
|
-
*/
|
|
95
|
-
notifyOf(event: DomainEvent): void {
|
|
96
|
-
if (! this.stage) {
|
|
97
|
-
throw new LogicError(`Photographer needs to be assigned to the Stage before it can be notified of any DomainEvents`);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (! this.stage.theShowHasStarted()) {
|
|
101
|
-
return void 0;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (event instanceof ActivityStarts || event instanceof ActivityFinished) {
|
|
105
|
-
this.photoTakingStrategy.considerTakingPhoto(event, this.stage);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { Stage } from '@serenity-js/core';
|
|
2
|
-
import {
|
|
3
|
-
ActivityFinished,
|
|
4
|
-
ActivityRelatedArtifactGenerated,
|
|
5
|
-
ActivityStarts,
|
|
6
|
-
AsyncOperationAttempted,
|
|
7
|
-
AsyncOperationCompleted,
|
|
8
|
-
AsyncOperationFailed,
|
|
9
|
-
DomainEvent,
|
|
10
|
-
} from '@serenity-js/core/lib/events';
|
|
11
|
-
import { CorrelationId, Description, Name, Photo } from '@serenity-js/core/lib/model';
|
|
12
|
-
import { error as webdriver } from 'selenium-webdriver';
|
|
13
|
-
|
|
14
|
-
import { BrowseTheWeb } from '../../../../screenplay';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @desc
|
|
18
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots)
|
|
19
|
-
* of the {@link @serenity-js/core/lib/screenplay~Activity} performed
|
|
20
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight
|
|
21
|
-
* under specific conditions.
|
|
22
|
-
*
|
|
23
|
-
* @abstract
|
|
24
|
-
*/
|
|
25
|
-
export abstract class PhotoTakingStrategy {
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @desc
|
|
29
|
-
* Takes a photo of the web browser held by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
30
|
-
*
|
|
31
|
-
* @param {@serenity-js/core/lib/events~ActivityStarts | @serenity-js/core/lib/events~ActivityFinished} event
|
|
32
|
-
* @param {@serenity-js/core/lib/stage~Stage} stage - the Stage that holds reference to the Actor in the spotlight
|
|
33
|
-
* @returns void
|
|
34
|
-
*
|
|
35
|
-
* @see {@link @serenity-js/core/lib/stage~Stage#theActorInTheSpotlight}
|
|
36
|
-
*/
|
|
37
|
-
considerTakingPhoto(event: ActivityStarts | ActivityFinished, stage: Stage): void {
|
|
38
|
-
if (this.shouldTakeAPhotoOf(event)) {
|
|
39
|
-
let browseTheWeb: BrowseTheWeb;
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
browseTheWeb = BrowseTheWeb.as(stage.theActorInTheSpotlight());
|
|
43
|
-
} catch {
|
|
44
|
-
return void 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
id = CorrelationId.create(),
|
|
49
|
-
nameSuffix = this.photoNameFor(event);
|
|
50
|
-
|
|
51
|
-
stage.announce(new AsyncOperationAttempted(
|
|
52
|
-
new Description(`[Photographer:${ this.constructor.name }] Taking screenshot of '${ nameSuffix }'...`),
|
|
53
|
-
id,
|
|
54
|
-
));
|
|
55
|
-
|
|
56
|
-
Promise.all([
|
|
57
|
-
browseTheWeb.takeScreenshot(),
|
|
58
|
-
browseTheWeb.getCapabilities(),
|
|
59
|
-
]).then(([ screenshot, capabilities ]) => {
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
context = [ capabilities.get('platform'), capabilities.get('browserName'), capabilities.get('version') ],
|
|
63
|
-
photoName = this.combinedNameFrom(...context, nameSuffix);
|
|
64
|
-
|
|
65
|
-
stage.announce(new ActivityRelatedArtifactGenerated(
|
|
66
|
-
event.sceneId,
|
|
67
|
-
event.activityId,
|
|
68
|
-
photoName,
|
|
69
|
-
Photo.fromBase64(screenshot),
|
|
70
|
-
));
|
|
71
|
-
|
|
72
|
-
stage.announce(new AsyncOperationCompleted(
|
|
73
|
-
new Description(`[${ this.constructor.name }] Took screenshot of '${ nameSuffix }' on ${ context }`),
|
|
74
|
-
id,
|
|
75
|
-
));
|
|
76
|
-
}).catch(error => {
|
|
77
|
-
if (this.shouldIgnore(error)) {
|
|
78
|
-
stage.announce(new AsyncOperationCompleted(
|
|
79
|
-
new Description(`[${ this.constructor.name }] Aborted taking screenshot of '${ nameSuffix }' because of ${ error.constructor && error.constructor.name }`),
|
|
80
|
-
id,
|
|
81
|
-
));
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
stage.announce(new AsyncOperationFailed(error, id));
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
protected abstract shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
91
|
-
|
|
92
|
-
protected abstract photoNameFor(event: DomainEvent): string;
|
|
93
|
-
|
|
94
|
-
private combinedNameFrom(...parts: string[]): Name {
|
|
95
|
-
return new Name(parts.filter(v => !! v).join('-'));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
private shouldIgnore(error: Error) {
|
|
99
|
-
return error instanceof webdriver.NoSuchSessionError
|
|
100
|
-
|| error instanceof webdriver.UnexpectedAlertOpenError
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DomainEvent, InteractionFinished, InteractionStarts } from '@serenity-js/core/lib/events';
|
|
2
|
-
|
|
3
|
-
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @desc
|
|
7
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) both before and after
|
|
8
|
-
* every single {@link @serenity-js/core/lib/screenplay~Interaction} performed
|
|
9
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
10
|
-
*
|
|
11
|
-
* *Please note* that this strategy will result in _a lot_ of screenshots being taken,
|
|
12
|
-
* which will seriously affect the performance of your tests.
|
|
13
|
-
* For this reason, it's best to use it only for debugging purposes.
|
|
14
|
-
*
|
|
15
|
-
* @extends {PhotoTakingStrategy}
|
|
16
|
-
*/
|
|
17
|
-
export class TakePhotosBeforeAndAfterInteractions extends PhotoTakingStrategy {
|
|
18
|
-
protected shouldTakeAPhotoOf(event: DomainEvent): boolean {
|
|
19
|
-
return event instanceof InteractionStarts
|
|
20
|
-
|| event instanceof InteractionFinished;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
protected photoNameFor(event: InteractionStarts | InteractionFinished): string {
|
|
24
|
-
return event instanceof InteractionStarts
|
|
25
|
-
? `Before ${ event.details.name.value }`
|
|
26
|
-
: `After ${ event.details.name.value }`;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { DomainEvent, InteractionFinished } from '@serenity-js/core/lib/events';
|
|
2
|
-
import { ImplementationPending } from '@serenity-js/core/lib/model';
|
|
3
|
-
|
|
4
|
-
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) when
|
|
9
|
-
* the {@link @serenity-js/core/lib/screenplay~Interaction} performed
|
|
10
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight results in an error.
|
|
11
|
-
*
|
|
12
|
-
* This strategy works best when you are interested in the screenshots only when
|
|
13
|
-
* the a fails.
|
|
14
|
-
*
|
|
15
|
-
* @extends {PhotoTakingStrategy}
|
|
16
|
-
*/
|
|
17
|
-
export class TakePhotosOfFailures extends PhotoTakingStrategy {
|
|
18
|
-
protected shouldTakeAPhotoOf(event: DomainEvent): boolean {
|
|
19
|
-
return event instanceof InteractionFinished
|
|
20
|
-
&& event.outcome.isWorseThan(ImplementationPending);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
protected photoNameFor(event: InteractionFinished): string {
|
|
24
|
-
return event.details.name.value;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { DomainEvent, InteractionFinished } from '@serenity-js/core/lib/events';
|
|
2
|
-
|
|
3
|
-
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @desc
|
|
7
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) when
|
|
8
|
-
* the the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight
|
|
9
|
-
* performs any {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
10
|
-
*
|
|
11
|
-
* This strategy works best when you want the results of your automated tests
|
|
12
|
-
* to become comprehensive living documentation of your system.
|
|
13
|
-
*
|
|
14
|
-
* *Please note* that taking screenshots affects the performance of your tests.
|
|
15
|
-
*
|
|
16
|
-
* @extends {PhotoTakingStrategy}
|
|
17
|
-
*/
|
|
18
|
-
export class TakePhotosOfInteractions extends PhotoTakingStrategy {
|
|
19
|
-
protected shouldTakeAPhotoOf(event: DomainEvent): boolean {
|
|
20
|
-
return event instanceof InteractionFinished;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
protected photoNameFor(event: InteractionFinished): string {
|
|
24
|
-
return event.details.name.value;
|
|
25
|
-
}
|
|
26
|
-
}
|
package/src/stage/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './crew';
|