@serenity-js/protractor 2.33.1 → 3.0.0-rc.11
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 +481 -0
- package/lib/adapter/ProtractorFrameworkAdapter.js +5 -0
- package/lib/adapter/ProtractorFrameworkAdapter.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/screenplay/abilities/{BrowseTheWeb.d.ts → BrowseTheWebWithProtractor.d.ts} +38 -191
- package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithProtractor.js} +129 -251
- package/lib/screenplay/abilities/BrowseTheWebWithProtractor.js.map +1 -0
- package/lib/screenplay/abilities/index.d.ts +1 -1
- package/lib/screenplay/abilities/index.js +1 -1
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/index.d.ts +1 -0
- package/lib/screenplay/index.js +1 -0
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/interactions/UseAngular.js +2 -2
- package/lib/screenplay/interactions/UseAngular.js.map +1 -1
- package/lib/screenplay/interactions/index.d.ts +0 -19
- package/lib/screenplay/interactions/index.js +0 -19
- package/lib/screenplay/interactions/index.js.map +1 -1
- package/lib/screenplay/models/ProtractorCookie.d.ts +11 -0
- package/lib/screenplay/models/ProtractorCookie.js +39 -0
- package/lib/screenplay/models/ProtractorCookie.js.map +1 -0
- package/lib/screenplay/models/ProtractorFrame.d.ts +10 -0
- package/lib/screenplay/models/ProtractorFrame.js +39 -0
- package/lib/screenplay/models/ProtractorFrame.js.map +1 -0
- package/lib/screenplay/models/ProtractorModalDialog.d.ts +11 -0
- package/lib/screenplay/models/ProtractorModalDialog.js +43 -0
- package/lib/screenplay/models/ProtractorModalDialog.js.map +1 -0
- package/lib/screenplay/models/ProtractorPage.d.ts +26 -0
- package/lib/screenplay/models/ProtractorPage.js +98 -0
- package/lib/screenplay/models/ProtractorPage.js.map +1 -0
- package/lib/screenplay/models/ProtractorPageElement.d.ts +21 -0
- package/lib/screenplay/models/ProtractorPageElement.js +230 -0
- package/lib/screenplay/models/ProtractorPageElement.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +5 -0
- package/lib/screenplay/{questions/lists → models}/index.js +5 -1
- package/lib/screenplay/models/index.js.map +1 -0
- package/lib/screenplay/models/locators/ProtractorLocator.d.ts +9 -0
- package/lib/screenplay/models/locators/ProtractorLocator.js +28 -0
- package/lib/screenplay/models/locators/ProtractorLocator.js.map +1 -0
- package/lib/screenplay/models/locators/ProtractorNativeElementRoot.d.ts +5 -0
- package/lib/screenplay/{interactions/EnterBuilder.js → models/locators/ProtractorNativeElementRoot.js} +1 -1
- package/lib/screenplay/models/locators/ProtractorNativeElementRoot.js.map +1 -0
- package/lib/screenplay/models/locators/index.d.ts +2 -0
- package/lib/{stage/crew → screenplay/models/locators}/index.js +2 -1
- package/lib/screenplay/models/locators/index.js.map +1 -0
- package/lib/{promiseOf.d.ts → screenplay/promised.d.ts} +1 -1
- package/lib/{promiseOf.js → screenplay/promised.js} +4 -4
- package/lib/screenplay/promised.js.map +1 -0
- package/lib/screenplay/questions/ProtractorParam.d.ts +24 -29
- package/lib/screenplay/questions/ProtractorParam.js +26 -33
- package/lib/screenplay/questions/ProtractorParam.js.map +1 -1
- package/lib/screenplay/questions/index.d.ts +0 -13
- package/lib/screenplay/questions/index.js +0 -16
- package/lib/screenplay/questions/index.js.map +1 -1
- package/lib/screenplay/unpromisedWebElement.d.ts +11 -0
- package/lib/screenplay/unpromisedWebElement.js +24 -0
- package/lib/screenplay/unpromisedWebElement.js.map +1 -0
- package/package.json +19 -20
- package/src/adapter/ProtractorFrameworkAdapter.ts +5 -0
- package/src/index.ts +0 -2
- package/src/screenplay/abilities/{BrowseTheWeb.ts → BrowseTheWebWithProtractor.ts} +148 -263
- package/src/screenplay/abilities/index.ts +1 -1
- package/src/screenplay/index.ts +1 -0
- package/src/screenplay/interactions/UseAngular.ts +3 -3
- package/src/screenplay/interactions/index.ts +0 -19
- package/src/screenplay/models/ProtractorCookie.ts +41 -0
- package/src/screenplay/models/ProtractorFrame.ts +44 -0
- package/src/screenplay/models/ProtractorModalDialog.ts +49 -0
- package/src/screenplay/models/ProtractorPage.ts +124 -0
- package/src/screenplay/models/ProtractorPageElement.ts +285 -0
- package/src/screenplay/models/index.ts +6 -0
- package/src/screenplay/models/locators/ProtractorLocator.ts +50 -0
- package/src/screenplay/models/locators/ProtractorNativeElementRoot.ts +6 -0
- package/src/screenplay/models/locators/index.ts +2 -0
- package/src/{promiseOf.ts → screenplay/promised.ts} +1 -1
- package/src/screenplay/questions/ProtractorParam.ts +29 -38
- package/src/screenplay/questions/index.ts +0 -13
- package/src/screenplay/unpromisedWebElement.ts +25 -0
- package/lib/expectations/ElementFinderExpectation.d.ts +0 -11
- package/lib/expectations/ElementFinderExpectation.js +0 -24
- package/lib/expectations/ElementFinderExpectation.js.map +0 -1
- package/lib/expectations/index.d.ts +0 -6
- package/lib/expectations/index.js +0 -19
- package/lib/expectations/index.js.map +0 -1
- package/lib/expectations/isActive.d.ts +0 -13
- package/lib/expectations/isActive.js +0 -19
- package/lib/expectations/isActive.js.map +0 -1
- package/lib/expectations/isClickable.d.ts +0 -13
- package/lib/expectations/isClickable.js +0 -22
- package/lib/expectations/isClickable.js.map +0 -1
- package/lib/expectations/isEnabled.d.ts +0 -13
- package/lib/expectations/isEnabled.js +0 -19
- package/lib/expectations/isEnabled.js.map +0 -1
- package/lib/expectations/isPresent.d.ts +0 -14
- package/lib/expectations/isPresent.js +0 -20
- package/lib/expectations/isPresent.js.map +0 -1
- package/lib/expectations/isSelected.d.ts +0 -13
- package/lib/expectations/isSelected.js +0 -22
- package/lib/expectations/isSelected.js.map +0 -1
- package/lib/expectations/isVisible.d.ts +0 -13
- package/lib/expectations/isVisible.js +0 -25
- package/lib/expectations/isVisible.js.map +0 -1
- package/lib/promiseOf.js.map +0 -1
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +0 -1
- package/lib/screenplay/interactions/Accept.d.ts +0 -81
- package/lib/screenplay/interactions/Accept.js +0 -95
- package/lib/screenplay/interactions/Accept.js.map +0 -1
- package/lib/screenplay/interactions/Clear.d.ts +0 -88
- package/lib/screenplay/interactions/Clear.js +0 -121
- package/lib/screenplay/interactions/Clear.js.map +0 -1
- package/lib/screenplay/interactions/Click.d.ts +0 -81
- package/lib/screenplay/interactions/Click.js +0 -95
- package/lib/screenplay/interactions/Click.js.map +0 -1
- package/lib/screenplay/interactions/Close.d.ts +0 -89
- package/lib/screenplay/interactions/Close.js +0 -169
- package/lib/screenplay/interactions/Close.js.map +0 -1
- package/lib/screenplay/interactions/DeleteCookies.d.ts +0 -72
- package/lib/screenplay/interactions/DeleteCookies.js +0 -149
- package/lib/screenplay/interactions/DeleteCookies.js.map +0 -1
- package/lib/screenplay/interactions/Dismiss.d.ts +0 -85
- package/lib/screenplay/interactions/Dismiss.js +0 -99
- package/lib/screenplay/interactions/Dismiss.js.map +0 -1
- package/lib/screenplay/interactions/DoubleClick.d.ts +0 -99
- package/lib/screenplay/interactions/DoubleClick.js +0 -121
- package/lib/screenplay/interactions/DoubleClick.js.map +0 -1
- package/lib/screenplay/interactions/Enter.d.ts +0 -81
- package/lib/screenplay/interactions/Enter.js +0 -96
- package/lib/screenplay/interactions/Enter.js.map +0 -1
- package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -27
- package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ExecuteScript.d.ts +0 -171
- package/lib/screenplay/interactions/ExecuteScript.js +0 -291
- package/lib/screenplay/interactions/ExecuteScript.js.map +0 -1
- package/lib/screenplay/interactions/Hover.d.ts +0 -86
- package/lib/screenplay/interactions/Hover.js +0 -103
- package/lib/screenplay/interactions/Hover.js.map +0 -1
- package/lib/screenplay/interactions/Navigate.d.ts +0 -149
- package/lib/screenplay/interactions/Navigate.js +0 -345
- package/lib/screenplay/interactions/Navigate.js.map +0 -1
- package/lib/screenplay/interactions/Press.d.ts +0 -90
- package/lib/screenplay/interactions/Press.js +0 -127
- package/lib/screenplay/interactions/Press.js.map +0 -1
- package/lib/screenplay/interactions/PressBuilder.d.ts +0 -27
- package/lib/screenplay/interactions/PressBuilder.js +0 -3
- package/lib/screenplay/interactions/PressBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ResizeBrowserWindow.d.ts +0 -69
- package/lib/screenplay/interactions/ResizeBrowserWindow.js +0 -144
- package/lib/screenplay/interactions/ResizeBrowserWindow.js.map +0 -1
- package/lib/screenplay/interactions/RightClick.d.ts +0 -97
- package/lib/screenplay/interactions/RightClick.js +0 -113
- package/lib/screenplay/interactions/RightClick.js.map +0 -1
- package/lib/screenplay/interactions/Scroll.d.ts +0 -83
- package/lib/screenplay/interactions/Scroll.js +0 -98
- package/lib/screenplay/interactions/Scroll.js.map +0 -1
- package/lib/screenplay/interactions/Select.d.ts +0 -212
- package/lib/screenplay/interactions/Select.js +0 -342
- package/lib/screenplay/interactions/Select.js.map +0 -1
- package/lib/screenplay/interactions/SelectBuilder.d.ts +0 -33
- package/lib/screenplay/interactions/SelectBuilder.js +0 -3
- package/lib/screenplay/interactions/SelectBuilder.js.map +0 -1
- package/lib/screenplay/interactions/Switch.d.ts +0 -210
- package/lib/screenplay/interactions/Switch.js +0 -345
- package/lib/screenplay/interactions/Switch.js.map +0 -1
- package/lib/screenplay/interactions/TakeScreenshot.d.ts +0 -67
- package/lib/screenplay/interactions/TakeScreenshot.js +0 -86
- package/lib/screenplay/interactions/TakeScreenshot.js.map +0 -1
- package/lib/screenplay/interactions/Wait.d.ts +0 -147
- package/lib/screenplay/interactions/Wait.js +0 -247
- package/lib/screenplay/interactions/Wait.js.map +0 -1
- package/lib/screenplay/interactions/WaitBuilder.d.ts +0 -33
- package/lib/screenplay/interactions/WaitBuilder.js +0 -3
- package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
- package/lib/screenplay/questions/Attribute.d.ts +0 -29
- package/lib/screenplay/questions/Attribute.js +0 -56
- package/lib/screenplay/questions/Attribute.js.map +0 -1
- package/lib/screenplay/questions/Browser.d.ts +0 -47
- package/lib/screenplay/questions/Browser.js +0 -55
- package/lib/screenplay/questions/Browser.js.map +0 -1
- package/lib/screenplay/questions/CSSClasses.d.ts +0 -94
- package/lib/screenplay/questions/CSSClasses.js +0 -118
- package/lib/screenplay/questions/CSSClasses.js.map +0 -1
- package/lib/screenplay/questions/Cookie.d.ts +0 -9
- package/lib/screenplay/questions/Cookie.js +0 -65
- package/lib/screenplay/questions/Cookie.js.map +0 -1
- package/lib/screenplay/questions/LastScriptExecution.d.ts +0 -14
- package/lib/screenplay/questions/LastScriptExecution.js +0 -22
- package/lib/screenplay/questions/LastScriptExecution.js.map +0 -1
- package/lib/screenplay/questions/ModalDialog.d.ts +0 -120
- package/lib/screenplay/questions/ModalDialog.js +0 -142
- package/lib/screenplay/questions/ModalDialog.js.map +0 -1
- package/lib/screenplay/questions/Pick.d.ts +0 -72
- package/lib/screenplay/questions/Pick.js +0 -254
- package/lib/screenplay/questions/Pick.js.map +0 -1
- package/lib/screenplay/questions/Selected.d.ts +0 -185
- package/lib/screenplay/questions/Selected.js +0 -254
- package/lib/screenplay/questions/Selected.js.map +0 -1
- package/lib/screenplay/questions/Value.d.ts +0 -47
- package/lib/screenplay/questions/Value.js +0 -67
- package/lib/screenplay/questions/Value.js.map +0 -1
- package/lib/screenplay/questions/Website.d.ts +0 -15
- package/lib/screenplay/questions/Website.js +0 -25
- package/lib/screenplay/questions/Website.js.map +0 -1
- package/lib/screenplay/questions/Window.d.ts +0 -23
- package/lib/screenplay/questions/Window.js +0 -28
- package/lib/screenplay/questions/Window.js.map +0 -1
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.d.ts +0 -89
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js +0 -138
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js.map +0 -1
- package/lib/screenplay/questions/lists/index.d.ts +0 -1
- package/lib/screenplay/questions/lists/index.js.map +0 -1
- package/lib/screenplay/questions/targets/Target.d.ts +0 -168
- package/lib/screenplay/questions/targets/Target.js +0 -190
- package/lib/screenplay/questions/targets/Target.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetElement.d.ts +0 -50
- package/lib/screenplay/questions/targets/TargetElement.js +0 -62
- package/lib/screenplay/questions/targets/TargetElement.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetElements.d.ts +0 -102
- package/lib/screenplay/questions/targets/TargetElements.js +0 -124
- package/lib/screenplay/questions/targets/TargetElements.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetNestedElement.d.ts +0 -49
- package/lib/screenplay/questions/targets/TargetNestedElement.js +0 -61
- package/lib/screenplay/questions/targets/TargetNestedElement.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetNestedElements.d.ts +0 -101
- package/lib/screenplay/questions/targets/TargetNestedElements.js +0 -123
- package/lib/screenplay/questions/targets/TargetNestedElements.js.map +0 -1
- package/lib/screenplay/questions/targets/builders.d.ts +0 -8
- package/lib/screenplay/questions/targets/builders.js +0 -3
- package/lib/screenplay/questions/targets/builders.js.map +0 -1
- package/lib/screenplay/questions/targets/index.d.ts +0 -5
- package/lib/screenplay/questions/targets/index.js +0 -18
- package/lib/screenplay/questions/targets/index.js.map +0 -1
- package/lib/screenplay/questions/targets/override.d.ts +0 -7
- package/lib/screenplay/questions/targets/override.js +0 -21
- package/lib/screenplay/questions/targets/override.js.map +0 -1
- package/lib/screenplay/questions/text/Text.d.ts +0 -41
- package/lib/screenplay/questions/text/Text.js +0 -50
- package/lib/screenplay/questions/text/Text.js.map +0 -1
- package/lib/screenplay/questions/text/TextOfMultipleElements.d.ts +0 -23
- package/lib/screenplay/questions/text/TextOfMultipleElements.js +0 -37
- package/lib/screenplay/questions/text/TextOfMultipleElements.js.map +0 -1
- package/lib/screenplay/questions/text/TextOfSingleElement.d.ts +0 -23
- package/lib/screenplay/questions/text/TextOfSingleElement.js +0 -35
- package/lib/screenplay/questions/text/TextOfSingleElement.js.map +0 -1
- package/lib/screenplay/questions/text/index.d.ts +0 -1
- package/lib/screenplay/questions/text/index.js +0 -14
- package/lib/screenplay/questions/text/index.js.map +0 -1
- package/lib/screenplay/withAnswerOf.d.ts +0 -8
- package/lib/screenplay/withAnswerOf.js +0 -18
- package/lib/screenplay/withAnswerOf.js.map +0 -1
- package/lib/stage/crew/index.d.ts +0 -1
- package/lib/stage/crew/index.js.map +0 -1
- package/lib/stage/crew/photographer/Photographer.d.ts +0 -83
- package/lib/stage/crew/photographer/Photographer.js +0 -102
- package/lib/stage/crew/photographer/Photographer.js.map +0 -1
- package/lib/stage/crew/photographer/index.d.ts +0 -2
- package/lib/stage/crew/photographer/index.js +0 -15
- package/lib/stage/crew/photographer/index.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +0 -28
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +0 -65
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +0 -18
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +0 -30
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +0 -17
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +0 -19
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/index.d.ts +0 -4
- package/lib/stage/crew/photographer/strategies/index.js +0 -17
- package/lib/stage/crew/photographer/strategies/index.js.map +0 -1
- package/lib/stage/index.d.ts +0 -1
- package/lib/stage/index.js +0 -14
- package/lib/stage/index.js.map +0 -1
- package/src/expectations/ElementFinderExpectation.ts +0 -29
- package/src/expectations/index.ts +0 -6
- package/src/expectations/isActive.ts +0 -24
- package/src/expectations/isClickable.ts +0 -20
- package/src/expectations/isEnabled.ts +0 -18
- package/src/expectations/isPresent.ts +0 -19
- package/src/expectations/isSelected.ts +0 -23
- package/src/expectations/isVisible.ts +0 -27
- package/src/screenplay/interactions/Accept.ts +0 -95
- package/src/screenplay/interactions/Clear.ts +0 -130
- package/src/screenplay/interactions/Click.ts +0 -96
- package/src/screenplay/interactions/Close.ts +0 -184
- package/src/screenplay/interactions/DeleteCookies.ts +0 -154
- package/src/screenplay/interactions/Dismiss.ts +0 -99
- package/src/screenplay/interactions/DoubleClick.ts +0 -124
- package/src/screenplay/interactions/Enter.ts +0 -104
- package/src/screenplay/interactions/EnterBuilder.ts +0 -29
- package/src/screenplay/interactions/ExecuteScript.ts +0 -325
- package/src/screenplay/interactions/Hover.ts +0 -106
- package/src/screenplay/interactions/Navigate.ts +0 -363
- package/src/screenplay/interactions/Press.ts +0 -137
- package/src/screenplay/interactions/PressBuilder.ts +0 -29
- package/src/screenplay/interactions/ResizeBrowserWindow.ts +0 -148
- package/src/screenplay/interactions/RightClick.ts +0 -114
- package/src/screenplay/interactions/Scroll.ts +0 -99
- package/src/screenplay/interactions/Select.ts +0 -402
- package/src/screenplay/interactions/SelectBuilder.ts +0 -35
- package/src/screenplay/interactions/Switch.ts +0 -393
- package/src/screenplay/interactions/TakeScreenshot.ts +0 -89
- package/src/screenplay/interactions/Wait.ts +0 -267
- package/src/screenplay/interactions/WaitBuilder.ts +0 -35
- package/src/screenplay/questions/Attribute.ts +0 -67
- package/src/screenplay/questions/Browser.ts +0 -55
- package/src/screenplay/questions/CSSClasses.ts +0 -121
- package/src/screenplay/questions/Cookie.ts +0 -70
- package/src/screenplay/questions/LastScriptExecution.ts +0 -21
- package/src/screenplay/questions/ModalDialog.ts +0 -149
- package/src/screenplay/questions/Pick.ts +0 -334
- package/src/screenplay/questions/Selected.ts +0 -268
- package/src/screenplay/questions/Value.ts +0 -73
- package/src/screenplay/questions/Website.ts +0 -27
- package/src/screenplay/questions/Window.ts +0 -29
- package/src/screenplay/questions/lists/ElementArrayFinderListAdapter.ts +0 -158
- package/src/screenplay/questions/lists/index.ts +0 -1
- package/src/screenplay/questions/targets/Target.ts +0 -198
- package/src/screenplay/questions/targets/TargetElement.ts +0 -70
- package/src/screenplay/questions/targets/TargetElements.ts +0 -142
- package/src/screenplay/questions/targets/TargetNestedElement.ts +0 -71
- package/src/screenplay/questions/targets/TargetNestedElements.ts +0 -142
- package/src/screenplay/questions/targets/builders.ts +0 -10
- package/src/screenplay/questions/targets/index.ts +0 -5
- package/src/screenplay/questions/targets/override.ts +0 -17
- package/src/screenplay/questions/text/Text.ts +0 -55
- package/src/screenplay/questions/text/TextOfMultipleElements.ts +0 -40
- package/src/screenplay/questions/text/TextOfSingleElement.ts +0 -37
- package/src/screenplay/questions/text/index.ts +0 -1
- package/src/screenplay/withAnswerOf.ts +0 -19
- package/src/stage/crew/index.ts +0 -1
- package/src/stage/crew/photographer/Photographer.ts +0 -108
- package/src/stage/crew/photographer/index.ts +0 -2
- package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +0 -102
- package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +0 -28
- package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +0 -26
- package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +0 -26
- package/src/stage/crew/photographer/strategies/index.ts +0 -4
- package/src/stage/index.ts +0 -1
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DoubleClick = void 0;
|
|
4
|
-
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
|
-
const abilities_1 = require("../abilities");
|
|
7
|
-
const withAnswerOf_1 = require("../withAnswerOf");
|
|
8
|
-
/**
|
|
9
|
-
* @desc
|
|
10
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
11
|
-
* perform a double-click on a given Web element.
|
|
12
|
-
*
|
|
13
|
-
* @example <caption>Example widget</caption>
|
|
14
|
-
* <!--
|
|
15
|
-
* The editor shows up when the user double-clicks
|
|
16
|
-
* on one of the properties of their profile
|
|
17
|
-
* and let's them change the value of that property.
|
|
18
|
-
* -->
|
|
19
|
-
* <div id="user-profile">
|
|
20
|
-
* <ul>
|
|
21
|
-
* <li id="display-name" ondblclick="edit(this)">User12345</li>
|
|
22
|
-
* <li id="email-address" ondblclick="edit(this)">tester@example.org</li>
|
|
23
|
-
* </ul>
|
|
24
|
-
* <form id="editor" class="hidden">
|
|
25
|
-
* <input type="text" value="" />
|
|
26
|
-
* </form>
|
|
27
|
-
* </div>
|
|
28
|
-
*
|
|
29
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
30
|
-
* import { Target } from '@serenity-js/protractor';
|
|
31
|
-
* import { by } from 'protractor';
|
|
32
|
-
*
|
|
33
|
-
* class UserProfile {
|
|
34
|
-
* static displayName = Target.the('display name')
|
|
35
|
-
* .located(by.id('display-name'));
|
|
36
|
-
* static emailAddress = Target.the('email address')
|
|
37
|
-
* .located(by.id('email-address'));
|
|
38
|
-
* static editor = Target.the('editor')
|
|
39
|
-
* .located(by.id('editor'));
|
|
40
|
-
* }
|
|
41
|
-
*
|
|
42
|
-
* @example <caption>Double-clicking on an element</caption>
|
|
43
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
44
|
-
* import { BrowseTheWeb, DoubleClick, isVisible, Enter, Text, Wait } from '@serenity-js/protractor';
|
|
45
|
-
* import { Ensure, equals, not } from '@serenity-js/assertions';
|
|
46
|
-
* import { protractor, Key } from 'protractor';
|
|
47
|
-
*
|
|
48
|
-
* actorCalled('Dorothy')
|
|
49
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
50
|
-
* .attemptsTo(
|
|
51
|
-
* DoubleClick.on(UserProfile.displayName),
|
|
52
|
-
* Wait.until(UserProfile.editor, isVisible()),
|
|
53
|
-
*
|
|
54
|
-
* Enter.theValue('New username').into(UserProfile.editor),
|
|
55
|
-
* Press.the(Key.ENTER).in(UserProfile.editor),
|
|
56
|
-
*
|
|
57
|
-
* Ensure.that(Text.of(UserProfile.displayName), equals('New username')),
|
|
58
|
-
* Ensure.that(UserProfile.editor, not(isVisible()))
|
|
59
|
-
* );
|
|
60
|
-
*
|
|
61
|
-
* @see {@link Target}
|
|
62
|
-
*
|
|
63
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
64
|
-
*/
|
|
65
|
-
class DoubleClick extends core_1.Interaction {
|
|
66
|
-
/**
|
|
67
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
68
|
-
* The element to be double-clicked on
|
|
69
|
-
*/
|
|
70
|
-
constructor(target) {
|
|
71
|
-
super();
|
|
72
|
-
this.target = target;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @desc
|
|
76
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
77
|
-
*
|
|
78
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
79
|
-
* The element to be double-clicked on
|
|
80
|
-
*
|
|
81
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
82
|
-
*/
|
|
83
|
-
static on(target) {
|
|
84
|
-
return new DoubleClick(target);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @desc
|
|
88
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
89
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
90
|
-
*
|
|
91
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
92
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
93
|
-
*
|
|
94
|
-
* @returns {PromiseLike<void>}
|
|
95
|
-
*
|
|
96
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
97
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
98
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
99
|
-
*/
|
|
100
|
-
performAs(actor) {
|
|
101
|
-
// Since the deprecation of Webdriver's ControlFlow,
|
|
102
|
-
// Protractor's doubleClick might behave incorrectly when promises are used.
|
|
103
|
-
// The mouseMove/doubleClick combo works around that problem.
|
|
104
|
-
// See https://github.com/angular/protractor/issues/4578
|
|
105
|
-
return (0, withAnswerOf_1.withAnswerOf)(actor, this.target, (elf) => abilities_1.BrowseTheWeb.as(actor).actions()
|
|
106
|
-
.mouseMove(elf)
|
|
107
|
-
.perform()
|
|
108
|
-
.then(() => abilities_1.BrowseTheWeb.as(actor).actions().doubleClick().perform()));
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* @desc
|
|
112
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
113
|
-
*
|
|
114
|
-
* @returns {string}
|
|
115
|
-
*/
|
|
116
|
-
toString() {
|
|
117
|
-
return (0, io_1.formatted) `#actor double-clicks on ${this.target}`;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports.DoubleClick = DoubleClick;
|
|
121
|
-
//# sourceMappingURL=DoubleClick.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleClick.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/DoubleClick.ts"],"names":[],"mappings":";;;AAAA,4CAA2F;AAC3F,iDAAqD;AAGrD,4CAA4C;AAC5C,kDAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAa,WAAY,SAAQ,kBAAW;IAexC;;;OAGG;IACH,YAA6B,MAA+C;QACxE,KAAK,EAAE,CAAC;QADiB,WAAM,GAAN,MAAM,CAAyC;IAE5E,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,MAA+C;QACrD,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAUD;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,KAAuC;QAC7C,oDAAoD;QACpD,4EAA4E;QAC5E,6DAA6D;QAC7D,wDAAwD;QAExD,OAAO,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,GAAkB,EAAE,EAAE,CAC3D,wBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;aAC3B,SAAS,CAAC,GAAG,CAAC;aACd,OAAO,EAAE;aACT,IAAI,CAAC,GAAG,EAAE,CAAC,wBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACnF,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACJ,OAAO,IAAA,cAAS,EAAC,2BAA4B,IAAI,CAAC,MAAO,EAAE,CAAC;IAChE,CAAC;CACJ;AA3DD,kCA2DC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Answerable, AnswersQuestions, Interaction, Question, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { ElementFinder } from 'protractor';
|
|
3
|
-
import { AlertPromise } from 'selenium-webdriver';
|
|
4
|
-
import { EnterBuilder } from './EnterBuilder';
|
|
5
|
-
/**
|
|
6
|
-
* @desc
|
|
7
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
8
|
-
* enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
|
|
9
|
-
*
|
|
10
|
-
* @example <caption>Example widget</caption>
|
|
11
|
-
* <form>
|
|
12
|
-
* <input type="text" name="example" id="example" />
|
|
13
|
-
* </form>
|
|
14
|
-
*
|
|
15
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
16
|
-
* import { Target } from '@serenity-js/protractor';
|
|
17
|
-
* import { by } from 'protractor';
|
|
18
|
-
*
|
|
19
|
-
* class Form {
|
|
20
|
-
* static exampleInput = Target.the('example input')
|
|
21
|
-
* .located(by.id('example'));
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* @example <caption>Entering the value into a form field</caption>
|
|
25
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
26
|
-
* import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';
|
|
27
|
-
*
|
|
28
|
-
* actorCalled('Esme')
|
|
29
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
30
|
-
* .attemptsTo(
|
|
31
|
-
* Enter.theValue('Hello world!').into(Form.exampleInput),
|
|
32
|
-
* );
|
|
33
|
-
*
|
|
34
|
-
* @see {@link Target}
|
|
35
|
-
*
|
|
36
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
37
|
-
*/
|
|
38
|
-
export declare class Enter extends Interaction {
|
|
39
|
-
private readonly value;
|
|
40
|
-
private readonly field;
|
|
41
|
-
/**
|
|
42
|
-
* @desc
|
|
43
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
44
|
-
*
|
|
45
|
-
* @param {Answerable<string | number>} value
|
|
46
|
-
* The value to be entered
|
|
47
|
-
*
|
|
48
|
-
* @returns {EnterBuilder}
|
|
49
|
-
*/
|
|
50
|
-
static theValue(value: Answerable<string | number>): EnterBuilder;
|
|
51
|
-
/**
|
|
52
|
-
* @param {@serenity-js/core/lib/screenplay~Answerable<string | number>} value
|
|
53
|
-
* The value to be entered
|
|
54
|
-
*
|
|
55
|
-
* @param {Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise} field
|
|
56
|
-
* The field to enter the value into
|
|
57
|
-
*/
|
|
58
|
-
constructor(value: Answerable<string | number>, field: Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise);
|
|
59
|
-
/**
|
|
60
|
-
* @desc
|
|
61
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
62
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
63
|
-
*
|
|
64
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
65
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
66
|
-
*
|
|
67
|
-
* @returns {PromiseLike<void>}
|
|
68
|
-
*
|
|
69
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
70
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
71
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
72
|
-
*/
|
|
73
|
-
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
|
|
74
|
-
/**
|
|
75
|
-
* @desc
|
|
76
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
77
|
-
*
|
|
78
|
-
* @returns {string}
|
|
79
|
-
*/
|
|
80
|
-
toString(): string;
|
|
81
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Enter = void 0;
|
|
4
|
-
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
|
-
const withAnswerOf_1 = require("../withAnswerOf");
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
10
|
-
* enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
|
|
11
|
-
*
|
|
12
|
-
* @example <caption>Example widget</caption>
|
|
13
|
-
* <form>
|
|
14
|
-
* <input type="text" name="example" id="example" />
|
|
15
|
-
* </form>
|
|
16
|
-
*
|
|
17
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
18
|
-
* import { Target } from '@serenity-js/protractor';
|
|
19
|
-
* import { by } from 'protractor';
|
|
20
|
-
*
|
|
21
|
-
* class Form {
|
|
22
|
-
* static exampleInput = Target.the('example input')
|
|
23
|
-
* .located(by.id('example'));
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* @example <caption>Entering the value into a form field</caption>
|
|
27
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
28
|
-
* import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';
|
|
29
|
-
*
|
|
30
|
-
* actorCalled('Esme')
|
|
31
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
32
|
-
* .attemptsTo(
|
|
33
|
-
* Enter.theValue('Hello world!').into(Form.exampleInput),
|
|
34
|
-
* );
|
|
35
|
-
*
|
|
36
|
-
* @see {@link Target}
|
|
37
|
-
*
|
|
38
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
39
|
-
*/
|
|
40
|
-
class Enter extends core_1.Interaction {
|
|
41
|
-
/**
|
|
42
|
-
* @param {@serenity-js/core/lib/screenplay~Answerable<string | number>} value
|
|
43
|
-
* The value to be entered
|
|
44
|
-
*
|
|
45
|
-
* @param {Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise} field
|
|
46
|
-
* The field to enter the value into
|
|
47
|
-
*/
|
|
48
|
-
constructor(value, field) {
|
|
49
|
-
super();
|
|
50
|
-
this.value = value;
|
|
51
|
-
this.field = field;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @desc
|
|
55
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
56
|
-
*
|
|
57
|
-
* @param {Answerable<string | number>} value
|
|
58
|
-
* The value to be entered
|
|
59
|
-
*
|
|
60
|
-
* @returns {EnterBuilder}
|
|
61
|
-
*/
|
|
62
|
-
static theValue(value) {
|
|
63
|
-
return {
|
|
64
|
-
into: (field) => new Enter(value, field),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @desc
|
|
69
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
70
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
71
|
-
*
|
|
72
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
73
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
74
|
-
*
|
|
75
|
-
* @returns {PromiseLike<void>}
|
|
76
|
-
*
|
|
77
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
78
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
79
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
80
|
-
*/
|
|
81
|
-
performAs(actor) {
|
|
82
|
-
return actor.answer(this.value)
|
|
83
|
-
.then(value => (0, withAnswerOf_1.withAnswerOf)(actor, this.field, (elf) => elf.sendKeys(`${value}`)));
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* @desc
|
|
87
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
88
|
-
*
|
|
89
|
-
* @returns {string}
|
|
90
|
-
*/
|
|
91
|
-
toString() {
|
|
92
|
-
return (0, io_1.formatted) `#actor enters ${this.value} into ${this.field}`;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.Enter = Enter;
|
|
96
|
-
//# sourceMappingURL=Enter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Enter.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Enter.ts"],"names":[],"mappings":";;;AAAA,4CAAuG;AACvG,iDAAqD;AAIrD,kDAA+C;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAa,KAAM,SAAQ,kBAAW;IAkBlC;;;;;;OAMG;IACH,YACqB,KAAkC,EAClC,KAAsF;QAEvG,KAAK,EAAE,CAAC;QAHS,UAAK,GAAL,KAAK,CAA6B;QAClC,UAAK,GAAL,KAAK,CAAiF;IAG3G,CAAC;IA5BD;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAkC;QAC9C,OAAO;YACH,IAAI,EAAE,CAAC,KAAsF,EAAE,EAAE,CAC7F,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC;SAC9B,CAAC;IACN,CAAC;IAgBD;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,KAAuC;QAC7C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aAC1B,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,GAAiC,EAAE,EAAE,CACjF,GAAG,CAAC,QAAQ,CAAC,GAAI,KAAM,EAAE,CAAC,CAAC,CAC9B,CAAC;IACV,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACJ,OAAO,IAAA,cAAS,EAAC,iBAAkB,IAAI,CAAC,KAAM,SAAU,IAAI,CAAC,KAAM,EAAE,CAAC;IAC1E,CAAC;CACJ;AA9DD,sBA8DC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Question } from '@serenity-js/core';
|
|
2
|
-
import { Interaction } from '@serenity-js/core/lib/screenplay';
|
|
3
|
-
import { ElementFinder } from 'protractor';
|
|
4
|
-
import { AlertPromise } from 'selenium-webdriver';
|
|
5
|
-
/**
|
|
6
|
-
* @desc
|
|
7
|
-
* Fluent interface to make the instantiation of
|
|
8
|
-
* the {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
9
|
-
* to {@link Enter} more readable.
|
|
10
|
-
*
|
|
11
|
-
* @see {@link Enter}
|
|
12
|
-
*
|
|
13
|
-
* @interface
|
|
14
|
-
*/
|
|
15
|
-
export interface EnterBuilder {
|
|
16
|
-
/**
|
|
17
|
-
* @desc
|
|
18
|
-
* Instantiates an {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
19
|
-
* to {@link Enter}.
|
|
20
|
-
*
|
|
21
|
-
* @param {Question<ElementFinder> | ElementFinder} field
|
|
22
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
23
|
-
*
|
|
24
|
-
* @see {@link Target}
|
|
25
|
-
*/
|
|
26
|
-
into: (field: Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise) => Interaction;
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnterBuilder.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/EnterBuilder.ts"],"names":[],"mappings":""}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { Answerable, AnswersQuestions, CollectsArtifacts, Interaction, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
/**
|
|
3
|
-
* @desc
|
|
4
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
5
|
-
* execute a script within the context of the current browser window.
|
|
6
|
-
*
|
|
7
|
-
* Please see the tests below for usage examples.
|
|
8
|
-
*
|
|
9
|
-
* @see {@link LastScriptExecution.result}
|
|
10
|
-
*/
|
|
11
|
-
export declare class ExecuteScript {
|
|
12
|
-
/**
|
|
13
|
-
* @desc
|
|
14
|
-
* Instantiates a version of this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
15
|
-
* configured to load a script from `sourceUrl`.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} sourceUrl
|
|
18
|
-
* The URL to load the script from
|
|
19
|
-
*
|
|
20
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
21
|
-
*/
|
|
22
|
-
static from(sourceUrl: string): Interaction;
|
|
23
|
-
/**
|
|
24
|
-
* @desc
|
|
25
|
-
* Schedules a command to execute asynchronous JavaScript in the context of the currently selected frame or window.
|
|
26
|
-
* The script fragment will be executed as the body of an anonymous function.
|
|
27
|
-
* If the script is provided as a function object, that function will be converted to a string for injection
|
|
28
|
-
* into the target window.
|
|
29
|
-
*
|
|
30
|
-
* Any arguments provided in addition to the script will be included as script arguments and may be referenced
|
|
31
|
-
* using the `arguments` object. Arguments may be a `boolean`, `number`, `string`
|
|
32
|
-
* or `Target` (`Question<ElementFinder>`).
|
|
33
|
-
* Arrays and objects may also be used as script arguments as long as each item adheres
|
|
34
|
-
* to the types previously mentioned.
|
|
35
|
-
*
|
|
36
|
-
* Unlike executing synchronous JavaScript with {@link ExecuteScript#sync},
|
|
37
|
-
* scripts executed with this function must explicitly signal they are finished by invoking the provided callback.
|
|
38
|
-
*
|
|
39
|
-
* This callback will always be injected into the executed function as the last argument,
|
|
40
|
-
* and thus may be referenced with `arguments[arguments.length - 1]`.
|
|
41
|
-
*
|
|
42
|
-
* If the script invokes the `callback` with a return value, this will be made available
|
|
43
|
-
* via the {@link LastScriptExecution.result}.
|
|
44
|
-
*
|
|
45
|
-
* **Please note** that in order to signal an error in the `script` you need to throw an {@link Error}
|
|
46
|
-
* instead of passing it to the callback function.
|
|
47
|
-
*
|
|
48
|
-
* @example <caption>Executing an async script</caption>
|
|
49
|
-
* actor.attemptsTo(ExecuteScript.async(
|
|
50
|
-
* var callback = arguments[arguments.length - 1];
|
|
51
|
-
*
|
|
52
|
-
* // do stuff
|
|
53
|
-
*
|
|
54
|
-
* callback(result)
|
|
55
|
-
* ));
|
|
56
|
-
*
|
|
57
|
-
* @example <caption>Passing arguments to an async script</caption>
|
|
58
|
-
* actor.attemptsTo(ExecuteScript.async(
|
|
59
|
-
* var name = arguments[0];
|
|
60
|
-
* var age = arguments[1];
|
|
61
|
-
* var callback = arguments[arguments.length - 1];
|
|
62
|
-
*
|
|
63
|
-
* // do stuff
|
|
64
|
-
*
|
|
65
|
-
* callback(result)
|
|
66
|
-
* ).withArguments('Bob', 24));
|
|
67
|
-
*
|
|
68
|
-
* @example <caption>Passing Target arguments to an async script</caption>
|
|
69
|
-
* actor.attemptsTo(ExecuteScript.async(
|
|
70
|
-
* var header = arguments[0]; // Target gets converted to a WebElement
|
|
71
|
-
* var callback = arguments[arguments.length - 1];
|
|
72
|
-
*
|
|
73
|
-
* callback(header.innerText)
|
|
74
|
-
* ).withArguments(Target.the('header').located(by.css('h1'))));
|
|
75
|
-
*
|
|
76
|
-
* @param {string | Function} script
|
|
77
|
-
* The script to be executed
|
|
78
|
-
*
|
|
79
|
-
* @returns {ExecuteScriptWithArguments}
|
|
80
|
-
*
|
|
81
|
-
* @see {@link LastScriptExecution.result}
|
|
82
|
-
*/
|
|
83
|
-
static async(script: string | Function): ExecuteScriptWithArguments;
|
|
84
|
-
/**
|
|
85
|
-
* @desc
|
|
86
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
87
|
-
* execute a synchronous script in the context of the currently selected frame or window.
|
|
88
|
-
*
|
|
89
|
-
* If the script returns a value, it will be made available via {@link LastScriptExecution.result}.
|
|
90
|
-
*
|
|
91
|
-
* @example <caption>Executing a sync script and reading the result</caption>
|
|
92
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
93
|
-
* import { BrowseTheWeb, ExecuteScript, LastScriptExecution } from '@serenity-js/protractor';
|
|
94
|
-
* import { Ensure, includes } from '@serenity-js/assertions';
|
|
95
|
-
* import { protractor } from 'protractor';
|
|
96
|
-
*
|
|
97
|
-
* actorCalled('Joseph')
|
|
98
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
99
|
-
* .attemptsTo(
|
|
100
|
-
* ExecuteScript.sync('return navigator.userAgent'),
|
|
101
|
-
* Ensure.that(LastScriptExecution.result<string>(), includes('Chrome')),
|
|
102
|
-
* );
|
|
103
|
-
*
|
|
104
|
-
* @param {string | Function} script
|
|
105
|
-
* The script to be executed
|
|
106
|
-
*
|
|
107
|
-
* @returns {ExecuteScriptWithArguments}
|
|
108
|
-
*
|
|
109
|
-
* @see {@link LastScriptExecution.result}
|
|
110
|
-
*/
|
|
111
|
-
static sync(script: string | Function): ExecuteScriptWithArguments;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* @desc
|
|
115
|
-
* Allows for a script to be executed to be parametrised.
|
|
116
|
-
*
|
|
117
|
-
* **Please note** that the arguments can be both synchronous and asynchronous {@link @serenity-js/core/lib/screenplay~Question}s
|
|
118
|
-
* as well as regular static values.
|
|
119
|
-
*
|
|
120
|
-
* @abstract
|
|
121
|
-
*
|
|
122
|
-
* @see {@link ExecuteScript}
|
|
123
|
-
*
|
|
124
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
125
|
-
*/
|
|
126
|
-
export declare abstract class ExecuteScriptWithArguments extends Interaction {
|
|
127
|
-
protected readonly script: string | Function;
|
|
128
|
-
protected readonly args: Array<Answerable<any>>;
|
|
129
|
-
/**
|
|
130
|
-
* @param {string | Function} script
|
|
131
|
-
* The script to be executed
|
|
132
|
-
*
|
|
133
|
-
* @param {Array<Answerable<any>>} args
|
|
134
|
-
* Arguments to parametrise the script with
|
|
135
|
-
*/
|
|
136
|
-
constructor(script: string | Function, // eslint-disable-line @typescript-eslint/ban-types
|
|
137
|
-
args?: Array<Answerable<any>>);
|
|
138
|
-
/**
|
|
139
|
-
* @desc
|
|
140
|
-
* Instantiates an {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
141
|
-
* to {@link Enter}.
|
|
142
|
-
*
|
|
143
|
-
* @param {...Array<Answerable<any>>} args
|
|
144
|
-
* Arguments to parametrise the script with
|
|
145
|
-
*
|
|
146
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
147
|
-
*/
|
|
148
|
-
abstract withArguments(...args: Array<Answerable<any>>): Interaction;
|
|
149
|
-
/**
|
|
150
|
-
* @desc
|
|
151
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
152
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
153
|
-
*
|
|
154
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
155
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
156
|
-
*
|
|
157
|
-
* @returns {PromiseLike<void>}
|
|
158
|
-
*
|
|
159
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
160
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
161
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
162
|
-
*/
|
|
163
|
-
performAs(actor: UsesAbilities & CollectsArtifacts & AnswersQuestions): PromiseLike<void>;
|
|
164
|
-
protected abstract executeAs(actor: UsesAbilities & AnswersQuestions, args: any[]): Promise<any>;
|
|
165
|
-
/**
|
|
166
|
-
* @private
|
|
167
|
-
*
|
|
168
|
-
* @param {Array<Answerable<any>>} args
|
|
169
|
-
*/
|
|
170
|
-
private answerAll;
|
|
171
|
-
}
|