@serenity-js/web 3.0.0-rc.9 → 3.0.0
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 +329 -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,117 +1,157 @@
|
|
|
1
|
-
import { Answerable, Interaction, Optional, QuestionAdapter, Timestamp } from '@serenity-js/core';
|
|
1
|
+
import { Answerable, Interaction, Optional, QuestionAdapter, Timestamp, WithAnswerableProperties } from '@serenity-js/core';
|
|
2
2
|
import { CookieData } from './CookieData';
|
|
3
|
+
/**
|
|
4
|
+
* A Screenplay Pattern-style model responsible for managing cookies available to the current {@apilink Page}.
|
|
5
|
+
*
|
|
6
|
+
* ## Checking if a cookie exists
|
|
7
|
+
*
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
10
|
+
* import { Navigate, Cookie } from '@serenity-js/web'
|
|
11
|
+
* import { Ensure, isPresent } from '@serenity-js/assertions'
|
|
12
|
+
*
|
|
13
|
+
* await actorCalled('Sid')
|
|
14
|
+
* .attemptsTo(
|
|
15
|
+
* Navigate.to('https://example.org'),
|
|
16
|
+
*
|
|
17
|
+
* Ensure.that(
|
|
18
|
+
* Cookie.called('example-cookie-name'),
|
|
19
|
+
* isPresent()
|
|
20
|
+
* ),
|
|
21
|
+
* )
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ## Setting a cookie
|
|
25
|
+
*
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
28
|
+
* import { Navigate, Cookie } from '@serenity-js/web'
|
|
29
|
+
* import { Ensure, isPresent, not } from '@serenity-js/assertions'
|
|
30
|
+
*
|
|
31
|
+
* await actorCalled('Sid')
|
|
32
|
+
* .attemptsTo(
|
|
33
|
+
* Navigate.to('https://example.org'),
|
|
34
|
+
*
|
|
35
|
+
* Ensure.that(Cookie.called('example-cookie-name'), not(isPresent())),
|
|
36
|
+
*
|
|
37
|
+
* Cookie.set({
|
|
38
|
+
* name: 'favourite',
|
|
39
|
+
* value: 'triple chocolate',
|
|
40
|
+
* }),
|
|
41
|
+
*
|
|
42
|
+
* Ensure.that(Cookie.called('example-cookie-name'), isPresent()),
|
|
43
|
+
* )
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* ## Reading a cookie
|
|
47
|
+
*
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
50
|
+
* import { Navigate, Cookie } from '@serenity-js/web'
|
|
51
|
+
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
52
|
+
*
|
|
53
|
+
* await actorCalled('Sid')
|
|
54
|
+
* .attemptsTo(
|
|
55
|
+
* Navigate.to('https://example.org'),
|
|
56
|
+
*
|
|
57
|
+
* Ensure.that(
|
|
58
|
+
* Cookie.called('some-cookie-name').value(),
|
|
59
|
+
* equals('triple chocolate')
|
|
60
|
+
* ),
|
|
61
|
+
* )
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* ## Learn more
|
|
65
|
+
* - {@apilink CookieData}
|
|
66
|
+
* - {@apilink Page.cookie}
|
|
67
|
+
*
|
|
68
|
+
* @group Models
|
|
69
|
+
*/
|
|
3
70
|
export declare abstract class Cookie implements Optional {
|
|
4
71
|
protected readonly cookieName: string;
|
|
5
72
|
/**
|
|
6
|
-
* @
|
|
7
|
-
* Creates a {@link @serenity-js/core/lib/screenplay~Question} about a Cookie
|
|
73
|
+
* Creates a {@apilink QuestionAdapter} that resolves to {@apilink Cookie} identified by `name`.
|
|
8
74
|
*
|
|
9
|
-
* @param
|
|
10
|
-
* @returns {Question<Promise<Cookie>> & Adapter<Cookie>}
|
|
75
|
+
* @param name
|
|
11
76
|
*/
|
|
12
77
|
static called(name: Answerable<string>): QuestionAdapter<Cookie>;
|
|
13
78
|
/**
|
|
14
|
-
* @
|
|
15
|
-
* Sets a cookie for the current page.
|
|
16
|
-
* Make sure that the actor performing this interaction is on the page that should receive the cookie.
|
|
17
|
-
* An actor can't set a cookie for an arbitrary page without being on that page.
|
|
79
|
+
* Sets a cookie for the current {@apilink Page}. Note that {@apilink CookieData} can be either a plain-old JavaScript object, or an {@apilink Answerable} {@apilink WithAnswerableProperties}.
|
|
18
80
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
81
|
+
* :::info
|
|
82
|
+
* Make sure that the actor performing this interaction is on the page that should receive the cookie.
|
|
83
|
+
* Because of browser security restrictions, an actor can't set a cookie for an arbitrary page without being on that page.
|
|
84
|
+
* :::
|
|
85
|
+
*
|
|
86
|
+
* @param cookieData
|
|
21
87
|
*/
|
|
22
|
-
static set(cookieData: Answerable<CookieData
|
|
88
|
+
static set(cookieData: Answerable<WithAnswerableProperties<CookieData>>): Interaction;
|
|
23
89
|
/**
|
|
24
|
-
* @
|
|
25
|
-
* Creates an {@link @serenity-js/core/lib/screenplay~Interaction} to delete all cookies currently set in the browser.
|
|
26
|
-
*
|
|
27
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
90
|
+
* Creates an {@apilink Interaction|interaction} to delete all cookies available to the current {@apilink Page}..
|
|
28
91
|
*/
|
|
29
92
|
static deleteAll(): Interaction;
|
|
30
93
|
private cookie;
|
|
31
94
|
protected constructor(cookieName: string);
|
|
95
|
+
/**
|
|
96
|
+
* Returns the name of this cookie.
|
|
97
|
+
*/
|
|
32
98
|
name(): string;
|
|
33
99
|
/**
|
|
34
|
-
*
|
|
35
|
-
* Checks if a given cookie is set.
|
|
100
|
+
* Checks if a given cookie is set.
|
|
36
101
|
*
|
|
37
|
-
*
|
|
102
|
+
* #### Learn more
|
|
103
|
+
* - {@apilink Optional}
|
|
38
104
|
*/
|
|
39
105
|
isPresent(): Promise<boolean>;
|
|
40
106
|
/**
|
|
41
|
-
*
|
|
42
|
-
* Returns the value of a given cookie.
|
|
43
|
-
*
|
|
44
|
-
* @returns {Promise<string>}
|
|
107
|
+
* Returns the value of a given cookie.
|
|
45
108
|
*/
|
|
46
109
|
value(): Promise<string>;
|
|
47
110
|
/**
|
|
48
|
-
*
|
|
49
|
-
* Returns the path of a given cookie, if any was set.
|
|
50
|
-
*
|
|
51
|
-
* @returns {Promise<string>}
|
|
111
|
+
* Returns the path of a given cookie, if any was set.
|
|
52
112
|
*/
|
|
53
113
|
path(): Promise<string>;
|
|
54
114
|
/**
|
|
55
|
-
*
|
|
56
|
-
* Returns the domain of a given cookie, if any was set.
|
|
57
|
-
*
|
|
58
|
-
* @returns {Promise<string>}
|
|
115
|
+
* Returns the domain of a given cookie, if any was set.
|
|
59
116
|
*/
|
|
60
117
|
domain(): Promise<string>;
|
|
61
118
|
/**
|
|
62
|
-
*
|
|
63
|
-
* Checks if a given cookie is HTTP-only.
|
|
119
|
+
* Checks if a given cookie is HTTP-only.
|
|
64
120
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @returns {Promise<string>}
|
|
121
|
+
* #### Learn more
|
|
122
|
+
* - [Mozilla Developer Network: Restricting access to cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
|
|
68
123
|
*/
|
|
69
124
|
isHttpOnly(): Promise<boolean>;
|
|
70
125
|
/**
|
|
71
|
-
*
|
|
72
|
-
* Checks if a given cookie is secure.
|
|
73
|
-
*
|
|
74
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies
|
|
126
|
+
* Checks if a given cookie is secure.
|
|
75
127
|
*
|
|
76
|
-
*
|
|
128
|
+
* #### Learn more
|
|
129
|
+
* - [Mozilla Developer Network: Restricting access to cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
|
|
77
130
|
*/
|
|
78
131
|
isSecure(): Promise<boolean>;
|
|
79
132
|
/**
|
|
80
|
-
*
|
|
81
|
-
* Returns the expiry date of a given cookie
|
|
133
|
+
* Returns the expiry date of a given cookie
|
|
82
134
|
*
|
|
83
|
-
*
|
|
135
|
+
* #### Learn more
|
|
136
|
+
* - {@apilink Timestamp}
|
|
84
137
|
*/
|
|
85
138
|
expiry(): Promise<Timestamp>;
|
|
86
139
|
/**
|
|
87
|
-
*
|
|
88
|
-
* Deletes a given cookie.
|
|
89
|
-
*
|
|
90
|
-
* @abstract
|
|
91
|
-
*
|
|
92
|
-
* @returns {Promise<void>}
|
|
140
|
+
* Deletes a given cookie.
|
|
93
141
|
*/
|
|
94
142
|
abstract delete(): Promise<void>;
|
|
95
143
|
/**
|
|
96
|
-
*
|
|
97
|
-
* Reads a given cookie from the browser.
|
|
98
|
-
*
|
|
99
|
-
* This method is to be implemented by integration tool-specific adapters.
|
|
100
|
-
* **Please note**: you don't need to implement any response caching here
|
|
101
|
-
* since it is covered by {@link Cookie#lazyLoadCookie} method.
|
|
144
|
+
* Reads a given cookie from the browser.
|
|
102
145
|
*
|
|
103
|
-
*
|
|
104
|
-
* @abstract
|
|
146
|
+
* This method is to be implemented by test integration tool-specific adapters.
|
|
105
147
|
*
|
|
106
|
-
*
|
|
148
|
+
* **Please note**: you don't need to implement any response caching here
|
|
149
|
+
* since it is covered by {@apilink Cookie.lazyLoadCookie} method.
|
|
107
150
|
*/
|
|
108
151
|
protected abstract read(): Promise<CookieData>;
|
|
109
152
|
/**
|
|
110
|
-
* @
|
|
111
|
-
* Invokes {@link Cookie#read} and caches the result in memory.
|
|
112
|
-
*
|
|
113
|
-
* @private
|
|
114
|
-
* @returns {Promise<CookieData>}
|
|
153
|
+
* Invokes {@apilink Cookie.read} and caches the result in memory.
|
|
115
154
|
*/
|
|
116
155
|
private lazyLoadCookie;
|
|
117
156
|
}
|
|
157
|
+
//# sourceMappingURL=Cookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cookie.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/Cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAK,WAAW,EAAE,QAAQ,EAAY,eAAe,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAKzI,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,8BAAsB,MAAO,YAAW,QAAQ;IA2DtB,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAzD3D;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC;IAQhE;;;;;;;;;OASG;IACH,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,GAAG,WAAW;IAsBrF;;OAEG;IACH,MAAM,CAAC,SAAS,IAAI,WAAW;IAO/B,OAAO,CAAC,MAAM,CAAa;IAE3B,SAAS,aAAgC,UAAU,EAAE,MAAM;IAI3D;;OAEG;IACH,IAAI,IAAI,MAAM;IAId;;;;;OAKG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAcnC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAK9B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAK7B;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAK/B;;;;;OAKG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAKpC;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAKlC;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC;IAKlC;;OAEG;IACH,QAAQ,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAE9C;;OAEG;YACW,cAAc;CAO/B"}
|
|
@@ -2,40 +2,103 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Cookie = void 0;
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
5
|
const tiny_types_1 = require("tiny-types");
|
|
7
6
|
const errors_1 = require("../../errors");
|
|
8
7
|
const abilities_1 = require("../abilities");
|
|
8
|
+
/**
|
|
9
|
+
* A Screenplay Pattern-style model responsible for managing cookies available to the current {@apilink Page}.
|
|
10
|
+
*
|
|
11
|
+
* ## Checking if a cookie exists
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
15
|
+
* import { Navigate, Cookie } from '@serenity-js/web'
|
|
16
|
+
* import { Ensure, isPresent } from '@serenity-js/assertions'
|
|
17
|
+
*
|
|
18
|
+
* await actorCalled('Sid')
|
|
19
|
+
* .attemptsTo(
|
|
20
|
+
* Navigate.to('https://example.org'),
|
|
21
|
+
*
|
|
22
|
+
* Ensure.that(
|
|
23
|
+
* Cookie.called('example-cookie-name'),
|
|
24
|
+
* isPresent()
|
|
25
|
+
* ),
|
|
26
|
+
* )
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* ## Setting a cookie
|
|
30
|
+
*
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
33
|
+
* import { Navigate, Cookie } from '@serenity-js/web'
|
|
34
|
+
* import { Ensure, isPresent, not } from '@serenity-js/assertions'
|
|
35
|
+
*
|
|
36
|
+
* await actorCalled('Sid')
|
|
37
|
+
* .attemptsTo(
|
|
38
|
+
* Navigate.to('https://example.org'),
|
|
39
|
+
*
|
|
40
|
+
* Ensure.that(Cookie.called('example-cookie-name'), not(isPresent())),
|
|
41
|
+
*
|
|
42
|
+
* Cookie.set({
|
|
43
|
+
* name: 'favourite',
|
|
44
|
+
* value: 'triple chocolate',
|
|
45
|
+
* }),
|
|
46
|
+
*
|
|
47
|
+
* Ensure.that(Cookie.called('example-cookie-name'), isPresent()),
|
|
48
|
+
* )
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ## Reading a cookie
|
|
52
|
+
*
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
55
|
+
* import { Navigate, Cookie } from '@serenity-js/web'
|
|
56
|
+
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
57
|
+
*
|
|
58
|
+
* await actorCalled('Sid')
|
|
59
|
+
* .attemptsTo(
|
|
60
|
+
* Navigate.to('https://example.org'),
|
|
61
|
+
*
|
|
62
|
+
* Ensure.that(
|
|
63
|
+
* Cookie.called('some-cookie-name').value(),
|
|
64
|
+
* equals('triple chocolate')
|
|
65
|
+
* ),
|
|
66
|
+
* )
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* ## Learn more
|
|
70
|
+
* - {@apilink CookieData}
|
|
71
|
+
* - {@apilink Page.cookie}
|
|
72
|
+
*
|
|
73
|
+
* @group Models
|
|
74
|
+
*/
|
|
9
75
|
class Cookie {
|
|
10
|
-
constructor(cookieName) {
|
|
11
|
-
this.cookieName = cookieName;
|
|
12
|
-
(0, tiny_types_1.ensure)('browser', cookieName, (0, tiny_types_1.isDefined)());
|
|
13
|
-
}
|
|
14
76
|
/**
|
|
15
|
-
* @
|
|
16
|
-
* Creates a {@link @serenity-js/core/lib/screenplay~Question} about a Cookie
|
|
77
|
+
* Creates a {@apilink QuestionAdapter} that resolves to {@apilink Cookie} identified by `name`.
|
|
17
78
|
*
|
|
18
|
-
* @param
|
|
19
|
-
* @returns {Question<Promise<Cookie>> & Adapter<Cookie>}
|
|
79
|
+
* @param name
|
|
20
80
|
*/
|
|
21
81
|
static called(name) {
|
|
22
82
|
return core_1.Question.about(`"${name}" cookie`, async (actor) => {
|
|
23
83
|
const cookieName = await actor.answer(name);
|
|
24
|
-
|
|
84
|
+
const page = await abilities_1.BrowseTheWeb.as(actor).currentPage();
|
|
85
|
+
return page.cookie(cookieName);
|
|
25
86
|
});
|
|
26
87
|
}
|
|
27
88
|
/**
|
|
28
|
-
* @
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
89
|
+
* Sets a cookie for the current {@apilink Page}. Note that {@apilink CookieData} can be either a plain-old JavaScript object, or an {@apilink Answerable} {@apilink WithAnswerableProperties}.
|
|
90
|
+
*
|
|
91
|
+
* :::info
|
|
92
|
+
* Make sure that the actor performing this interaction is on the page that should receive the cookie.
|
|
93
|
+
* Because of browser security restrictions, an actor can't set a cookie for an arbitrary page without being on that page.
|
|
94
|
+
* :::
|
|
32
95
|
*
|
|
33
|
-
* @param
|
|
34
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
96
|
+
* @param cookieData
|
|
35
97
|
*/
|
|
36
98
|
static set(cookieData) {
|
|
37
|
-
return core_1.Interaction.where((0,
|
|
38
|
-
const cookie = (0, tiny_types_1.ensure)('cookieData', await actor.answer(cookieData), (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isPlainObject)());
|
|
99
|
+
return core_1.Interaction.where((0, core_1.d) `#actor sets cookie: ${cookieData}`, async (actor) => {
|
|
100
|
+
const cookie = (0, tiny_types_1.ensure)('cookieData', await actor.answer(core_1.Question.fromObject(cookieData)), (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isPlainObject)());
|
|
101
|
+
const page = await abilities_1.BrowseTheWeb.as(actor).currentPage();
|
|
39
102
|
const sanitisedCookieData = {
|
|
40
103
|
name: (0, tiny_types_1.ensure)(`Cookie.set(cookieData.name)`, cookie.name, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)()),
|
|
41
104
|
value: (0, tiny_types_1.ensure)(`Cookie.set(cookieData.value)`, cookie.value, (0, tiny_types_1.isDefined)(), (0, tiny_types_1.isString)()),
|
|
@@ -46,28 +109,33 @@ class Cookie {
|
|
|
46
109
|
expiry: ensureIfPresent(cookie, 'expiry', (0, tiny_types_1.isInstanceOf)(core_1.Timestamp)),
|
|
47
110
|
sameSite: ensureIfPresent(cookie, 'sameSite', (0, tiny_types_1.isOneOf)('Lax', 'Strict', 'None')),
|
|
48
111
|
};
|
|
49
|
-
return
|
|
112
|
+
return page.setCookie(sanitisedCookieData);
|
|
50
113
|
});
|
|
51
114
|
}
|
|
52
115
|
/**
|
|
53
|
-
* @
|
|
54
|
-
* Creates an {@link @serenity-js/core/lib/screenplay~Interaction} to delete all cookies currently set in the browser.
|
|
55
|
-
*
|
|
56
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
116
|
+
* Creates an {@apilink Interaction|interaction} to delete all cookies available to the current {@apilink Page}..
|
|
57
117
|
*/
|
|
58
118
|
static deleteAll() {
|
|
59
|
-
return core_1.Interaction.where(`#actor deletes all cookies`, actor => {
|
|
60
|
-
|
|
119
|
+
return core_1.Interaction.where(`#actor deletes all cookies`, async (actor) => {
|
|
120
|
+
const page = await abilities_1.BrowseTheWeb.as(actor).currentPage();
|
|
121
|
+
await page.deleteAllCookies();
|
|
61
122
|
});
|
|
62
123
|
}
|
|
124
|
+
constructor(cookieName) {
|
|
125
|
+
this.cookieName = cookieName;
|
|
126
|
+
(0, tiny_types_1.ensure)('browser', cookieName, (0, tiny_types_1.isDefined)());
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Returns the name of this cookie.
|
|
130
|
+
*/
|
|
63
131
|
name() {
|
|
64
132
|
return this.cookieName;
|
|
65
133
|
}
|
|
66
134
|
/**
|
|
67
|
-
*
|
|
68
|
-
* Checks if a given cookie is set.
|
|
135
|
+
* Checks if a given cookie is set.
|
|
69
136
|
*
|
|
70
|
-
*
|
|
137
|
+
* #### Learn more
|
|
138
|
+
* - {@apilink Optional}
|
|
71
139
|
*/
|
|
72
140
|
async isPresent() {
|
|
73
141
|
try {
|
|
@@ -82,75 +150,58 @@ class Cookie {
|
|
|
82
150
|
}
|
|
83
151
|
}
|
|
84
152
|
/**
|
|
85
|
-
*
|
|
86
|
-
* Returns the value of a given cookie.
|
|
87
|
-
*
|
|
88
|
-
* @returns {Promise<string>}
|
|
153
|
+
* Returns the value of a given cookie.
|
|
89
154
|
*/
|
|
90
155
|
async value() {
|
|
91
156
|
const cookie = await this.lazyLoadCookie();
|
|
92
157
|
return cookie.value;
|
|
93
158
|
}
|
|
94
159
|
/**
|
|
95
|
-
*
|
|
96
|
-
* Returns the path of a given cookie, if any was set.
|
|
97
|
-
*
|
|
98
|
-
* @returns {Promise<string>}
|
|
160
|
+
* Returns the path of a given cookie, if any was set.
|
|
99
161
|
*/
|
|
100
162
|
async path() {
|
|
101
163
|
const cookie = await this.lazyLoadCookie();
|
|
102
164
|
return cookie.path;
|
|
103
165
|
}
|
|
104
166
|
/**
|
|
105
|
-
*
|
|
106
|
-
* Returns the domain of a given cookie, if any was set.
|
|
107
|
-
*
|
|
108
|
-
* @returns {Promise<string>}
|
|
167
|
+
* Returns the domain of a given cookie, if any was set.
|
|
109
168
|
*/
|
|
110
169
|
async domain() {
|
|
111
170
|
const cookie = await this.lazyLoadCookie();
|
|
112
171
|
return cookie.domain;
|
|
113
172
|
}
|
|
114
173
|
/**
|
|
115
|
-
*
|
|
116
|
-
* Checks if a given cookie is HTTP-only.
|
|
117
|
-
*
|
|
118
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies
|
|
174
|
+
* Checks if a given cookie is HTTP-only.
|
|
119
175
|
*
|
|
120
|
-
*
|
|
176
|
+
* #### Learn more
|
|
177
|
+
* - [Mozilla Developer Network: Restricting access to cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
|
|
121
178
|
*/
|
|
122
179
|
async isHttpOnly() {
|
|
123
180
|
const cookie = await this.lazyLoadCookie();
|
|
124
181
|
return cookie.httpOnly;
|
|
125
182
|
}
|
|
126
183
|
/**
|
|
127
|
-
*
|
|
128
|
-
* Checks if a given cookie is secure.
|
|
184
|
+
* Checks if a given cookie is secure.
|
|
129
185
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* @returns {Promise<string>}
|
|
186
|
+
* #### Learn more
|
|
187
|
+
* - [Mozilla Developer Network: Restricting access to cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies)
|
|
133
188
|
*/
|
|
134
189
|
async isSecure() {
|
|
135
190
|
const cookie = await this.lazyLoadCookie();
|
|
136
191
|
return cookie.secure;
|
|
137
192
|
}
|
|
138
193
|
/**
|
|
139
|
-
*
|
|
140
|
-
* Returns the expiry date of a given cookie
|
|
194
|
+
* Returns the expiry date of a given cookie
|
|
141
195
|
*
|
|
142
|
-
*
|
|
196
|
+
* #### Learn more
|
|
197
|
+
* - {@apilink Timestamp}
|
|
143
198
|
*/
|
|
144
199
|
async expiry() {
|
|
145
200
|
const cookie = await this.lazyLoadCookie();
|
|
146
201
|
return cookie.expiry;
|
|
147
202
|
}
|
|
148
203
|
/**
|
|
149
|
-
* @
|
|
150
|
-
* Invokes {@link Cookie#read} and caches the result in memory.
|
|
151
|
-
*
|
|
152
|
-
* @private
|
|
153
|
-
* @returns {Promise<CookieData>}
|
|
204
|
+
* Invokes {@apilink Cookie.read} and caches the result in memory.
|
|
154
205
|
*/
|
|
155
206
|
async lazyLoadCookie() {
|
|
156
207
|
if (!this.cookie) {
|
|
@@ -169,7 +220,7 @@ exports.Cookie = Cookie;
|
|
|
169
220
|
* @param predicates
|
|
170
221
|
*/
|
|
171
222
|
function ensureIfPresent(data, property, ...predicates) {
|
|
172
|
-
return data[property]
|
|
223
|
+
return data[property]
|
|
173
224
|
? (0, tiny_types_1.ensure)(`Cookie.set(cookieData.${property})`, data[property], ...predicates)
|
|
174
225
|
: undefined;
|
|
175
226
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cookie.js","sourceRoot":"","sources":["../../../src/screenplay/models/Cookie.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Cookie.js","sourceRoot":"","sources":["../../../src/screenplay/models/Cookie.ts"],"names":[],"mappings":";;;AAAA,4CAAyI;AACzI,2CAAqH;AAErH,yCAAkD;AAClD,4CAA4C;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,MAAsB,MAAM;IAExB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,IAAwB;QAClC,OAAO,eAAQ,CAAC,KAAK,CAAC,IAAK,IAAK,UAAU,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AI,CAAC,QAAQ,CAAC;QACjB,CAAC,CAAC,IAAA,mBAAM,EAAC,yBAAyB,QAAQ,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,UAAU,CAAC;QAC7E,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC"}
|
|
@@ -1,89 +1,51 @@
|
|
|
1
1
|
import { Timestamp } from '@serenity-js/core';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
4
|
-
* A data structure describing a {@link Cookie} to be set or that's been read.
|
|
3
|
+
* A data structure describing a {@apilink Cookie} to be set, or one that's been read.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
5
|
+
* ## Learn more
|
|
6
|
+
*
|
|
7
|
+
* - {@apilink Cookie}
|
|
8
|
+
* - {@apilink Page.cookie}
|
|
9
|
+
*
|
|
10
|
+
* @group Models
|
|
7
11
|
*/
|
|
8
12
|
export interface CookieData {
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
11
|
-
* The name of the cookie.
|
|
12
|
-
*
|
|
13
|
-
* @type {string}
|
|
14
|
-
* @public
|
|
14
|
+
* The name of the cookie.
|
|
15
15
|
*/
|
|
16
16
|
name: string;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* The value of the cookie.
|
|
20
|
-
*
|
|
21
|
-
* @type {string}
|
|
22
|
-
* @public
|
|
18
|
+
* The value of the cookie.
|
|
23
19
|
*/
|
|
24
20
|
value: string;
|
|
25
21
|
/**
|
|
26
|
-
*
|
|
27
|
-
* The domain the cookie is visible to.
|
|
28
|
-
* Defaults to the current browsing context's document's URL when setting a cookie.
|
|
22
|
+
* The domain this cookie is visible to.
|
|
29
23
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @type {string}
|
|
33
|
-
* @public
|
|
24
|
+
* Defaults to the current browsing context's document's URL when setting a cookie.
|
|
34
25
|
*/
|
|
35
26
|
domain?: string;
|
|
36
27
|
/**
|
|
37
|
-
*
|
|
38
|
-
* The cookie path. Defaults to "/" when adding a cookie.
|
|
39
|
-
*
|
|
40
|
-
* Optional.
|
|
41
|
-
*
|
|
42
|
-
* @type {string}
|
|
43
|
-
* @public
|
|
28
|
+
* The cookie path. Defaults to "/" when adding a cookie.
|
|
44
29
|
*/
|
|
45
30
|
path?: string;
|
|
46
31
|
/**
|
|
47
|
-
* @
|
|
48
|
-
* The {@link @serenity-js/core/lib/model~Timestamp} of when the cookie expires.
|
|
49
|
-
*
|
|
50
|
-
* Optional.
|
|
51
|
-
*
|
|
52
|
-
* @type {@serenity-js/core/lib/model~Timestamp}
|
|
53
|
-
* @public
|
|
32
|
+
* The {@apilink Timestamp} describing the point in time when this cookie expires.
|
|
54
33
|
*/
|
|
55
34
|
expiry?: Timestamp;
|
|
56
35
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* Optional.
|
|
61
|
-
*
|
|
62
|
-
* @type {boolean}
|
|
63
|
-
* @public
|
|
36
|
+
* Whether the cookie is an HTTP-only cookie.
|
|
37
|
+
* Defaults to `false` when adding a new cookie.
|
|
64
38
|
*/
|
|
65
39
|
httpOnly?: boolean;
|
|
66
40
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* Optional.
|
|
71
|
-
*
|
|
72
|
-
* @type {boolean}
|
|
73
|
-
* @public
|
|
41
|
+
* Whether the cookie is a secure cookie.
|
|
42
|
+
* Defaults to `false` when adding a new cookie.
|
|
74
43
|
*/
|
|
75
44
|
secure?: boolean;
|
|
76
45
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* Defaults to "None" if omitted when adding a cookie.
|
|
80
|
-
*
|
|
81
|
-
* Can be set to either "Lax" or "Strict".
|
|
82
|
-
*
|
|
83
|
-
* Optional.
|
|
84
|
-
*
|
|
85
|
-
* @type {string}
|
|
86
|
-
* @public
|
|
46
|
+
* Whether the cookie applies to a `SameSite` policy.
|
|
47
|
+
* Defaults to `None` if omitted when adding a cookie.
|
|
87
48
|
*/
|
|
88
49
|
sameSite?: 'Lax' | 'Strict' | 'None';
|
|
89
50
|
}
|
|
51
|
+
//# sourceMappingURL=CookieData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CookieData.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/CookieData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACxC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
3
|
-
* Represents pressable keys that aren't text to be used with {@link Press}.
|
|
2
|
+
* Represents keyboard keys that aren't text, and that can be used with the {@apilink Interaction|interaction} to {@apilink Press}.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
4
|
+
* **Note:** Modifier keys like {@apilink Key.Shift}, {@apilink Key.Alt} and {@apilink Key.Meta} (a.k.a. "Command" on Mac) will stay pressed,
|
|
5
|
+
* so there's no need to depress them.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* ## Learn more
|
|
8
|
+
*
|
|
9
|
+
* - {@apilink Press}
|
|
10
|
+
* - {@apilink Page.sendKeys}
|
|
11
|
+
* - [W3C WebDriver Spec: Keyboard Actions](https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions)
|
|
12
|
+
* - [Selenium WebDriver: Inputs](https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/lib/input.js#L46)
|
|
13
|
+
* - [WebdriverIO: Constants](https://github.com/webdriverio/webdriverio/blob/main/packages/wdio-utils/src/constants.ts#L5)
|
|
14
|
+
*
|
|
15
|
+
* @group Models
|
|
13
16
|
*/
|
|
14
17
|
export declare class Key {
|
|
15
18
|
readonly devtoolsName: string;
|
|
@@ -71,3 +74,4 @@ export declare class Key {
|
|
|
71
74
|
constructor(devtoolsName: string, utf16codePoint: string, isModifier?: boolean);
|
|
72
75
|
toString(): string;
|
|
73
76
|
}
|
|
77
|
+
//# sourceMappingURL=Key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Key.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/Key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,GAAG;aA4DQ,YAAY,EAAE,MAAM;aACpB,cAAc,EAAE,MAAM;aACtB,UAAU,EAAE,OAAO;IA7DvC,OAAc,GAAG,MAAkC;IACnD,OAAc,SAAS,MAAkC;IACzD,OAAc,SAAS,MAAkC;IACzD,OAAc,UAAU,MAAmC;IAC3D,OAAc,OAAO,MAAgC;IACrD,OAAc,SAAS,MAAkC;IACzD,OAAc,MAAM,MAA+B;IACnD,OAAc,KAAK,MAA8B;IACjD,OAAc,OAAO,MAAsC;IAC3D,OAAc,MAAM,MAA+B;IACnD,OAAc,GAAG,MAA4B;IAC7C,OAAc,KAAK,MAA8B;IACjD,OAAc,MAAM,MAA+B;IACnD,OAAc,EAAE,MAA2B;IAC3C,OAAc,EAAE,MAA2B;IAC3C,OAAc,EAAE,MAA2B;IAC3C,OAAc,EAAE,M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