@serenity-js/web 3.0.0-rc.9 → 3.0.1
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 +337 -74
- package/README.md +8 -12
- package/lib/errors/BrowserWindowClosedError.d.ts +15 -0
- package/lib/errors/BrowserWindowClosedError.d.ts.map +1 -0
- package/lib/errors/BrowserWindowClosedError.js +21 -0
- package/lib/errors/BrowserWindowClosedError.js.map +1 -0
- package/lib/errors/CookieMissingError.d.ts +11 -0
- package/lib/errors/CookieMissingError.d.ts.map +1 -0
- package/lib/errors/CookieMissingError.js +10 -0
- package/lib/errors/CookieMissingError.js.map +1 -1
- package/lib/errors/ModalDialogObstructsScreenshotError.d.ts +15 -0
- package/lib/errors/ModalDialogObstructsScreenshotError.d.ts.map +1 -0
- package/lib/errors/ModalDialogObstructsScreenshotError.js +21 -0
- package/lib/errors/ModalDialogObstructsScreenshotError.js.map +1 -0
- package/lib/errors/index.d.ts +3 -0
- package/lib/errors/index.d.ts.map +1 -0
- package/lib/errors/index.js +7 -1
- package/lib/errors/index.js.map +1 -1
- package/lib/expectations/index.d.ts +1 -1
- package/lib/expectations/index.d.ts.map +1 -0
- package/lib/expectations/index.js +5 -2
- package/lib/expectations/index.js.map +1 -1
- package/lib/expectations/isActive.d.ts +14 -8
- package/lib/expectations/isActive.d.ts.map +1 -0
- package/lib/expectations/isActive.js +17 -11
- package/lib/expectations/isActive.js.map +1 -1
- package/lib/expectations/isClickable.d.ts +14 -13
- package/lib/expectations/isClickable.d.ts.map +1 -0
- package/lib/expectations/isClickable.js +15 -17
- package/lib/expectations/isClickable.js.map +1 -1
- package/lib/expectations/isEnabled.d.ts +14 -7
- package/lib/expectations/isEnabled.d.ts.map +1 -0
- package/lib/expectations/isEnabled.js +17 -9
- package/lib/expectations/isEnabled.js.map +1 -1
- package/lib/expectations/isSelected.d.ts +14 -7
- package/lib/expectations/isSelected.d.ts.map +1 -0
- package/lib/expectations/isSelected.js +15 -9
- package/lib/expectations/isSelected.js.map +1 -1
- package/lib/expectations/isVisible.d.ts +14 -7
- package/lib/expectations/isVisible.d.ts.map +1 -0
- package/lib/expectations/isVisible.js +17 -9
- package/lib/expectations/isVisible.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib/screenplay/abilities/BrowseTheWeb.d.ts +88 -45
- package/lib/screenplay/abilities/BrowseTheWeb.d.ts.map +1 -0
- package/lib/screenplay/abilities/BrowseTheWeb.js +89 -19
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +1 -1
- package/lib/screenplay/abilities/index.d.ts +1 -1
- package/lib/screenplay/abilities/index.d.ts.map +1 -0
- package/lib/screenplay/abilities/index.js +5 -2
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/index.d.ts +1 -0
- package/lib/screenplay/index.d.ts.map +1 -0
- package/lib/screenplay/index.js +5 -1
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/interactions/Clear.d.ts +50 -55
- package/lib/screenplay/interactions/Clear.d.ts.map +1 -0
- package/lib/screenplay/interactions/Clear.js +70 -63
- package/lib/screenplay/interactions/Clear.js.map +1 -1
- package/lib/screenplay/interactions/Click.d.ts +41 -50
- package/lib/screenplay/interactions/Click.d.ts.map +1 -0
- package/lib/screenplay/interactions/Click.js +45 -55
- package/lib/screenplay/interactions/Click.js.map +1 -1
- package/lib/screenplay/interactions/DoubleClick.d.ts +64 -67
- package/lib/screenplay/interactions/DoubleClick.d.ts.map +1 -0
- package/lib/screenplay/interactions/DoubleClick.js +68 -72
- package/lib/screenplay/interactions/DoubleClick.js.map +1 -1
- package/lib/screenplay/interactions/Enter.d.ts +42 -51
- package/lib/screenplay/interactions/Enter.d.ts.map +1 -0
- package/lib/screenplay/interactions/Enter.js +42 -52
- package/lib/screenplay/interactions/Enter.js.map +1 -1
- package/lib/screenplay/interactions/ExecuteScript.d.ts +144 -148
- package/lib/screenplay/interactions/ExecuteScript.d.ts.map +1 -0
- package/lib/screenplay/interactions/ExecuteScript.js +163 -185
- package/lib/screenplay/interactions/ExecuteScript.js.map +1 -1
- package/lib/screenplay/interactions/Hover.d.ts +40 -50
- package/lib/screenplay/interactions/Hover.d.ts.map +1 -0
- package/lib/screenplay/interactions/Hover.js +44 -55
- package/lib/screenplay/interactions/Hover.js.map +1 -1
- package/lib/screenplay/interactions/Navigate.d.ts +106 -113
- package/lib/screenplay/interactions/Navigate.d.ts.map +1 -0
- package/lib/screenplay/interactions/Navigate.js +124 -146
- package/lib/screenplay/interactions/Navigate.js.map +1 -1
- package/lib/screenplay/interactions/PageElementInteraction.d.ts +12 -28
- package/lib/screenplay/interactions/PageElementInteraction.d.ts.map +1 -0
- package/lib/screenplay/interactions/PageElementInteraction.js +12 -33
- package/lib/screenplay/interactions/PageElementInteraction.js.map +1 -1
- package/lib/screenplay/interactions/Press.d.ts +61 -55
- package/lib/screenplay/interactions/Press.d.ts.map +1 -0
- package/lib/screenplay/interactions/Press.js +83 -72
- package/lib/screenplay/interactions/Press.js.map +1 -1
- package/lib/screenplay/interactions/RightClick.d.ts +59 -65
- package/lib/screenplay/interactions/RightClick.d.ts.map +1 -0
- package/lib/screenplay/interactions/RightClick.js +63 -70
- package/lib/screenplay/interactions/RightClick.js.map +1 -1
- package/lib/screenplay/interactions/Scroll.d.ts +46 -64
- package/lib/screenplay/interactions/Scroll.d.ts.map +1 -0
- package/lib/screenplay/interactions/Scroll.js +49 -71
- package/lib/screenplay/interactions/Scroll.js.map +1 -1
- package/lib/screenplay/interactions/Select.d.ts +217 -193
- package/lib/screenplay/interactions/Select.d.ts.map +1 -0
- package/lib/screenplay/interactions/Select.js +218 -245
- package/lib/screenplay/interactions/Select.js.map +1 -1
- package/lib/screenplay/interactions/Switch.d.ts +105 -128
- package/lib/screenplay/interactions/Switch.d.ts.map +1 -0
- package/lib/screenplay/interactions/Switch.js +121 -172
- package/lib/screenplay/interactions/Switch.js.map +1 -1
- package/lib/screenplay/interactions/TakeScreenshot.d.ts +28 -50
- package/lib/screenplay/interactions/TakeScreenshot.d.ts.map +1 -0
- package/lib/screenplay/interactions/TakeScreenshot.js +32 -57
- package/lib/screenplay/interactions/TakeScreenshot.js.map +1 -1
- package/lib/screenplay/interactions/index.d.ts +2 -3
- package/lib/screenplay/interactions/index.d.ts.map +1 -0
- package/lib/screenplay/interactions/index.js +6 -4
- package/lib/screenplay/interactions/index.js.map +1 -1
- package/lib/screenplay/models/BrowserCapabilities.d.ts +24 -0
- package/lib/screenplay/models/BrowserCapabilities.d.ts.map +1 -0
- package/lib/screenplay/models/BrowserCapabilities.js.map +1 -0
- package/lib/screenplay/models/BrowsingSession.d.ts +69 -0
- package/lib/screenplay/models/BrowsingSession.d.ts.map +1 -0
- package/lib/screenplay/models/BrowsingSession.js +101 -0
- package/lib/screenplay/models/BrowsingSession.js.map +1 -0
- package/lib/screenplay/models/Cookie.d.ts +104 -64
- package/lib/screenplay/models/Cookie.d.ts.map +1 -0
- package/lib/screenplay/models/Cookie.js +110 -59
- package/lib/screenplay/models/Cookie.js.map +1 -1
- package/lib/screenplay/models/CookieData.d.ts +20 -58
- package/lib/screenplay/models/CookieData.d.ts.map +1 -0
- package/lib/{input → screenplay/models}/Key.d.ts +13 -9
- package/lib/screenplay/models/Key.d.ts.map +1 -0
- package/lib/{input → screenplay/models}/Key.js +16 -13
- package/lib/screenplay/models/Key.js.map +1 -0
- package/lib/screenplay/models/Locator.d.ts +29 -8
- package/lib/screenplay/models/Locator.d.ts.map +1 -0
- package/lib/screenplay/models/Locator.js +53 -7
- package/lib/screenplay/models/Locator.js.map +1 -1
- package/lib/screenplay/models/Page.d.ts +398 -36
- package/lib/screenplay/models/Page.d.ts.map +1 -0
- package/lib/screenplay/models/Page.js +209 -4
- package/lib/screenplay/models/Page.js.map +1 -1
- package/lib/screenplay/models/PageElement.d.ts +77 -5
- package/lib/screenplay/models/PageElement.d.ts.map +1 -0
- package/lib/screenplay/models/PageElement.js +29 -7
- package/lib/screenplay/models/PageElement.js.map +1 -1
- package/lib/screenplay/models/PageElements.d.ts +16 -3
- package/lib/screenplay/models/PageElements.d.ts.map +1 -0
- package/lib/screenplay/models/PageElements.js +21 -8
- package/lib/screenplay/models/PageElements.js.map +1 -1
- package/lib/screenplay/models/RootLocator.d.ts +25 -0
- package/lib/screenplay/models/RootLocator.d.ts.map +1 -0
- package/lib/screenplay/models/RootLocator.js +52 -0
- package/lib/screenplay/models/RootLocator.js.map +1 -0
- package/lib/screenplay/models/SelectOption.d.ts +25 -0
- package/lib/screenplay/models/SelectOption.d.ts.map +1 -0
- package/lib/screenplay/models/SelectOption.js +37 -0
- package/lib/screenplay/models/SelectOption.js.map +1 -0
- package/lib/screenplay/models/Switchable.d.ts +23 -0
- package/lib/screenplay/models/Switchable.d.ts.map +1 -0
- package/lib/screenplay/{interactions/WaitBuilder.js → models/Switchable.js} +1 -1
- package/lib/screenplay/models/Switchable.js.map +1 -0
- package/lib/screenplay/models/SwitchableOrigin.d.ts +18 -0
- package/lib/screenplay/models/SwitchableOrigin.d.ts.map +1 -0
- package/lib/screenplay/{interactions/EnterBuilder.js → models/SwitchableOrigin.js} +1 -1
- package/lib/screenplay/models/SwitchableOrigin.js.map +1 -0
- package/lib/screenplay/models/dialogs/AbsentModalDialog.d.ts +15 -0
- package/lib/screenplay/models/dialogs/AbsentModalDialog.d.ts.map +1 -0
- package/lib/screenplay/models/dialogs/AbsentModalDialog.js +24 -0
- package/lib/screenplay/models/dialogs/AbsentModalDialog.js.map +1 -0
- package/lib/screenplay/models/dialogs/AcceptedModalDialog.d.ts +17 -0
- package/lib/screenplay/models/dialogs/AcceptedModalDialog.d.ts.map +1 -0
- package/lib/screenplay/models/dialogs/AcceptedModalDialog.js +29 -0
- package/lib/screenplay/models/dialogs/AcceptedModalDialog.js.map +1 -0
- package/lib/screenplay/models/dialogs/DismissedModalDialog.d.ts +17 -0
- package/lib/screenplay/models/dialogs/DismissedModalDialog.d.ts.map +1 -0
- package/lib/screenplay/models/dialogs/DismissedModalDialog.js +29 -0
- package/lib/screenplay/models/dialogs/DismissedModalDialog.js.map +1 -0
- package/lib/screenplay/models/dialogs/ModalDialog.d.ts +168 -0
- package/lib/screenplay/models/dialogs/ModalDialog.d.ts.map +1 -0
- package/lib/screenplay/models/dialogs/ModalDialog.js +174 -0
- package/lib/screenplay/models/dialogs/ModalDialog.js.map +1 -0
- package/lib/screenplay/models/dialogs/ModalDialogHandler.d.ts +38 -0
- package/lib/screenplay/models/dialogs/ModalDialogHandler.d.ts.map +1 -0
- package/lib/screenplay/models/dialogs/ModalDialogHandler.js +30 -0
- package/lib/screenplay/models/dialogs/ModalDialogHandler.js.map +1 -0
- package/lib/screenplay/models/dialogs/index.d.ts +6 -0
- package/lib/screenplay/models/dialogs/index.d.ts.map +1 -0
- package/lib/screenplay/models/dialogs/index.js +22 -0
- package/lib/screenplay/models/dialogs/index.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +9 -1
- package/lib/screenplay/models/index.d.ts.map +1 -0
- package/lib/screenplay/models/index.js +13 -2
- package/lib/screenplay/models/index.js.map +1 -1
- package/lib/screenplay/models/selectors/By.d.ts +38 -0
- package/lib/screenplay/models/selectors/By.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/By.js +43 -0
- package/lib/screenplay/models/selectors/By.js.map +1 -1
- package/lib/screenplay/models/selectors/ByCss.d.ts +8 -0
- package/lib/screenplay/models/selectors/ByCss.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/ByCss.js +7 -0
- package/lib/screenplay/models/selectors/ByCss.js.map +1 -1
- package/lib/screenplay/models/selectors/ByCssContainingText.d.ts +9 -0
- package/lib/screenplay/models/selectors/ByCssContainingText.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/ByCssContainingText.js +8 -0
- package/lib/screenplay/models/selectors/ByCssContainingText.js.map +1 -1
- package/lib/screenplay/models/selectors/ByDeepCss.d.ts +14 -0
- package/lib/screenplay/models/selectors/ByDeepCss.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/ByDeepCss.js +20 -0
- package/lib/screenplay/models/selectors/ByDeepCss.js.map +1 -0
- package/lib/screenplay/models/selectors/ById.d.ts +8 -0
- package/lib/screenplay/models/selectors/ById.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/ById.js +7 -0
- package/lib/screenplay/models/selectors/ById.js.map +1 -1
- package/lib/screenplay/models/selectors/ByTagName.d.ts +8 -0
- package/lib/screenplay/models/selectors/ByTagName.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/ByTagName.js +7 -0
- package/lib/screenplay/models/selectors/ByTagName.js.map +1 -1
- package/lib/screenplay/models/selectors/ByXPath.d.ts +8 -0
- package/lib/screenplay/models/selectors/ByXPath.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/ByXPath.js +7 -0
- package/lib/screenplay/models/selectors/ByXPath.js.map +1 -1
- package/lib/screenplay/models/selectors/Selector.d.ts +6 -0
- package/lib/screenplay/models/selectors/Selector.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/Selector.js +6 -1
- package/lib/screenplay/models/selectors/Selector.js.map +1 -1
- package/lib/screenplay/models/selectors/index.d.ts +2 -0
- package/lib/screenplay/models/selectors/index.d.ts.map +1 -0
- package/lib/screenplay/models/selectors/index.js +6 -1
- package/lib/screenplay/models/selectors/index.js.map +1 -1
- package/lib/screenplay/questions/Attribute.d.ts +115 -67
- package/lib/screenplay/questions/Attribute.d.ts.map +1 -0
- package/lib/screenplay/questions/Attribute.js +128 -74
- package/lib/screenplay/questions/Attribute.js.map +1 -1
- package/lib/screenplay/questions/CssClasses.d.ts +124 -79
- package/lib/screenplay/questions/CssClasses.d.ts.map +1 -0
- package/lib/screenplay/questions/CssClasses.js +132 -83
- package/lib/screenplay/questions/CssClasses.js.map +1 -1
- package/lib/screenplay/questions/LastScriptExecution.d.ts +42 -6
- package/lib/screenplay/questions/LastScriptExecution.d.ts.map +1 -0
- package/lib/screenplay/questions/LastScriptExecution.js +45 -7
- package/lib/screenplay/questions/LastScriptExecution.js.map +1 -1
- package/lib/screenplay/questions/Selected.d.ts +202 -171
- package/lib/screenplay/questions/Selected.d.ts.map +1 -0
- package/lib/screenplay/questions/Selected.js +225 -186
- package/lib/screenplay/questions/Selected.js.map +1 -1
- package/lib/screenplay/questions/Text.d.ts +101 -82
- package/lib/screenplay/questions/Text.d.ts.map +1 -0
- package/lib/screenplay/questions/Text.js +143 -92
- package/lib/screenplay/questions/Text.js.map +1 -1
- package/lib/screenplay/questions/Value.d.ts +77 -44
- package/lib/screenplay/questions/Value.d.ts.map +1 -0
- package/lib/screenplay/questions/Value.js +84 -47
- package/lib/screenplay/questions/Value.js.map +1 -1
- package/lib/screenplay/questions/index.d.ts +1 -0
- package/lib/screenplay/questions/index.d.ts.map +1 -0
- package/lib/screenplay/questions/index.js +5 -1
- package/lib/screenplay/questions/index.js.map +1 -1
- package/lib/scripts/index.d.ts +2 -0
- package/lib/scripts/index.d.ts.map +1 -0
- package/lib/{input → scripts}/index.js +6 -2
- package/lib/scripts/index.js.map +1 -0
- package/lib/scripts/isVisible.d.ts +2 -0
- package/lib/scripts/isVisible.d.ts.map +1 -0
- package/lib/scripts/isVisible.js +96 -0
- package/lib/scripts/isVisible.js.map +1 -0
- package/lib/stage/crew/index.d.ts +1 -0
- package/lib/stage/crew/index.d.ts.map +1 -0
- package/lib/stage/crew/index.js +5 -1
- package/lib/stage/crew/index.js.map +1 -1
- package/lib/stage/crew/photographer/Photographer.d.ts +126 -39
- package/lib/stage/crew/photographer/Photographer.d.ts.map +1 -0
- package/lib/stage/crew/photographer/Photographer.js +161 -42
- package/lib/stage/crew/photographer/Photographer.js.map +1 -1
- package/lib/stage/crew/photographer/index.d.ts +1 -0
- package/lib/stage/crew/photographer/index.d.ts.map +1 -0
- package/lib/stage/crew/photographer/index.js +5 -1
- package/lib/stage/crew/photographer/index.js.map +1 -1
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +13 -12
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts.map +1 -0
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +22 -33
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +1 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +8 -8
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts.map +1 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +7 -8
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +1 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +8 -7
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts.map +1 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +7 -7
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +8 -8
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts.map +1 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +7 -8
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +1 -1
- package/lib/stage/crew/photographer/strategies/index.d.ts +1 -0
- package/lib/stage/crew/photographer/strategies/index.d.ts.map +1 -0
- package/lib/stage/crew/photographer/strategies/index.js +5 -1
- package/lib/stage/crew/photographer/strategies/index.js.map +1 -1
- package/lib/stage/index.d.ts +1 -0
- package/lib/stage/index.d.ts.map +1 -0
- package/lib/stage/index.js +5 -1
- package/lib/stage/index.js.map +1 -1
- package/package.json +20 -43
- package/src/errors/BrowserWindowClosedError.ts +17 -0
- package/src/errors/CookieMissingError.ts +10 -0
- package/src/errors/ModalDialogObstructsScreenshotError.ts +17 -0
- package/src/errors/index.ts +2 -0
- package/src/expectations/index.ts +0 -1
- package/src/expectations/isActive.ts +23 -12
- package/src/expectations/isClickable.ts +22 -21
- package/src/expectations/isEnabled.ts +23 -9
- package/src/expectations/isSelected.ts +20 -10
- package/src/expectations/isVisible.ts +23 -9
- package/src/index.ts +0 -1
- package/src/screenplay/abilities/BrowseTheWeb.ts +95 -87
- package/src/screenplay/abilities/index.ts +0 -1
- package/src/screenplay/interactions/Clear.ts +75 -63
- package/src/screenplay/interactions/Click.ts +43 -54
- package/src/screenplay/interactions/DoubleClick.ts +66 -71
- package/src/screenplay/interactions/Enter.ts +41 -53
- package/src/screenplay/interactions/ExecuteScript.ts +207 -220
- package/src/screenplay/interactions/Hover.ts +42 -54
- package/src/screenplay/interactions/Navigate.ts +129 -156
- package/src/screenplay/interactions/PageElementInteraction.ts +14 -34
- package/src/screenplay/interactions/Press.ts +78 -69
- package/src/screenplay/interactions/RightClick.ts +61 -69
- package/src/screenplay/interactions/Scroll.ts +48 -71
- package/src/screenplay/interactions/Select.ts +229 -269
- package/src/screenplay/interactions/Switch.ts +123 -179
- package/src/screenplay/interactions/TakeScreenshot.ts +31 -57
- package/src/screenplay/interactions/index.ts +1 -3
- package/src/screenplay/models/BrowserCapabilities.ts +26 -0
- package/src/screenplay/models/BrowsingSession.ts +115 -0
- package/src/screenplay/models/Cookie.ts +115 -73
- package/src/screenplay/models/CookieData.ts +20 -58
- package/src/{input → screenplay/models}/Key.ts +12 -9
- package/src/screenplay/models/Locator.ts +43 -9
- package/src/screenplay/models/Page.ts +438 -37
- package/src/screenplay/models/PageElement.ts +92 -12
- package/src/screenplay/models/PageElements.ts +23 -9
- package/src/screenplay/models/RootLocator.ts +30 -0
- package/src/screenplay/models/SelectOption.ts +38 -0
- package/src/screenplay/models/Switchable.ts +24 -0
- package/src/screenplay/models/SwitchableOrigin.ts +18 -0
- package/src/screenplay/models/dialogs/AbsentModalDialog.ts +22 -0
- package/src/screenplay/models/dialogs/AcceptedModalDialog.ts +27 -0
- package/src/screenplay/models/dialogs/DismissedModalDialog.ts +27 -0
- package/src/screenplay/models/dialogs/ModalDialog.ts +200 -0
- package/src/screenplay/models/dialogs/ModalDialogHandler.ts +50 -0
- package/src/screenplay/models/dialogs/index.ts +5 -0
- package/src/screenplay/models/index.ts +8 -1
- package/src/screenplay/models/selectors/By.ts +45 -0
- package/src/screenplay/models/selectors/ByCss.ts +7 -0
- package/src/screenplay/models/selectors/ByCssContainingText.ts +8 -0
- package/src/screenplay/models/selectors/ByDeepCss.ts +15 -0
- package/src/screenplay/models/selectors/ById.ts +7 -0
- package/src/screenplay/models/selectors/ByTagName.ts +7 -0
- package/src/screenplay/models/selectors/ByXPath.ts +7 -0
- package/src/screenplay/models/selectors/Selector.ts +6 -1
- package/src/screenplay/models/selectors/index.ts +1 -0
- package/src/screenplay/questions/Attribute.ts +137 -76
- package/src/screenplay/questions/CssClasses.ts +135 -83
- package/src/screenplay/questions/LastScriptExecution.ts +45 -8
- package/src/screenplay/questions/Selected.ts +237 -191
- package/src/screenplay/questions/Text.ts +161 -96
- package/src/screenplay/questions/Value.ts +88 -48
- package/src/scripts/index.ts +1 -0
- package/src/scripts/isVisible.ts +113 -0
- package/src/stage/crew/photographer/Photographer.ts +142 -41
- package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +27 -42
- package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +7 -8
- package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +7 -7
- package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +7 -8
- package/tsconfig.build.json +14 -0
- package/lib/expectations/ElementExpectation.d.ts +0 -83
- package/lib/expectations/ElementExpectation.js +0 -102
- package/lib/expectations/ElementExpectation.js.map +0 -1
- package/lib/input/Key.js.map +0 -1
- package/lib/input/index.d.ts +0 -1
- package/lib/input/index.js.map +0 -1
- package/lib/screenplay/abilities/BrowserCapabilities.d.ts +0 -5
- package/lib/screenplay/abilities/BrowserCapabilities.js.map +0 -1
- package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -25
- package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
- package/lib/screenplay/interactions/PressBuilder.d.ts +0 -26
- package/lib/screenplay/interactions/PressBuilder.js +0 -3
- package/lib/screenplay/interactions/PressBuilder.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/Wait.d.ts +0 -143
- package/lib/screenplay/interactions/Wait.js +0 -238
- package/lib/screenplay/interactions/Wait.js.map +0 -1
- package/lib/screenplay/interactions/WaitBuilder.d.ts +0 -32
- package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
- package/lib/screenplay/models/ModalDialog.d.ts +0 -9
- package/lib/screenplay/models/ModalDialog.js +0 -14
- package/lib/screenplay/models/ModalDialog.js.map +0 -1
- package/lib/screenplay/questions/ElementQuestion.d.ts +0 -33
- package/lib/screenplay/questions/ElementQuestion.js +0 -53
- package/lib/screenplay/questions/ElementQuestion.js.map +0 -1
- package/src/expectations/ElementExpectation.ts +0 -108
- package/src/input/index.ts +0 -1
- package/src/screenplay/abilities/BrowserCapabilities.ts +0 -5
- package/src/screenplay/interactions/EnterBuilder.ts +0 -28
- package/src/screenplay/interactions/PressBuilder.ts +0 -29
- package/src/screenplay/interactions/SelectBuilder.ts +0 -36
- package/src/screenplay/interactions/Wait.ts +0 -260
- package/src/screenplay/interactions/WaitBuilder.ts +0 -34
- package/src/screenplay/models/ModalDialog.ts +0 -19
- package/src/screenplay/questions/ElementQuestion.ts +0 -58
- package/tsconfig.eslint.json +0 -10
- /package/lib/screenplay/{abilities → models}/BrowserCapabilities.js +0 -0
|
@@ -1,90 +1,209 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.Photographer = void 0;
|
|
4
27
|
const core_1 = require("@serenity-js/core");
|
|
5
28
|
const events_1 = require("@serenity-js/core/lib/events");
|
|
29
|
+
const strategies = __importStar(require("./strategies"));
|
|
6
30
|
/**
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
*
|
|
31
|
+
* The Photographer is a {@apilink StageCrewMember} who takes screenshots
|
|
32
|
+
* using the web browser associated with the {@apilink Actor} that is currently {@apilink actorInTheSpotlight|in the spotlight}.
|
|
33
|
+
*
|
|
34
|
+
* ## Programmatically assigning the `Photographer` to the {@apilink Stage}
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { configure, ArtifactArchiver } from '@serenity-js/core'
|
|
38
|
+
* import { Photographer, TakePhotosOfFailures } from '@serenity-js/web'
|
|
39
|
+
*
|
|
40
|
+
* configure({
|
|
41
|
+
* crew: [
|
|
42
|
+
* ArtifactArchiver.storingArtifactsAt(process.cwd(), 'target/site/serenity'),
|
|
43
|
+
* Photographer.whoWill(TakePhotosOfFailures),
|
|
44
|
+
* ]
|
|
45
|
+
* })
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* ## Using `Photographer` with WebdriverIO
|
|
10
49
|
*
|
|
11
|
-
*
|
|
50
|
+
* ```ts
|
|
12
51
|
* // wdio.conf.ts
|
|
13
|
-
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
14
|
-
* import { Photographer, TakePhotosOfFailures } from '@serenity-js/
|
|
52
|
+
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
53
|
+
* import { Photographer, TakePhotosOfFailures } from '@serenity-js/web'
|
|
54
|
+
* import { WebdriverIOConfig } from '@serenity-js/webdriverio'
|
|
55
|
+
*
|
|
56
|
+
* export const config: WebdriverIOConfig= {
|
|
57
|
+
*
|
|
58
|
+
* // Tell WebdriverIO to use Serenity/JS framework
|
|
59
|
+
* framework: '@serenity-js/webdriverio',
|
|
60
|
+
*
|
|
61
|
+
* serenity: {
|
|
62
|
+
* // Configure Serenity/JS to use an appropriate test runner adapter
|
|
63
|
+
* runner: 'cucumber',
|
|
64
|
+
* // runner: 'mocha',
|
|
65
|
+
* // runner: 'jasmine',
|
|
66
|
+
*
|
|
67
|
+
* // register custom Actors class to configure your Serenity/JS actors
|
|
68
|
+
* actors: new Actors(),
|
|
69
|
+
*
|
|
70
|
+
* // Register StageCrewMembers we've imported at the top of this file
|
|
71
|
+
* crew: [
|
|
72
|
+
* ArtifactArchiver.storingArtifactsAt(process.cwd(), 'target/site/serenity'),
|
|
73
|
+
* Photographer.whoWill(TakePhotosOfFailures),
|
|
74
|
+
* ]
|
|
75
|
+
* },
|
|
15
76
|
*
|
|
16
|
-
*
|
|
77
|
+
* // ... rest of the config omitted for brevity
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
17
80
|
*
|
|
18
|
-
*
|
|
81
|
+
* ## Using `Photographer` with Playwright Test
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* // playwright.config.ts
|
|
85
|
+
* import type { PlaywrightTestConfig } from '@serenity-js/playwright-test'
|
|
86
|
+
*
|
|
87
|
+
* const config: PlaywrightTestConfig = {
|
|
88
|
+
* use: {
|
|
19
89
|
* crew: [
|
|
20
|
-
*
|
|
90
|
+
* [ '@serenity-js/web:Photographer', { strategy: 'TakePhotosOfFailures' } ] // or 'TakePhotosOfInteractions'
|
|
91
|
+
* ],
|
|
92
|
+
* },
|
|
93
|
+
* };
|
|
94
|
+
* export default config;
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* #### Learn more
|
|
98
|
+
* - {@apilink SerenityOptions}
|
|
99
|
+
*
|
|
100
|
+
* ## Using `Photographer` with Protractor
|
|
101
|
+
*
|
|
102
|
+
* ```ts
|
|
103
|
+
* // protractor.conf.js
|
|
104
|
+
* const { ArtifactArchiver } = require('@serenity-js/core')
|
|
105
|
+
* const { Photographer, TakePhotosOfFailures } = require('@serenity-js/web')
|
|
106
|
+
*
|
|
107
|
+
* exports.config = {
|
|
108
|
+
*
|
|
109
|
+
* // Tell Protractor to use the Serenity/JS framework Protractor Adapter
|
|
110
|
+
* framework: 'custom',
|
|
111
|
+
* frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
|
|
112
|
+
*
|
|
113
|
+
* serenity: {
|
|
114
|
+
* runner: 'jasmine',
|
|
115
|
+
* // runner: 'cucumber',
|
|
116
|
+
* // runner: 'mocha',
|
|
117
|
+
* crew: [
|
|
118
|
+
* ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
|
|
21
119
|
* Photographer.whoWill(TakePhotosOfFailures),
|
|
22
120
|
* ]
|
|
23
121
|
* },
|
|
24
122
|
*
|
|
25
123
|
* // ... rest of the config omitted for brevity
|
|
26
|
-
* }
|
|
124
|
+
* }
|
|
125
|
+
* ```
|
|
27
126
|
*
|
|
28
|
-
*
|
|
127
|
+
* ## Taking photos only upon failures only
|
|
29
128
|
*
|
|
30
|
-
*
|
|
129
|
+
* ```ts
|
|
130
|
+
* import { Photographer, TakePhotosOfFailures } from '@serenity-js/web'
|
|
31
131
|
*
|
|
32
132
|
* Photographer.whoWill(TakePhotosOfFailures)
|
|
133
|
+
* ```
|
|
33
134
|
*
|
|
34
|
-
*
|
|
135
|
+
* ## Taking photos of all the interactions
|
|
35
136
|
*
|
|
36
|
-
*
|
|
137
|
+
* ```ts
|
|
138
|
+
* import { Photographer, TakePhotosOfInteractions } from '@serenity-js/web'
|
|
37
139
|
*
|
|
38
140
|
* Photographer.whoWill(TakePhotosOfInteractions)
|
|
141
|
+
* ```
|
|
39
142
|
*
|
|
40
|
-
*
|
|
143
|
+
* ## Taking photos before and after all the interactions
|
|
41
144
|
*
|
|
42
|
-
*
|
|
145
|
+
* ```ts
|
|
146
|
+
* import { Photographer, TakePhotosBeforeAndAfterInteractions } from '@serenity-js/web'
|
|
43
147
|
*
|
|
44
148
|
* Photographer.whoWill(TakePhotosBeforeAndAfterInteractions)
|
|
149
|
+
* ```
|
|
45
150
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
151
|
+
* ## Learn more
|
|
152
|
+
* - {@apilink Stage}
|
|
153
|
+
* - {@apilink StageCrewMember}
|
|
154
|
+
* - {@apilink TakePhotosBeforeAndAfterInteractions}
|
|
155
|
+
* - {@apilink TakePhotosOfFailures}
|
|
156
|
+
* - {@apilink TakePhotosOfInteractions}
|
|
157
|
+
*
|
|
158
|
+
* @group Stage
|
|
50
159
|
*/
|
|
51
160
|
class Photographer {
|
|
52
161
|
/**
|
|
53
|
-
* @
|
|
54
|
-
* @
|
|
162
|
+
* Instantiates a new {@apilink Photographer} configured to take photos (screenshots)
|
|
163
|
+
* as per the specified {@apilink PhotoTakingStrategy}.
|
|
164
|
+
*
|
|
165
|
+
* @param strategy
|
|
166
|
+
* A no-arg constructor function that instantiates a {@apilink PhotoTakingStrategy}
|
|
55
167
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.stage = stage;
|
|
168
|
+
static whoWill(strategy) {
|
|
169
|
+
return new Photographer(new strategy());
|
|
59
170
|
}
|
|
60
171
|
/**
|
|
61
|
-
* @
|
|
62
|
-
*
|
|
63
|
-
* as per the specified {@link PhotoTakingStrategy}.
|
|
172
|
+
* Instantiates a new {@apilink Photographer} configured to take photos (screenshots)
|
|
173
|
+
* as per the specified {@apilink PhotoTakingStrategy}.
|
|
64
174
|
*
|
|
65
|
-
* @param
|
|
66
|
-
* @returns {StageCrewMember}
|
|
175
|
+
* @param config
|
|
67
176
|
*/
|
|
68
|
-
static
|
|
69
|
-
|
|
177
|
+
static fromJSON(config) {
|
|
178
|
+
if (config && config.strategy) {
|
|
179
|
+
const availableStrategies = Object.keys(strategies).filter(strategy => strategy !== strategies.PhotoTakingStrategy.name); // not the abstract class
|
|
180
|
+
if (availableStrategies.includes(config.strategy)) {
|
|
181
|
+
return new Photographer(new strategies[config.strategy]());
|
|
182
|
+
}
|
|
183
|
+
throw new core_1.ConfigurationError(`'${config.strategy}' is not an available PhotoTakingStrategy. ` +
|
|
184
|
+
`Available strategies: ${availableStrategies.join(', ')}.`);
|
|
185
|
+
}
|
|
186
|
+
return new Photographer(new strategies.TakePhotosOfFailures());
|
|
187
|
+
}
|
|
188
|
+
constructor(photoTakingStrategy, stage) {
|
|
189
|
+
this.photoTakingStrategy = photoTakingStrategy;
|
|
190
|
+
this.stage = stage;
|
|
70
191
|
}
|
|
71
192
|
/**
|
|
72
|
-
* @
|
|
73
|
-
* Creates a new instance of this {@link StageCrewMember} and assigns it to a given {@link Stage}.
|
|
193
|
+
* Assigns this {@apilink StageCrewMember} to a given {@apilink Stage}.
|
|
74
194
|
*
|
|
75
|
-
* @param
|
|
76
|
-
*
|
|
195
|
+
* @param stage
|
|
196
|
+
* An instance of a {@apilink Stage} this {@apilink StageCrewMember} will be assigned to
|
|
77
197
|
*/
|
|
78
198
|
assignedTo(stage) {
|
|
79
|
-
|
|
199
|
+
this.stage = stage;
|
|
200
|
+
return this;
|
|
80
201
|
}
|
|
81
202
|
/**
|
|
82
|
-
* @
|
|
83
|
-
*
|
|
84
|
-
* this {@link StageCrewMember} is assigned to.
|
|
203
|
+
* Handles {@apilink DomainEvent} objects emitted by the {@apilink Stage}
|
|
204
|
+
* this {@apilink StageCrewMember} is assigned to.
|
|
85
205
|
*
|
|
86
|
-
* @param
|
|
87
|
-
* @returns {void}
|
|
206
|
+
* @param event
|
|
88
207
|
*/
|
|
89
208
|
notifyOf(event) {
|
|
90
209
|
if (!this.stage) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Photographer.js","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/Photographer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Photographer.js","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/Photographer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAmE;AACnE,yDAA6F;AAG7F,yDAA2C;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiIG;AACH,MAAa,YAAY;IAErB;;;;;;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stage/crew/photographer/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,+CAA6B"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { Stage } from '@serenity-js/core';
|
|
2
2
|
import { ActivityFinished, ActivityStarts, DomainEvent } from '@serenity-js/core/lib/events';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight
|
|
8
|
-
* under specific conditions.
|
|
4
|
+
* Configures the {@apilink Photographer} to take {@apilink Photo|photos}, a.k.a. screenshots,
|
|
5
|
+
* of the {@apilink Activity} performed by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}
|
|
6
|
+
* when desired conditions are met.
|
|
9
7
|
*
|
|
10
|
-
* @
|
|
8
|
+
* @group Stage
|
|
11
9
|
*/
|
|
12
10
|
export declare abstract class PhotoTakingStrategy {
|
|
13
11
|
/**
|
|
14
|
-
* @
|
|
15
|
-
* Takes a photo of the web browser held by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
12
|
+
* Takes a photo of the web browser used by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}.
|
|
16
13
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
14
|
+
* #### Learn more
|
|
15
|
+
* - {@apilink ActivityStarts}
|
|
16
|
+
* - {@apilink ActivityFinished}
|
|
17
|
+
* - {@apilink Stage}
|
|
20
18
|
*
|
|
21
|
-
* @
|
|
19
|
+
* @param event
|
|
20
|
+
* @param stage
|
|
21
|
+
* The Stage that holds reference to the Actor in the spotlight
|
|
22
22
|
*/
|
|
23
23
|
considerTakingPhoto(event: ActivityStarts | ActivityFinished, stage: Stage): Promise<void>;
|
|
24
24
|
protected abstract shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
@@ -26,3 +26,4 @@ export declare abstract class PhotoTakingStrategy {
|
|
|
26
26
|
private combinedNameFrom;
|
|
27
27
|
private shouldIgnore;
|
|
28
28
|
}
|
|
29
|
+
//# sourceMappingURL=PhotoTakingStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhotoTakingStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAoC,cAAc,EAAiG,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAK9N;;;;;;GAMG;AACH,8BAAsB,mBAAmB;IAErC;;;;;;;;;;;OAWG;IACG,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IA6DhG,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAElE,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IAE3D,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,YAAY;CAIvB"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PhotoTakingStrategy = void 0;
|
|
4
|
+
const core_1 = require("@serenity-js/core");
|
|
4
5
|
const events_1 = require("@serenity-js/core/lib/events");
|
|
5
6
|
const model_1 = require("@serenity-js/core/lib/model");
|
|
6
7
|
const screenplay_1 = require("../../../../screenplay");
|
|
7
8
|
/**
|
|
8
|
-
* @
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight
|
|
12
|
-
* under specific conditions.
|
|
9
|
+
* Configures the {@apilink Photographer} to take {@apilink Photo|photos}, a.k.a. screenshots,
|
|
10
|
+
* of the {@apilink Activity} performed by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}
|
|
11
|
+
* when desired conditions are met.
|
|
13
12
|
*
|
|
14
|
-
* @
|
|
13
|
+
* @group Stage
|
|
15
14
|
*/
|
|
16
15
|
class PhotoTakingStrategy {
|
|
17
16
|
/**
|
|
18
|
-
* @
|
|
19
|
-
* Takes a photo of the web browser held by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
17
|
+
* Takes a photo of the web browser used by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}.
|
|
20
18
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
19
|
+
* #### Learn more
|
|
20
|
+
* - {@apilink ActivityStarts}
|
|
21
|
+
* - {@apilink ActivityFinished}
|
|
22
|
+
* - {@apilink Stage}
|
|
24
23
|
*
|
|
25
|
-
* @
|
|
24
|
+
* @param event
|
|
25
|
+
* @param stage
|
|
26
|
+
* The Stage that holds reference to the Actor in the spotlight
|
|
26
27
|
*/
|
|
27
28
|
async considerTakingPhoto(event, stage) {
|
|
28
29
|
if (!this.shouldTakeAPhotoOf(event)) {
|
|
@@ -37,30 +38,21 @@ class PhotoTakingStrategy {
|
|
|
37
38
|
return void 0;
|
|
38
39
|
}
|
|
39
40
|
const id = model_1.CorrelationId.create(), nameSuffix = this.photoNameFor(event);
|
|
40
|
-
stage.announce(new events_1.AsyncOperationAttempted(new model_1.
|
|
41
|
-
let dialogIsPresent;
|
|
42
|
-
try {
|
|
43
|
-
dialogIsPresent = await browseTheWeb.modalDialog().then(dialog => dialog.isPresent());
|
|
44
|
-
if (dialogIsPresent) {
|
|
45
|
-
return stage.announce(new events_1.AsyncOperationCompleted(new model_1.Description(`[${this.constructor.name}] Aborted taking screenshot of '${nameSuffix}' because of a modal dialog obstructing the view`), id));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
return stage.announce(new events_1.AsyncOperationFailed(error, id));
|
|
50
|
-
}
|
|
41
|
+
stage.announce(new events_1.AsyncOperationAttempted(new model_1.Name(`Photographer:${this.constructor.name}`), new model_1.Description(`Taking screenshot of '${nameSuffix}'...`), id, stage.currentTime()));
|
|
51
42
|
try {
|
|
52
43
|
const capabilities = await browseTheWeb.browserCapabilities();
|
|
53
|
-
const
|
|
44
|
+
const page = await browseTheWeb.currentPage();
|
|
45
|
+
const screenshot = await page.takeScreenshot();
|
|
54
46
|
const context = [capabilities.platformName, capabilities.browserName, capabilities.browserVersion], photoName = this.combinedNameFrom(...context, nameSuffix);
|
|
55
|
-
stage.announce(new events_1.ActivityRelatedArtifactGenerated(event.sceneId, event.activityId, photoName, model_1.Photo.fromBase64(screenshot)));
|
|
56
|
-
return stage.announce(new events_1.AsyncOperationCompleted(
|
|
47
|
+
stage.announce(new events_1.ActivityRelatedArtifactGenerated(event.sceneId, event.activityId, photoName, model_1.Photo.fromBase64(screenshot), stage.currentTime()));
|
|
48
|
+
return stage.announce(new events_1.AsyncOperationCompleted(id, stage.currentTime()));
|
|
57
49
|
}
|
|
58
50
|
catch (error) {
|
|
59
51
|
if (this.shouldIgnore(error)) {
|
|
60
|
-
stage.announce(new events_1.
|
|
52
|
+
stage.announce(new events_1.AsyncOperationAborted(new model_1.Description(`Aborted taking screenshot of '${nameSuffix}' because of ${error.constructor && error.constructor.name}`), id, stage.currentTime()));
|
|
61
53
|
}
|
|
62
54
|
else {
|
|
63
|
-
stage.announce(new events_1.AsyncOperationFailed(error, id));
|
|
55
|
+
stage.announce(new events_1.AsyncOperationFailed(error, id, stage.currentTime()));
|
|
64
56
|
}
|
|
65
57
|
}
|
|
66
58
|
}
|
|
@@ -68,11 +60,8 @@ class PhotoTakingStrategy {
|
|
|
68
60
|
return new model_1.Name(parts.filter(v => !!v).join('-'));
|
|
69
61
|
}
|
|
70
62
|
shouldIgnore(error) {
|
|
71
|
-
return error
|
|
72
|
-
(error.name
|
|
73
|
-
// todo: add SauceLabs
|
|
74
|
-
// [0-0] 2021-12-02T01:32:36.402Z ERROR webdriver: Request failed with status 404 due to no such window: no such window: target window already closed
|
|
75
|
-
// [0-0] from unknown error: web view not found
|
|
63
|
+
return error instanceof core_1.LogicError
|
|
64
|
+
|| (error.name && error.name === core_1.LogicError.name);
|
|
76
65
|
}
|
|
77
66
|
}
|
|
78
67
|
exports.PhotoTakingStrategy = PhotoTakingStrategy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhotoTakingStrategy.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"PhotoTakingStrategy.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts"],"names":[],"mappings":";;;AAAA,4CAAsD;AACtD,yDAA8N;AAC9N,uDAAsF;AAEtF,uDAAsD;AAEtD;;;;;;GAMG;AACH,MAAsB,mBAAmB;IAErC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,mBAAmB,CAAC,KAAwC,EAAE,KAAY;QAC5E,IAAI,CAAE,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;YAClC,OAAO,KAAK,CAAC,CAAC;SACjB;QAED,IAAI,YAA0B,CAAC;QAE/B,IAAI;YACA,YAAY,GAAG,yBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC,CAAC;SAClE;QAAC,MAAM;YACJ,sCAAsC;YACtC,OAAO,KAAK,CAAC,CAAC;SACjB;QAED,MACI,EAAE,GAAgB,qBAAa,CAAC,MAAM,EAAE,EACxC,UAAU,GAAQ,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAE/C,KAAK,CAAC,QAAQ,CAAC,IAAI,gCAAuB,CACtC,IAAI,YAAI,CAAC,gBAAiB,IAAI,CAAC,WAAW,CAAC,IAAK,EAAE,CAAC,EACnD,IAAI,mBAAW,CAAC,yBAA0B,UAAW,MAAM,CAAC,EAC5D,EAAE,EACF,KAAK,CAAC,WAAW,EAAE,CACtB,CAAC,CAAC;QAEH,IAAI;YACA,MAAM,YAAY,GAAI,MAAM,YAAY,CAAC,mBAAmB,EAAE,CAAC;YAC/D,MAAM,IAAI,GAAY,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC;YACvD,MAAM,UAAU,GAAM,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;YAElD,MACI,OAAO,GAAK,CAAE,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,cAAc,CAAE,EAChG,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,CAAC;YAE9D,KAAK,CAAC,QAAQ,CAAC,IAAI,yCAAgC,CAC/C,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,UAAU,EAChB,SAAS,EACT,aAAK,CAAC,UAAU,CAAC,UAAU,CAAC,EAC5B,KAAK,CAAC,WAAW,EAAE,CACtB,CAAC,CAAC;YAEH,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,gCAAuB,CAC7C,EAAE,EACF,KAAK,CAAC,WAAW,EAAE,CACtB,CAAC,CAAC;SACN;QACD,OAAO,KAAK,EAAE;YACV,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;gBAC1B,KAAK,CAAC,QAAQ,CAAC,IAAI,8BAAqB,CACpC,IAAI,mBAAW,CAAC,iCAAkC,UAAW,gBAAiB,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,IAAK,EAAE,CAAC,EAC7H,EAAE,EACF,KAAK,CAAC,WAAW,EAAE,CACtB,CAAC,CAAC;aACN;iBACI;gBACD,KAAK,CAAC,QAAQ,CAAC,IAAI,6BAAoB,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;aAC5E;SACJ;IACL,CAAC;IAMO,gBAAgB,CAAC,GAAG,KAAe;QACvC,OAAO,IAAI,YAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,CAAC;IAEO,YAAY,CAAC,KAAY;QAC7B,OAAO,KAAK,YAAY,iBAAU;eAC3B,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAU,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;CACJ;AAvFD,kDAuFC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { DomainEvent, InteractionFinished, InteractionStarts } from '@serenity-js/core/lib/events';
|
|
2
2
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
4
|
+
* Configures the {@apilink Photographer} to take photos (a.k.a. screenshots) **both before and after**
|
|
5
|
+
* every single {@apilink Interaction} performed
|
|
6
|
+
* by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* **Please note** that this strategy will result in _a lot_ of screenshots being taken,
|
|
9
|
+
* which will seriously affect the performance of your tests.
|
|
10
|
+
* For this reason, it's best to use it only for debugging purposes.
|
|
12
11
|
*
|
|
13
|
-
* @
|
|
12
|
+
* @group Stage
|
|
14
13
|
*/
|
|
15
14
|
export declare class TakePhotosBeforeAndAfterInteractions extends PhotoTakingStrategy {
|
|
16
15
|
protected shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
17
16
|
protected photoNameFor(event: InteractionStarts | InteractionFinished): string;
|
|
18
17
|
}
|
|
18
|
+
//# sourceMappingURL=TakePhotosBeforeAndAfterInteractions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TakePhotosBeforeAndAfterInteractions.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,qBAAa,oCAAqC,SAAQ,mBAAmB;IACzE,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAKzD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,MAAM;CAKjF"}
|
|
@@ -4,16 +4,15 @@ 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
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
7
|
+
* Configures the {@apilink Photographer} to take photos (a.k.a. screenshots) **both before and after**
|
|
8
|
+
* every single {@apilink Interaction} performed
|
|
9
|
+
* by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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.
|
|
15
14
|
*
|
|
16
|
-
* @
|
|
15
|
+
* @group Stage
|
|
17
16
|
*/
|
|
18
17
|
class TakePhotosBeforeAndAfterInteractions extends PhotoTakingStrategy_1.PhotoTakingStrategy {
|
|
19
18
|
shouldTakeAPhotoOf(event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TakePhotosBeforeAndAfterInteractions.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts"],"names":[],"mappings":";;;AAAA,yDAAmG;AAEnG,+DAA4D;AAE5D
|
|
1
|
+
{"version":3,"file":"TakePhotosBeforeAndAfterInteractions.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts"],"names":[],"mappings":";;;AAAA,yDAAmG;AAEnG,+DAA4D;AAE5D;;;;;;;;;;GAUG;AACH,MAAa,oCAAqC,SAAQ,yCAAmB;IAC/D,kBAAkB,CAAC,KAAkB;QAC3C,OAAO,KAAK,YAAY,0BAAiB;eAClC,KAAK,YAAY,4BAAmB,CAAC;IAChD,CAAC;IAES,YAAY,CAAC,KAA8C;QACjE,OAAO,KAAK,YAAY,0BAAiB;YACrC,CAAC,CAAC,UAAW,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAM,EAAE;YACxC,CAAC,CAAC,SAAU,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAM,EAAE,CAAC;IAChD,CAAC;CACJ;AAXD,oFAWC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { DomainEvent, InteractionFinished } from '@serenity-js/core/lib/events';
|
|
2
2
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Configures the {@apilink Photographer} to take photos (a.k.a. screenshots)
|
|
5
|
+
* when then {@apilink Interaction} performed
|
|
6
|
+
* by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}
|
|
7
|
+
* results in an error.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* This strategy works best when you are interested in the screenshots only when
|
|
10
|
+
* a scenario fails.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @group Stage
|
|
13
13
|
*/
|
|
14
14
|
export declare class TakePhotosOfFailures extends PhotoTakingStrategy {
|
|
15
15
|
protected shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
16
16
|
protected photoNameFor(event: InteractionFinished): string;
|
|
17
17
|
}
|
|
18
|
+
//# sourceMappingURL=TakePhotosOfFailures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TakePhotosOfFailures.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB;IACzD,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAKzD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM;CAG7D"}
|
|
@@ -5,15 +5,15 @@ 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
|
-
* @
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Configures the {@apilink Photographer} to take photos (a.k.a. screenshots)
|
|
9
|
+
* when then {@apilink Interaction} performed
|
|
10
|
+
* by the {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}
|
|
11
|
+
* results in an error.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* This strategy works best when you are interested in the screenshots only when
|
|
14
|
+
* a scenario fails.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
16
|
+
* @group Stage
|
|
17
17
|
*/
|
|
18
18
|
class TakePhotosOfFailures extends PhotoTakingStrategy_1.PhotoTakingStrategy {
|
|
19
19
|
shouldTakeAPhotoOf(event) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { DomainEvent, InteractionFinished } from '@serenity-js/core/lib/events';
|
|
2
2
|
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* performs any {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
4
|
+
* Configures the {@apilink Photographer} to take photos (a.k.a. screenshots)
|
|
5
|
+
* when then {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}
|
|
6
|
+
* performs any {@apilink Interaction}.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* This strategy works best when you want the results of your automated tests
|
|
9
|
+
* to become comprehensive living documentation of your system.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
11
|
+
* *Please note* that taking screenshots affects the performance of your tests.
|
|
13
12
|
*
|
|
14
|
-
* @
|
|
13
|
+
* @group Stage
|
|
15
14
|
*/
|
|
16
15
|
export declare class TakePhotosOfInteractions extends PhotoTakingStrategy {
|
|
17
16
|
protected shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
18
17
|
protected photoNameFor(event: InteractionFinished): string;
|
|
19
18
|
}
|
|
19
|
+
//# sourceMappingURL=TakePhotosOfInteractions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TakePhotosOfInteractions.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;;GAWG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC7D,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAIzD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,MAAM;CAG7D"}
|
|
@@ -4,17 +4,16 @@ 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
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* performs any {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
7
|
+
* Configures the {@apilink Photographer} to take photos (a.k.a. screenshots)
|
|
8
|
+
* when then {@apilink Actor} in the {@apilink actorInTheSpotlight|spotlight}
|
|
9
|
+
* performs any {@apilink Interaction}.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* This strategy works best when you want the results of your automated tests
|
|
12
|
+
* to become comprehensive living documentation of your system.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
14
|
+
* *Please note* that taking screenshots affects the performance of your tests.
|
|
16
15
|
*
|
|
17
|
-
* @
|
|
16
|
+
* @group Stage
|
|
18
17
|
*/
|
|
19
18
|
class TakePhotosOfInteractions extends PhotoTakingStrategy_1.PhotoTakingStrategy {
|
|
20
19
|
shouldTakeAPhotoOf(event) {
|