@serenity-js/protractor 2.32.2 → 3.0.0-rc.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 +75 -0
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/screenplay/abilities/{BrowseTheWeb.d.ts → BrowseTheWebWithProtractor.d.ts} +52 -160
- package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithProtractor.js} +169 -218
- package/lib/screenplay/abilities/BrowseTheWebWithProtractor.js.map +1 -0
- package/lib/screenplay/abilities/index.d.ts +1 -1
- package/lib/screenplay/abilities/index.js +1 -1
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/index.d.ts +1 -0
- package/lib/screenplay/index.js +1 -0
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/interactions/UseAngular.js +2 -2
- package/lib/screenplay/interactions/UseAngular.js.map +1 -1
- package/lib/screenplay/interactions/index.d.ts +0 -19
- package/lib/screenplay/interactions/index.js +0 -19
- package/lib/screenplay/interactions/index.js.map +1 -1
- package/lib/screenplay/models/ProtractorCookie.d.ts +11 -0
- package/lib/screenplay/models/ProtractorCookie.js +39 -0
- package/lib/screenplay/models/ProtractorCookie.js.map +1 -0
- package/lib/screenplay/models/ProtractorModalDialog.d.ts +11 -0
- package/lib/screenplay/models/ProtractorModalDialog.js +43 -0
- package/lib/screenplay/models/ProtractorModalDialog.js.map +1 -0
- package/lib/screenplay/models/ProtractorNativeElementRoot.d.ts +5 -0
- package/lib/screenplay/{interactions/EnterBuilder.js → models/ProtractorNativeElementRoot.js} +1 -1
- package/lib/screenplay/models/ProtractorNativeElementRoot.js.map +1 -0
- package/lib/screenplay/models/ProtractorPage.d.ts +24 -0
- package/lib/screenplay/models/ProtractorPage.js +92 -0
- package/lib/screenplay/models/ProtractorPage.js.map +1 -0
- package/lib/screenplay/models/ProtractorPageElement.d.ts +23 -0
- package/lib/screenplay/models/ProtractorPageElement.js +112 -0
- package/lib/screenplay/models/ProtractorPageElement.js.map +1 -0
- package/lib/screenplay/models/ProtractorPageElements.d.ts +16 -0
- package/lib/screenplay/models/ProtractorPageElements.js +62 -0
- package/lib/screenplay/models/ProtractorPageElements.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +6 -0
- package/lib/{expectations → screenplay/models}/index.js +6 -6
- package/lib/screenplay/models/index.js.map +1 -0
- package/lib/{promiseOf.d.ts → screenplay/promised.d.ts} +1 -1
- package/lib/{promiseOf.js → screenplay/promised.js} +4 -4
- package/lib/screenplay/promised.js.map +1 -0
- package/lib/screenplay/promisedWebElement.d.ts +11 -0
- package/lib/screenplay/promisedWebElement.js +27 -0
- package/lib/screenplay/promisedWebElement.js.map +1 -0
- package/lib/screenplay/questions/ProtractorParam.d.ts +24 -29
- package/lib/screenplay/questions/ProtractorParam.js +26 -33
- package/lib/screenplay/questions/ProtractorParam.js.map +1 -1
- package/lib/screenplay/questions/index.d.ts +0 -13
- package/lib/screenplay/questions/index.js +0 -16
- package/lib/screenplay/questions/index.js.map +1 -1
- package/package.json +20 -22
- package/src/index.ts +0 -2
- package/src/screenplay/abilities/{BrowseTheWeb.ts → BrowseTheWebWithProtractor.ts} +216 -241
- package/src/screenplay/abilities/index.ts +1 -1
- package/src/screenplay/index.ts +1 -0
- package/src/screenplay/interactions/UseAngular.ts +3 -3
- package/src/screenplay/interactions/index.ts +0 -19
- package/src/screenplay/models/ProtractorCookie.ts +41 -0
- package/src/screenplay/models/ProtractorModalDialog.ts +49 -0
- package/src/screenplay/models/ProtractorNativeElementRoot.ts +6 -0
- package/src/screenplay/models/ProtractorPage.ts +116 -0
- package/src/screenplay/models/ProtractorPageElement.ts +167 -0
- package/src/screenplay/models/ProtractorPageElements.ts +86 -0
- package/src/screenplay/models/index.ts +7 -0
- package/src/{promiseOf.ts → screenplay/promised.ts} +1 -1
- package/src/screenplay/promisedWebElement.ts +28 -0
- package/src/screenplay/questions/ProtractorParam.ts +29 -38
- package/src/screenplay/questions/index.ts +0 -13
- package/lib/expectations/ElementFinderExpectation.d.ts +0 -11
- package/lib/expectations/ElementFinderExpectation.js +0 -24
- package/lib/expectations/ElementFinderExpectation.js.map +0 -1
- package/lib/expectations/index.d.ts +0 -6
- package/lib/expectations/index.js.map +0 -1
- package/lib/expectations/isActive.d.ts +0 -13
- package/lib/expectations/isActive.js +0 -19
- package/lib/expectations/isActive.js.map +0 -1
- package/lib/expectations/isClickable.d.ts +0 -13
- package/lib/expectations/isClickable.js +0 -22
- package/lib/expectations/isClickable.js.map +0 -1
- package/lib/expectations/isEnabled.d.ts +0 -13
- package/lib/expectations/isEnabled.js +0 -19
- package/lib/expectations/isEnabled.js.map +0 -1
- package/lib/expectations/isPresent.d.ts +0 -14
- package/lib/expectations/isPresent.js +0 -20
- package/lib/expectations/isPresent.js.map +0 -1
- package/lib/expectations/isSelected.d.ts +0 -13
- package/lib/expectations/isSelected.js +0 -22
- package/lib/expectations/isSelected.js.map +0 -1
- package/lib/expectations/isVisible.d.ts +0 -13
- package/lib/expectations/isVisible.js +0 -25
- package/lib/expectations/isVisible.js.map +0 -1
- package/lib/promiseOf.js.map +0 -1
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +0 -1
- package/lib/screenplay/interactions/Accept.d.ts +0 -81
- package/lib/screenplay/interactions/Accept.js +0 -95
- package/lib/screenplay/interactions/Accept.js.map +0 -1
- package/lib/screenplay/interactions/Clear.d.ts +0 -88
- package/lib/screenplay/interactions/Clear.js +0 -121
- package/lib/screenplay/interactions/Clear.js.map +0 -1
- package/lib/screenplay/interactions/Click.d.ts +0 -81
- package/lib/screenplay/interactions/Click.js +0 -95
- package/lib/screenplay/interactions/Click.js.map +0 -1
- package/lib/screenplay/interactions/Close.d.ts +0 -89
- package/lib/screenplay/interactions/Close.js +0 -169
- package/lib/screenplay/interactions/Close.js.map +0 -1
- package/lib/screenplay/interactions/DeleteCookies.d.ts +0 -72
- package/lib/screenplay/interactions/DeleteCookies.js +0 -149
- package/lib/screenplay/interactions/DeleteCookies.js.map +0 -1
- package/lib/screenplay/interactions/Dismiss.d.ts +0 -85
- package/lib/screenplay/interactions/Dismiss.js +0 -99
- package/lib/screenplay/interactions/Dismiss.js.map +0 -1
- package/lib/screenplay/interactions/DoubleClick.d.ts +0 -99
- package/lib/screenplay/interactions/DoubleClick.js +0 -121
- package/lib/screenplay/interactions/DoubleClick.js.map +0 -1
- package/lib/screenplay/interactions/Enter.d.ts +0 -81
- package/lib/screenplay/interactions/Enter.js +0 -96
- package/lib/screenplay/interactions/Enter.js.map +0 -1
- package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -27
- package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ExecuteScript.d.ts +0 -171
- package/lib/screenplay/interactions/ExecuteScript.js +0 -291
- package/lib/screenplay/interactions/ExecuteScript.js.map +0 -1
- package/lib/screenplay/interactions/Hover.d.ts +0 -86
- package/lib/screenplay/interactions/Hover.js +0 -103
- package/lib/screenplay/interactions/Hover.js.map +0 -1
- package/lib/screenplay/interactions/Navigate.d.ts +0 -149
- package/lib/screenplay/interactions/Navigate.js +0 -345
- package/lib/screenplay/interactions/Navigate.js.map +0 -1
- package/lib/screenplay/interactions/Press.d.ts +0 -90
- package/lib/screenplay/interactions/Press.js +0 -127
- package/lib/screenplay/interactions/Press.js.map +0 -1
- package/lib/screenplay/interactions/PressBuilder.d.ts +0 -27
- package/lib/screenplay/interactions/PressBuilder.js +0 -3
- package/lib/screenplay/interactions/PressBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ResizeBrowserWindow.d.ts +0 -69
- package/lib/screenplay/interactions/ResizeBrowserWindow.js +0 -144
- package/lib/screenplay/interactions/ResizeBrowserWindow.js.map +0 -1
- package/lib/screenplay/interactions/RightClick.d.ts +0 -97
- package/lib/screenplay/interactions/RightClick.js +0 -113
- package/lib/screenplay/interactions/RightClick.js.map +0 -1
- package/lib/screenplay/interactions/Scroll.d.ts +0 -83
- package/lib/screenplay/interactions/Scroll.js +0 -98
- package/lib/screenplay/interactions/Scroll.js.map +0 -1
- package/lib/screenplay/interactions/Select.d.ts +0 -212
- package/lib/screenplay/interactions/Select.js +0 -342
- package/lib/screenplay/interactions/Select.js.map +0 -1
- package/lib/screenplay/interactions/SelectBuilder.d.ts +0 -33
- package/lib/screenplay/interactions/SelectBuilder.js +0 -3
- package/lib/screenplay/interactions/SelectBuilder.js.map +0 -1
- package/lib/screenplay/interactions/Switch.d.ts +0 -210
- package/lib/screenplay/interactions/Switch.js +0 -345
- package/lib/screenplay/interactions/Switch.js.map +0 -1
- package/lib/screenplay/interactions/TakeScreenshot.d.ts +0 -67
- package/lib/screenplay/interactions/TakeScreenshot.js +0 -86
- package/lib/screenplay/interactions/TakeScreenshot.js.map +0 -1
- package/lib/screenplay/interactions/Wait.d.ts +0 -147
- package/lib/screenplay/interactions/Wait.js +0 -247
- package/lib/screenplay/interactions/Wait.js.map +0 -1
- package/lib/screenplay/interactions/WaitBuilder.d.ts +0 -33
- package/lib/screenplay/interactions/WaitBuilder.js +0 -3
- package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
- package/lib/screenplay/questions/Attribute.d.ts +0 -29
- package/lib/screenplay/questions/Attribute.js +0 -56
- package/lib/screenplay/questions/Attribute.js.map +0 -1
- package/lib/screenplay/questions/Browser.d.ts +0 -47
- package/lib/screenplay/questions/Browser.js +0 -55
- package/lib/screenplay/questions/Browser.js.map +0 -1
- package/lib/screenplay/questions/CSSClasses.d.ts +0 -94
- package/lib/screenplay/questions/CSSClasses.js +0 -118
- package/lib/screenplay/questions/CSSClasses.js.map +0 -1
- package/lib/screenplay/questions/Cookie.d.ts +0 -9
- package/lib/screenplay/questions/Cookie.js +0 -65
- package/lib/screenplay/questions/Cookie.js.map +0 -1
- package/lib/screenplay/questions/LastScriptExecution.d.ts +0 -14
- package/lib/screenplay/questions/LastScriptExecution.js +0 -22
- package/lib/screenplay/questions/LastScriptExecution.js.map +0 -1
- package/lib/screenplay/questions/ModalDialog.d.ts +0 -120
- package/lib/screenplay/questions/ModalDialog.js +0 -142
- package/lib/screenplay/questions/ModalDialog.js.map +0 -1
- package/lib/screenplay/questions/Pick.d.ts +0 -72
- package/lib/screenplay/questions/Pick.js +0 -254
- package/lib/screenplay/questions/Pick.js.map +0 -1
- package/lib/screenplay/questions/Selected.d.ts +0 -185
- package/lib/screenplay/questions/Selected.js +0 -254
- package/lib/screenplay/questions/Selected.js.map +0 -1
- package/lib/screenplay/questions/Value.d.ts +0 -47
- package/lib/screenplay/questions/Value.js +0 -67
- package/lib/screenplay/questions/Value.js.map +0 -1
- package/lib/screenplay/questions/Website.d.ts +0 -15
- package/lib/screenplay/questions/Website.js +0 -25
- package/lib/screenplay/questions/Website.js.map +0 -1
- package/lib/screenplay/questions/Window.d.ts +0 -23
- package/lib/screenplay/questions/Window.js +0 -28
- package/lib/screenplay/questions/Window.js.map +0 -1
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.d.ts +0 -89
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js +0 -138
- package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js.map +0 -1
- package/lib/screenplay/questions/lists/index.d.ts +0 -1
- package/lib/screenplay/questions/lists/index.js +0 -14
- package/lib/screenplay/questions/lists/index.js.map +0 -1
- package/lib/screenplay/questions/targets/Target.d.ts +0 -168
- package/lib/screenplay/questions/targets/Target.js +0 -190
- package/lib/screenplay/questions/targets/Target.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetElement.d.ts +0 -50
- package/lib/screenplay/questions/targets/TargetElement.js +0 -62
- package/lib/screenplay/questions/targets/TargetElement.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetElements.d.ts +0 -102
- package/lib/screenplay/questions/targets/TargetElements.js +0 -124
- package/lib/screenplay/questions/targets/TargetElements.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetNestedElement.d.ts +0 -49
- package/lib/screenplay/questions/targets/TargetNestedElement.js +0 -61
- package/lib/screenplay/questions/targets/TargetNestedElement.js.map +0 -1
- package/lib/screenplay/questions/targets/TargetNestedElements.d.ts +0 -101
- package/lib/screenplay/questions/targets/TargetNestedElements.js +0 -123
- package/lib/screenplay/questions/targets/TargetNestedElements.js.map +0 -1
- package/lib/screenplay/questions/targets/builders.d.ts +0 -8
- package/lib/screenplay/questions/targets/builders.js +0 -3
- package/lib/screenplay/questions/targets/builders.js.map +0 -1
- package/lib/screenplay/questions/targets/index.d.ts +0 -5
- package/lib/screenplay/questions/targets/index.js +0 -18
- package/lib/screenplay/questions/targets/index.js.map +0 -1
- package/lib/screenplay/questions/targets/override.d.ts +0 -7
- package/lib/screenplay/questions/targets/override.js +0 -21
- package/lib/screenplay/questions/targets/override.js.map +0 -1
- package/lib/screenplay/questions/text/Text.d.ts +0 -41
- package/lib/screenplay/questions/text/Text.js +0 -50
- package/lib/screenplay/questions/text/Text.js.map +0 -1
- package/lib/screenplay/questions/text/TextOfMultipleElements.d.ts +0 -23
- package/lib/screenplay/questions/text/TextOfMultipleElements.js +0 -37
- package/lib/screenplay/questions/text/TextOfMultipleElements.js.map +0 -1
- package/lib/screenplay/questions/text/TextOfSingleElement.d.ts +0 -23
- package/lib/screenplay/questions/text/TextOfSingleElement.js +0 -35
- package/lib/screenplay/questions/text/TextOfSingleElement.js.map +0 -1
- package/lib/screenplay/questions/text/index.d.ts +0 -1
- package/lib/screenplay/questions/text/index.js +0 -14
- package/lib/screenplay/questions/text/index.js.map +0 -1
- package/lib/screenplay/withAnswerOf.d.ts +0 -8
- package/lib/screenplay/withAnswerOf.js +0 -18
- package/lib/screenplay/withAnswerOf.js.map +0 -1
- package/lib/stage/crew/index.d.ts +0 -1
- package/lib/stage/crew/index.js +0 -14
- package/lib/stage/crew/index.js.map +0 -1
- package/lib/stage/crew/photographer/Photographer.d.ts +0 -83
- package/lib/stage/crew/photographer/Photographer.js +0 -102
- package/lib/stage/crew/photographer/Photographer.js.map +0 -1
- package/lib/stage/crew/photographer/index.d.ts +0 -2
- package/lib/stage/crew/photographer/index.js +0 -15
- package/lib/stage/crew/photographer/index.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +0 -28
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +0 -65
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +0 -18
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +0 -30
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +0 -17
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +0 -19
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/index.d.ts +0 -4
- package/lib/stage/crew/photographer/strategies/index.js +0 -17
- package/lib/stage/crew/photographer/strategies/index.js.map +0 -1
- package/lib/stage/index.d.ts +0 -1
- package/lib/stage/index.js +0 -14
- package/lib/stage/index.js.map +0 -1
- package/src/expectations/ElementFinderExpectation.ts +0 -29
- package/src/expectations/index.ts +0 -6
- package/src/expectations/isActive.ts +0 -24
- package/src/expectations/isClickable.ts +0 -20
- package/src/expectations/isEnabled.ts +0 -18
- package/src/expectations/isPresent.ts +0 -19
- package/src/expectations/isSelected.ts +0 -23
- package/src/expectations/isVisible.ts +0 -27
- package/src/screenplay/interactions/Accept.ts +0 -95
- package/src/screenplay/interactions/Clear.ts +0 -130
- package/src/screenplay/interactions/Click.ts +0 -96
- package/src/screenplay/interactions/Close.ts +0 -184
- package/src/screenplay/interactions/DeleteCookies.ts +0 -154
- package/src/screenplay/interactions/Dismiss.ts +0 -99
- package/src/screenplay/interactions/DoubleClick.ts +0 -124
- package/src/screenplay/interactions/Enter.ts +0 -104
- package/src/screenplay/interactions/EnterBuilder.ts +0 -29
- package/src/screenplay/interactions/ExecuteScript.ts +0 -325
- package/src/screenplay/interactions/Hover.ts +0 -106
- package/src/screenplay/interactions/Navigate.ts +0 -363
- package/src/screenplay/interactions/Press.ts +0 -137
- package/src/screenplay/interactions/PressBuilder.ts +0 -29
- package/src/screenplay/interactions/ResizeBrowserWindow.ts +0 -148
- package/src/screenplay/interactions/RightClick.ts +0 -114
- package/src/screenplay/interactions/Scroll.ts +0 -99
- package/src/screenplay/interactions/Select.ts +0 -402
- package/src/screenplay/interactions/SelectBuilder.ts +0 -35
- package/src/screenplay/interactions/Switch.ts +0 -393
- package/src/screenplay/interactions/TakeScreenshot.ts +0 -89
- package/src/screenplay/interactions/Wait.ts +0 -267
- package/src/screenplay/interactions/WaitBuilder.ts +0 -35
- package/src/screenplay/questions/Attribute.ts +0 -67
- package/src/screenplay/questions/Browser.ts +0 -55
- package/src/screenplay/questions/CSSClasses.ts +0 -121
- package/src/screenplay/questions/Cookie.ts +0 -70
- package/src/screenplay/questions/LastScriptExecution.ts +0 -21
- package/src/screenplay/questions/ModalDialog.ts +0 -149
- package/src/screenplay/questions/Pick.ts +0 -334
- package/src/screenplay/questions/Selected.ts +0 -268
- package/src/screenplay/questions/Value.ts +0 -73
- package/src/screenplay/questions/Website.ts +0 -27
- package/src/screenplay/questions/Window.ts +0 -29
- package/src/screenplay/questions/lists/ElementArrayFinderListAdapter.ts +0 -158
- package/src/screenplay/questions/lists/index.ts +0 -1
- package/src/screenplay/questions/targets/Target.ts +0 -198
- package/src/screenplay/questions/targets/TargetElement.ts +0 -70
- package/src/screenplay/questions/targets/TargetElements.ts +0 -142
- package/src/screenplay/questions/targets/TargetNestedElement.ts +0 -71
- package/src/screenplay/questions/targets/TargetNestedElements.ts +0 -142
- package/src/screenplay/questions/targets/builders.ts +0 -10
- package/src/screenplay/questions/targets/index.ts +0 -5
- package/src/screenplay/questions/targets/override.ts +0 -17
- package/src/screenplay/questions/text/Text.ts +0 -55
- package/src/screenplay/questions/text/TextOfMultipleElements.ts +0 -40
- package/src/screenplay/questions/text/TextOfSingleElement.ts +0 -37
- package/src/screenplay/questions/text/index.ts +0 -1
- package/src/screenplay/withAnswerOf.ts +0 -19
- package/src/stage/crew/index.ts +0 -1
- package/src/stage/crew/photographer/Photographer.ts +0 -108
- package/src/stage/crew/photographer/index.ts +0 -2
- package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +0 -102
- package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +0 -28
- package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +0 -26
- package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +0 -26
- package/src/stage/crew/photographer/strategies/index.ts +0 -4
- package/src/stage/index.ts +0 -1
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Select = void 0;
|
|
4
|
-
const io_1 = require("@serenity-js/core/lib/io");
|
|
5
|
-
const inspected_1 = require("@serenity-js/core/lib/io/inspected");
|
|
6
|
-
const protractor_1 = require("protractor");
|
|
7
|
-
const promiseOf_1 = require("../../promiseOf");
|
|
8
|
-
const questions_1 = require("../questions");
|
|
9
|
-
const withAnswerOf_1 = require("../withAnswerOf");
|
|
10
|
-
/**
|
|
11
|
-
* @desc
|
|
12
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
13
|
-
* select an option from a [HTML `<select>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select),
|
|
14
|
-
* either by its display name, or by value.
|
|
15
|
-
*
|
|
16
|
-
* @see {@link Selected}
|
|
17
|
-
*/
|
|
18
|
-
class Select {
|
|
19
|
-
/**
|
|
20
|
-
* @desc
|
|
21
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
22
|
-
* with a [`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#attr-value)
|
|
23
|
-
* of a single [`<option>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
24
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select.
|
|
25
|
-
*
|
|
26
|
-
* @example <caption>Example widget</caption>
|
|
27
|
-
* <select data-test='countries'>
|
|
28
|
-
* <option value='UK'>United Kingdom</option>
|
|
29
|
-
* <option value='PL'>Poland</option>
|
|
30
|
-
* <option value='US'>United States</option>
|
|
31
|
-
* </select>
|
|
32
|
-
*
|
|
33
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
34
|
-
* import { Target } from '@serenity-js/protractor';
|
|
35
|
-
* import { browser, by } from 'protractor';
|
|
36
|
-
*
|
|
37
|
-
* class Countries {
|
|
38
|
-
* static dropdown = Target.the('countries dropdown')
|
|
39
|
-
* .located(by.css('[data-test="countries"]'));
|
|
40
|
-
* }
|
|
41
|
-
*
|
|
42
|
-
* @example <caption>Retrieving the selected value</caption>
|
|
43
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
44
|
-
* import { BrowseTheWeb, Select, Selected } from '@serenity-js/protractor';
|
|
45
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
46
|
-
* import { protractor } from 'protractor';
|
|
47
|
-
*
|
|
48
|
-
* actorCalled('Nick')
|
|
49
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
50
|
-
* .attemptsTo(
|
|
51
|
-
* Select.value('UK').from(Countries.dropdown),
|
|
52
|
-
* Ensure.that(Selected.valueOf(Countries.dropdown), equals('UK')),
|
|
53
|
-
* );
|
|
54
|
-
*
|
|
55
|
-
* @param {string | Answerable<string>} value
|
|
56
|
-
* A value of the [`option` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
57
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select
|
|
58
|
-
*
|
|
59
|
-
* @returns {SelectBuilder}
|
|
60
|
-
*
|
|
61
|
-
* @see {@link Selected.valueOf}
|
|
62
|
-
* @see {@link BrowseTheWeb}
|
|
63
|
-
* @see {@link Target}
|
|
64
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
65
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
66
|
-
*/
|
|
67
|
-
static value(value) {
|
|
68
|
-
return {
|
|
69
|
-
from: (target) => new SelectValue(value, target)
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* @desc
|
|
74
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
75
|
-
* with [`value`s](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#attr-value)
|
|
76
|
-
* of multiple [`<option>` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
77
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select.
|
|
78
|
-
*
|
|
79
|
-
* @example <caption>Example widget</caption>
|
|
80
|
-
* <select multiple data-test='countries'>
|
|
81
|
-
* <option value='UK'>United Kingdom</option>
|
|
82
|
-
* <option value='PL'>Poland</option>
|
|
83
|
-
* <option value='US'>United States</option>
|
|
84
|
-
* </select>
|
|
85
|
-
*
|
|
86
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
87
|
-
* import { Target } from '@serenity-js/protractor';
|
|
88
|
-
* import { browser, by } from 'protractor';
|
|
89
|
-
*
|
|
90
|
-
* class Countries {
|
|
91
|
-
* static dropdown = Target.the('countries dropdown')
|
|
92
|
-
* .located(by.css('[data-test="countries"]'));
|
|
93
|
-
* }
|
|
94
|
-
*
|
|
95
|
-
* @example <caption>Retrieving the selected value</caption>
|
|
96
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
97
|
-
* import { BrowseTheWeb, Select, Selected } from '@serenity-js/protractor';
|
|
98
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
99
|
-
* import { protractor } from 'protractor';
|
|
100
|
-
*
|
|
101
|
-
* actorCalled('Nick')
|
|
102
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
103
|
-
* .attemptsTo(
|
|
104
|
-
* Select.values('UK').from(Countries.dropdown),
|
|
105
|
-
* Ensure.that(Selected.valuesOf(Countries.dropdown), equals([ 'UK' ])),
|
|
106
|
-
* );
|
|
107
|
-
*
|
|
108
|
-
* @param {Array<Answerable<string[] | string>>} values
|
|
109
|
-
* Values of the [`option` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
110
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select
|
|
111
|
-
*
|
|
112
|
-
* @returns {SelectBuilder}
|
|
113
|
-
*
|
|
114
|
-
* @see {@link Selected.valuesOf}
|
|
115
|
-
* @see {@link BrowseTheWeb}
|
|
116
|
-
* @see {@link Target}
|
|
117
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
118
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
119
|
-
*/
|
|
120
|
-
static values(...values) {
|
|
121
|
-
return {
|
|
122
|
-
from: (target) => new SelectValues(values, target)
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* @desc
|
|
127
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
128
|
-
* with a single [`option`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
129
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select.
|
|
130
|
-
*
|
|
131
|
-
* @example <caption>Example widget</caption>
|
|
132
|
-
* <select data-test='countries'>
|
|
133
|
-
* <option value='UK'>United Kingdom</option>
|
|
134
|
-
* <option value='PL'>Poland</option>
|
|
135
|
-
* <option value='US'>United States</option>
|
|
136
|
-
* </select>
|
|
137
|
-
*
|
|
138
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
139
|
-
* import { Target } from '@serenity-js/protractor';
|
|
140
|
-
* import { browser, by } from 'protractor';
|
|
141
|
-
*
|
|
142
|
-
* class Countries {
|
|
143
|
-
* static dropdown = Target.the('countries dropdown')
|
|
144
|
-
* .located(by.css('[data-test="countries"]'));
|
|
145
|
-
* }
|
|
146
|
-
*
|
|
147
|
-
* @example <caption>Retrieving the selected value</caption>
|
|
148
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
149
|
-
* import { BrowseTheWeb, Select, Selected } from '@serenity-js/protractor';
|
|
150
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
151
|
-
* import { protractor } from 'protractor';
|
|
152
|
-
*
|
|
153
|
-
* actorCalled('Nick')
|
|
154
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
155
|
-
* .attemptsTo(
|
|
156
|
-
* Select.option('Poland').from(Countries.dropdown),
|
|
157
|
-
* Ensure.that(
|
|
158
|
-
* Selected.optionIn(Countries.dropdown),
|
|
159
|
-
* equals('Poland')
|
|
160
|
-
* ),
|
|
161
|
-
* );
|
|
162
|
-
*
|
|
163
|
-
* @param {string | Answerable<string>} value
|
|
164
|
-
* Text of the [`option` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
165
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select
|
|
166
|
-
*
|
|
167
|
-
* @returns {SelectBuilder}
|
|
168
|
-
*
|
|
169
|
-
* @see {@link Selected.optionIn}
|
|
170
|
-
* @see {@link BrowseTheWeb}
|
|
171
|
-
* @see {@link Target}
|
|
172
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
173
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
174
|
-
*/
|
|
175
|
-
static option(value) {
|
|
176
|
-
return {
|
|
177
|
-
from: (target) => new SelectOption(value, target)
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* @desc
|
|
182
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
183
|
-
* with [`option`s](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
184
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select.
|
|
185
|
-
*
|
|
186
|
-
* @example <caption>Example widget</caption>
|
|
187
|
-
* <select multiple data-test='countries'>
|
|
188
|
-
* <option value='UK'>United Kingdom</option>
|
|
189
|
-
* <option value='PL'>Poland</option>
|
|
190
|
-
* <option value='US'>United States</option>
|
|
191
|
-
* </select>
|
|
192
|
-
*
|
|
193
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
194
|
-
* import { Target } from '@serenity-js/protractor';
|
|
195
|
-
* import { browser, by } from 'protractor';
|
|
196
|
-
*
|
|
197
|
-
* class Countries {
|
|
198
|
-
* static dropdown = Target.the('countries dropdown')
|
|
199
|
-
* .located(by.css('[data-test="countries"]'));
|
|
200
|
-
* }
|
|
201
|
-
*
|
|
202
|
-
* @example <caption>Retrieving the selected value</caption>
|
|
203
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
204
|
-
* import { BrowseTheWeb, Select, Selected } from '@serenity-js/protractor';
|
|
205
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
206
|
-
* import { protractor } from 'protractor';
|
|
207
|
-
*
|
|
208
|
-
* actorCalled('Nick')
|
|
209
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
210
|
-
* .attemptsTo(
|
|
211
|
-
* Select.options('Poland', 'United States').from(Countries.dropdown),
|
|
212
|
-
* Ensure.that(
|
|
213
|
-
* Selected.optionsIn(Countries.dropdown),
|
|
214
|
-
* equals([ 'Poland', 'United States' ])
|
|
215
|
-
* ),
|
|
216
|
-
* );
|
|
217
|
-
*
|
|
218
|
-
* @param {Array<Answerable<string[] | string>>} values
|
|
219
|
-
* Text of the [`option` elements ](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option)
|
|
220
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor} to select
|
|
221
|
-
*
|
|
222
|
-
* @returns {SelectBuilder}
|
|
223
|
-
*
|
|
224
|
-
* @see {@link Selected.optionsIn}
|
|
225
|
-
* @see {@link BrowseTheWeb}
|
|
226
|
-
* @see {@link Target}
|
|
227
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
228
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
229
|
-
*/
|
|
230
|
-
static options(...values) {
|
|
231
|
-
return {
|
|
232
|
-
from: (target) => new SelectOptions(values, target)
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
exports.Select = Select;
|
|
237
|
-
/**
|
|
238
|
-
* @package
|
|
239
|
-
*/
|
|
240
|
-
class SelectValue {
|
|
241
|
-
constructor(value, target) {
|
|
242
|
-
this.value = value;
|
|
243
|
-
this.target = target;
|
|
244
|
-
}
|
|
245
|
-
performAs(actor) {
|
|
246
|
-
return actor.answer(this.value)
|
|
247
|
-
.then(value => (0, withAnswerOf_1.withAnswerOf)(actor, this.target, (element) => element
|
|
248
|
-
.element(protractor_1.by.css(`option[value=${value}]`)))
|
|
249
|
-
.click());
|
|
250
|
-
}
|
|
251
|
-
toString() {
|
|
252
|
-
return (0, io_1.formatted) `#actor selects value ${this.value} from ${this.target}`;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* @package
|
|
257
|
-
*/
|
|
258
|
-
class SelectValues {
|
|
259
|
-
constructor(values, target) {
|
|
260
|
-
this.values = values;
|
|
261
|
-
this.target = target;
|
|
262
|
-
}
|
|
263
|
-
performAs(actor) {
|
|
264
|
-
return Promise.all(this.values.map(value => actor.answer(value)))
|
|
265
|
-
.then(flatten)
|
|
266
|
-
.then(values => {
|
|
267
|
-
const hasRequiredValue = (option) => questions_1.Value.of(option).answeredBy(actor).then(value => !!~values.indexOf(value));
|
|
268
|
-
return (0, promiseOf_1.promiseOf)((0, withAnswerOf_1.withAnswerOf)(actor, this.target, (element) => element.all(protractor_1.by.css('option'))
|
|
269
|
-
.filter(optionsToSelect(hasRequiredValue))
|
|
270
|
-
.each(select)));
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
toString() {
|
|
274
|
-
return `#actor selects values ${(0, io_1.commaSeparated)(flatten(this.values), inspected_1.inspected)} from ${this.target}`;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* @package
|
|
279
|
-
*/
|
|
280
|
-
class SelectOption {
|
|
281
|
-
constructor(value, target) {
|
|
282
|
-
this.value = value;
|
|
283
|
-
this.target = target;
|
|
284
|
-
}
|
|
285
|
-
performAs(actor) {
|
|
286
|
-
return actor.answer(this.value)
|
|
287
|
-
.then(value => {
|
|
288
|
-
return (0, promiseOf_1.promiseOf)((0, withAnswerOf_1.withAnswerOf)(actor, this.target, (element) => element
|
|
289
|
-
.element(protractor_1.by.cssContainingText('option', value)))
|
|
290
|
-
.click());
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
toString() {
|
|
294
|
-
return (0, io_1.formatted) `#actor selects ${this.value} from ${this.target}`;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* @package
|
|
299
|
-
*/
|
|
300
|
-
class SelectOptions {
|
|
301
|
-
constructor(values, target) {
|
|
302
|
-
this.values = values;
|
|
303
|
-
this.target = target;
|
|
304
|
-
}
|
|
305
|
-
performAs(actor) {
|
|
306
|
-
return Promise.all(this.values.map(value => actor.answer(value)))
|
|
307
|
-
.then(flatten)
|
|
308
|
-
.then(values => {
|
|
309
|
-
const hasRequiredText = (option) => option.getText().then(value => !!~values.indexOf(value));
|
|
310
|
-
return (0, promiseOf_1.promiseOf)((0, withAnswerOf_1.withAnswerOf)(actor, this.target, (element) => element.all(protractor_1.by.css('option'))
|
|
311
|
-
.filter(optionsToSelect(hasRequiredText))
|
|
312
|
-
.each(select)));
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
toString() {
|
|
316
|
-
return `#actor selects ${(0, io_1.commaSeparated)(flatten(this.values), inspected_1.inspected)} from ${this.target}`;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
/** @package */
|
|
320
|
-
function flatten(listOfLists) {
|
|
321
|
-
return listOfLists
|
|
322
|
-
.map(item => [].concat(item))
|
|
323
|
-
.reduce((acc, list) => acc.concat(list), []);
|
|
324
|
-
}
|
|
325
|
-
/** @package */
|
|
326
|
-
function optionsToSelect(criterion) {
|
|
327
|
-
return (option) => isAlreadySelected(option)
|
|
328
|
-
.then(alreadySelected => criterion(option).then(criterionMet => xor(alreadySelected, criterionMet)));
|
|
329
|
-
}
|
|
330
|
-
/** @package */
|
|
331
|
-
function select(option) {
|
|
332
|
-
return option.click();
|
|
333
|
-
}
|
|
334
|
-
/** @package */
|
|
335
|
-
function isAlreadySelected(option) {
|
|
336
|
-
return option.isSelected();
|
|
337
|
-
}
|
|
338
|
-
/** @package */
|
|
339
|
-
function xor(first, second) {
|
|
340
|
-
return first !== second;
|
|
341
|
-
}
|
|
342
|
-
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Select.ts"],"names":[],"mappings":";;;AACA,iDAAqE;AACrE,kEAA+D;AAE/D,2CAA+C;AAG/C,+CAA4C;AAC5C,4CAAqC;AACrC,kDAA+C;AAG/C;;;;;;;GAOG;AACH,MAAa,MAAM;IAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,MAAM,CAAC,KAAK,CAAC,KAAkC;QAC3C,OAAO;YACH,IAAI,EAAE,CAAC,MAA+C,EAAe,EAAE,CACnE,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;SACrC,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Question } from '@serenity-js/core';
|
|
2
|
-
import { Interaction } from '@serenity-js/core/lib/screenplay';
|
|
3
|
-
import { ElementFinder } from 'protractor';
|
|
4
|
-
/**
|
|
5
|
-
* @desc
|
|
6
|
-
* Configures the {@link Target} representing
|
|
7
|
-
* a [HTML `<select>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select)
|
|
8
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
9
|
-
* to interact with.
|
|
10
|
-
*
|
|
11
|
-
* @interface
|
|
12
|
-
*/
|
|
13
|
-
export interface SelectBuilder {
|
|
14
|
-
/**
|
|
15
|
-
* @desc
|
|
16
|
-
* Configures the {@link Target} representing
|
|
17
|
-
* a [HTML `<select>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select)
|
|
18
|
-
* for the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
19
|
-
* to interact with
|
|
20
|
-
*
|
|
21
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
22
|
-
*
|
|
23
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
24
|
-
*
|
|
25
|
-
* @see {@link Select}
|
|
26
|
-
* @see {@link Select.option}
|
|
27
|
-
* @see {@link Select.options}
|
|
28
|
-
* @see {@link Select.value}
|
|
29
|
-
* @see {@link Select.values}
|
|
30
|
-
* @see {@link Target}
|
|
31
|
-
*/
|
|
32
|
-
from: (target: Question<ElementFinder> | ElementFinder) => Interaction;
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectBuilder.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/SelectBuilder.ts"],"names":[],"mappings":""}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { Activity, Answerable, AnswersQuestions, Interaction, Task, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { ElementFinder } from 'protractor';
|
|
3
|
-
/**
|
|
4
|
-
* @desc
|
|
5
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
6
|
-
* to switch to a different [frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/frame),
|
|
7
|
-
* [inline frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe),
|
|
8
|
-
* or browser window/tab.
|
|
9
|
-
*
|
|
10
|
-
* @example <caption>Lean Page Object describing a login form, embedded in an iframe</caption>
|
|
11
|
-
*
|
|
12
|
-
* import { Target } from '@serenity-js/protractor';
|
|
13
|
-
* import { by } from 'protractor';
|
|
14
|
-
*
|
|
15
|
-
* class LoginForm {
|
|
16
|
-
* static iframe = Target.the('login form').located(by.tagName('iframe'));
|
|
17
|
-
* static usernameField = Target.the('username field').located(by.css('[data-test="username"]'));
|
|
18
|
-
* static passwordField = Target.the('password field').located(by.css('[data-test="password"]'));
|
|
19
|
-
* static submitButton = Target.the('submit button').located(by.css(`button[type='submit']`));
|
|
20
|
-
* }
|
|
21
|
-
*
|
|
22
|
-
* @example <caption>Switch to an iframe and back</caption>
|
|
23
|
-
*
|
|
24
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
25
|
-
* import { BrowseTheWeb, Switch, Enter, Click } from '@serenity-js/protractor';
|
|
26
|
-
* import { protractor } from 'protractor';
|
|
27
|
-
*
|
|
28
|
-
* actorCalled('Francesca')
|
|
29
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
30
|
-
* .attemptsTo(
|
|
31
|
-
* Switch.toFrame(LoginForm.iframe),
|
|
32
|
-
*
|
|
33
|
-
* Enter.theValue('francesca@example.org').into(LoginForm.usernameField),
|
|
34
|
-
* Enter.theValue('correct-horse-battery-staple').into(LoginForm.passwordField),
|
|
35
|
-
* Click.on(LoginForm.submitButton),
|
|
36
|
-
*
|
|
37
|
-
* Switch.toParentFrame(),
|
|
38
|
-
* );
|
|
39
|
-
*
|
|
40
|
-
* @example <caption>Perform activities in the context of an iframe</caption>
|
|
41
|
-
*
|
|
42
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
43
|
-
* import { BrowseTheWeb, Switch, Enter, Click } from '@serenity-js/protractor';
|
|
44
|
-
* import { protractor } from 'protractor';
|
|
45
|
-
*
|
|
46
|
-
* actorCalled('Francesca')
|
|
47
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
48
|
-
* .attemptsTo(
|
|
49
|
-
* Switch.toFrame(LoginForm.iframe).and(
|
|
50
|
-
* Enter.theValue('francesca@example.org').into(LoginForm.usernameField),
|
|
51
|
-
* Enter.theValue('correct-horse-battery-staple').into(LoginForm.passwordField),
|
|
52
|
-
* Click.on(LoginForm.submitButton),
|
|
53
|
-
* ),
|
|
54
|
-
* // Note that Switch.toParentFrame() is invoked automatically
|
|
55
|
-
* );
|
|
56
|
-
*
|
|
57
|
-
* @example <caption>Switch to a new window/tab and back</caption>
|
|
58
|
-
*
|
|
59
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
60
|
-
* import { BrowseTheWeb, Switch, Close } from '@serenity-js/protractor';
|
|
61
|
-
* import { protractor } from 'protractor';
|
|
62
|
-
*
|
|
63
|
-
* actorCalled('Francesca')
|
|
64
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
65
|
-
* .attemptsTo(
|
|
66
|
-
* Switch.toNewWindow(), // or: Switch.toWindow(...)
|
|
67
|
-
*
|
|
68
|
-
* // perform some activities in the context of the new window
|
|
69
|
-
*
|
|
70
|
-
* Close.currentWindow(),
|
|
71
|
-
*
|
|
72
|
-
* Switch.toOriginalWindow(),
|
|
73
|
-
* );
|
|
74
|
-
*
|
|
75
|
-
* @example <caption>Perform activities in the context of a different window/tab</caption>
|
|
76
|
-
*
|
|
77
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
78
|
-
* import { BrowseTheWeb, Switch, Close } from '@serenity-js/protractor';
|
|
79
|
-
* import { protractor } from 'protractor';
|
|
80
|
-
*
|
|
81
|
-
* actorCalled('Francesca')
|
|
82
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
83
|
-
* .attemptsTo(
|
|
84
|
-
* Switch.toNewWindow().and(
|
|
85
|
-
* // perform some activities in the context of the new window
|
|
86
|
-
*
|
|
87
|
-
* Close.currentWindow()
|
|
88
|
-
* ),
|
|
89
|
-
*
|
|
90
|
-
* // Note that Switch.toOriginalWindow() is invoked automatically
|
|
91
|
-
* );
|
|
92
|
-
*
|
|
93
|
-
* @see {@link Close}
|
|
94
|
-
* @see {@link BrowseTheWeb}
|
|
95
|
-
*/
|
|
96
|
-
export declare class Switch {
|
|
97
|
-
/**
|
|
98
|
-
* @desc
|
|
99
|
-
* Switches the current [browsing context](https://w3c.github.io/webdriver/#dfn-current-browsing-context)
|
|
100
|
-
* for future commands to a [frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/frame)
|
|
101
|
-
* or an [inline frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)
|
|
102
|
-
* identified by its name, index or `Question<ElementFinder>`.
|
|
103
|
-
*
|
|
104
|
-
* @param {Answerable<ElementFinder | number | string>} targetOrIndex
|
|
105
|
-
*
|
|
106
|
-
* @returns {SwitchToFrame}
|
|
107
|
-
*
|
|
108
|
-
* @see {@link Switch.toParentFrame}
|
|
109
|
-
* @see {@link Switch.toDefaultContent}
|
|
110
|
-
* @see {@link Target}
|
|
111
|
-
*/
|
|
112
|
-
static toFrame(targetOrIndex: Answerable<ElementFinder | number | string>): SwitchToFrame;
|
|
113
|
-
/**
|
|
114
|
-
* @desc
|
|
115
|
-
* Sets the current [browsing context](https://w3c.github.io/webdriver/#dfn-current-browsing-context)
|
|
116
|
-
* for future commands to the parent of the current browsing context,
|
|
117
|
-
* i.e. an `iframe` in which the current `iframe` is nested.
|
|
118
|
-
*
|
|
119
|
-
* If the current context is the top-level browsing context, the context remains unchanged.
|
|
120
|
-
*
|
|
121
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
122
|
-
*
|
|
123
|
-
* @see {@link Switch.toFrame}
|
|
124
|
-
* @see https://w3c.github.io/webdriver/#switch-to-parent-frame
|
|
125
|
-
* @see https://w3c.github.io/webdriver/#dfn-current-browsing-context
|
|
126
|
-
*/
|
|
127
|
-
static toParentFrame(): Interaction;
|
|
128
|
-
/**
|
|
129
|
-
* @desc
|
|
130
|
-
* Switches the current [browsing context](https://w3c.github.io/webdriver/#dfn-current-browsing-context)
|
|
131
|
-
* for future commands to the first frame on the page, or the main document
|
|
132
|
-
* when a page contains [`iframe`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)s.
|
|
133
|
-
*
|
|
134
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
135
|
-
*
|
|
136
|
-
* @see {@link Switch.toFrame}
|
|
137
|
-
*/
|
|
138
|
-
static toDefaultContent(): Interaction;
|
|
139
|
-
/**
|
|
140
|
-
* @desc
|
|
141
|
-
* Switches the current [browsing context](https://w3c.github.io/webdriver/#dfn-current-browsing-context)
|
|
142
|
-
* for future commands to a browser tab/window identified by its
|
|
143
|
-
* name, index or [window handle](https://developer.mozilla.org/en-US/docs/Web/WebDriver/Commands/GetWindowHandles).
|
|
144
|
-
*
|
|
145
|
-
* @param {Answerable<string | number>} nameOrHandleOrIndex
|
|
146
|
-
* @returns {SwitchToWindow}
|
|
147
|
-
*/
|
|
148
|
-
static toWindow(nameOrHandleOrIndex: Answerable<string | number>): SwitchToWindow;
|
|
149
|
-
/**
|
|
150
|
-
* @desc
|
|
151
|
-
* Switches the current [browsing context](https://w3c.github.io/webdriver/#dfn-current-browsing-context)
|
|
152
|
-
* for future commands to the most recently opened browser tab/window.
|
|
153
|
-
*
|
|
154
|
-
* **Please note** that this behaviour might vary in some browsers if there are more than two windows opened
|
|
155
|
-
* at the same time.
|
|
156
|
-
*
|
|
157
|
-
* @returns {SwitchToNewWindow}
|
|
158
|
-
*/
|
|
159
|
-
static toNewWindow(): SwitchToNewWindow;
|
|
160
|
-
/**
|
|
161
|
-
* @desc
|
|
162
|
-
* Switches the current [browsing context](https://w3c.github.io/webdriver/#dfn-current-browsing-context)
|
|
163
|
-
* for future commands to the original window used when the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
164
|
-
* performed an interaction to {@link Navigate}.
|
|
165
|
-
*
|
|
166
|
-
* **Please note** that this behaviour might vary in some browsers if there are more than two windows opened
|
|
167
|
-
* at the same time, as window handles might be ordered alphabetically instead of the order in which they were created.
|
|
168
|
-
*
|
|
169
|
-
* @returns {SwitchToOriginalWindow}
|
|
170
|
-
*/
|
|
171
|
-
static toOriginalWindow(): SwitchToOriginalWindow;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* @package
|
|
175
|
-
*/
|
|
176
|
-
declare class SwitchToFrame extends Interaction {
|
|
177
|
-
private readonly targetOrIndex;
|
|
178
|
-
constructor(targetOrIndex: Answerable<ElementFinder | number | string>);
|
|
179
|
-
and(...activities: Activity[]): Task;
|
|
180
|
-
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
|
|
181
|
-
toString(): string;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* @package
|
|
185
|
-
*/
|
|
186
|
-
declare class SwitchToWindow extends Interaction {
|
|
187
|
-
private readonly nameOrHandleOrIndex;
|
|
188
|
-
constructor(nameOrHandleOrIndex: Answerable<string | number>);
|
|
189
|
-
and(...activities: Activity[]): Task;
|
|
190
|
-
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
|
|
191
|
-
toString(): string;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* @package
|
|
195
|
-
*/
|
|
196
|
-
declare class SwitchToNewWindow extends Interaction {
|
|
197
|
-
constructor();
|
|
198
|
-
and(...activities: Activity[]): Task;
|
|
199
|
-
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
|
|
200
|
-
toString(): string;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* @package
|
|
204
|
-
*/
|
|
205
|
-
declare class SwitchToOriginalWindow extends Interaction {
|
|
206
|
-
constructor();
|
|
207
|
-
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
|
|
208
|
-
toString(): string;
|
|
209
|
-
}
|
|
210
|
-
export {};
|