@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,86 +0,0 @@
|
|
|
1
|
-
import { AnswersQuestions, Interaction, Question, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { ElementFinder } from 'protractor';
|
|
3
|
-
/**
|
|
4
|
-
* @desc
|
|
5
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
6
|
-
* hover the mouse pointer over a given Web element.
|
|
7
|
-
*
|
|
8
|
-
* @example <caption>Example widget</caption>
|
|
9
|
-
* <a data-test="example-link"
|
|
10
|
-
* class="off"
|
|
11
|
-
* onmouseover="this.className='on';"
|
|
12
|
-
* onmouseout="this.className='off';"
|
|
13
|
-
* href="/">hover over me</a>
|
|
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 Example {
|
|
20
|
-
* static link = Target.the('example link')
|
|
21
|
-
* .located(by.css('[data-test="example-link"]'));
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* @example <caption>Hovering over an element</caption>
|
|
25
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
26
|
-
* import { BrowseTheWeb, Hover, CSSClasses } from '@serenity-js/protractor';
|
|
27
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
28
|
-
* import { protractor } from 'protractor';
|
|
29
|
-
*
|
|
30
|
-
* actorCalled('Hank')
|
|
31
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
32
|
-
* .attemptsTo(
|
|
33
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'off' ])),
|
|
34
|
-
*
|
|
35
|
-
* Hover.over(Example.link),
|
|
36
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'on' ])),
|
|
37
|
-
* );
|
|
38
|
-
*
|
|
39
|
-
* @see {@link BrowseTheWeb}
|
|
40
|
-
* @see {@link Target}
|
|
41
|
-
* @see {@link CSSClasses}
|
|
42
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
43
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
44
|
-
*
|
|
45
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
46
|
-
*/
|
|
47
|
-
export declare class Hover extends Interaction {
|
|
48
|
-
private readonly target;
|
|
49
|
-
/**
|
|
50
|
-
* @desc
|
|
51
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
52
|
-
*
|
|
53
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
54
|
-
* The element to be hovered over
|
|
55
|
-
*
|
|
56
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
57
|
-
*/
|
|
58
|
-
static over(target: Question<ElementFinder> | ElementFinder): Interaction;
|
|
59
|
-
/**
|
|
60
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
61
|
-
* The element to be hovered over
|
|
62
|
-
*/
|
|
63
|
-
constructor(target: Question<ElementFinder> | ElementFinder);
|
|
64
|
-
/**
|
|
65
|
-
* @desc
|
|
66
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
67
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
68
|
-
*
|
|
69
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
70
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
71
|
-
*
|
|
72
|
-
* @returns {PromiseLike<void>}
|
|
73
|
-
*
|
|
74
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
75
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
76
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
77
|
-
*/
|
|
78
|
-
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
|
|
79
|
-
/**
|
|
80
|
-
* @desc
|
|
81
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
82
|
-
*
|
|
83
|
-
* @returns {string}
|
|
84
|
-
*/
|
|
85
|
-
toString(): string;
|
|
86
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hover = 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
|
-
* hover the mouse pointer over a given Web element.
|
|
12
|
-
*
|
|
13
|
-
* @example <caption>Example widget</caption>
|
|
14
|
-
* <a data-test="example-link"
|
|
15
|
-
* class="off"
|
|
16
|
-
* onmouseover="this.className='on';"
|
|
17
|
-
* onmouseout="this.className='off';"
|
|
18
|
-
* href="/">hover over me</a>
|
|
19
|
-
*
|
|
20
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
21
|
-
* import { Target } from '@serenity-js/protractor';
|
|
22
|
-
* import { by } from 'protractor';
|
|
23
|
-
*
|
|
24
|
-
* class Example {
|
|
25
|
-
* static link = Target.the('example link')
|
|
26
|
-
* .located(by.css('[data-test="example-link"]'));
|
|
27
|
-
* }
|
|
28
|
-
*
|
|
29
|
-
* @example <caption>Hovering over an element</caption>
|
|
30
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
31
|
-
* import { BrowseTheWeb, Hover, CSSClasses } from '@serenity-js/protractor';
|
|
32
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
33
|
-
* import { protractor } from 'protractor';
|
|
34
|
-
*
|
|
35
|
-
* actorCalled('Hank')
|
|
36
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
37
|
-
* .attemptsTo(
|
|
38
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'off' ])),
|
|
39
|
-
*
|
|
40
|
-
* Hover.over(Example.link),
|
|
41
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'on' ])),
|
|
42
|
-
* );
|
|
43
|
-
*
|
|
44
|
-
* @see {@link BrowseTheWeb}
|
|
45
|
-
* @see {@link Target}
|
|
46
|
-
* @see {@link CSSClasses}
|
|
47
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
48
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
49
|
-
*
|
|
50
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
51
|
-
*/
|
|
52
|
-
class Hover extends core_1.Interaction {
|
|
53
|
-
/**
|
|
54
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
55
|
-
* The element to be hovered over
|
|
56
|
-
*/
|
|
57
|
-
constructor(target) {
|
|
58
|
-
super();
|
|
59
|
-
this.target = target;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @desc
|
|
63
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
64
|
-
*
|
|
65
|
-
* @param {Question<ElementFinder> | ElementFinder} target
|
|
66
|
-
* The element to be hovered over
|
|
67
|
-
*
|
|
68
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
69
|
-
*/
|
|
70
|
-
static over(target) {
|
|
71
|
-
return new Hover(target);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* @desc
|
|
75
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
76
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
77
|
-
*
|
|
78
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
79
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
80
|
-
*
|
|
81
|
-
* @returns {PromiseLike<void>}
|
|
82
|
-
*
|
|
83
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
84
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
85
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
86
|
-
*/
|
|
87
|
-
performAs(actor) {
|
|
88
|
-
return (0, withAnswerOf_1.withAnswerOf)(actor, this.target, (elf) => abilities_1.BrowseTheWeb.as(actor).actions()
|
|
89
|
-
.mouseMove(elf)
|
|
90
|
-
.perform());
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @desc
|
|
94
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
95
|
-
*
|
|
96
|
-
* @returns {string}
|
|
97
|
-
*/
|
|
98
|
-
toString() {
|
|
99
|
-
return (0, io_1.formatted) `#actor hovers the mouse over ${this.target}`;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.Hover = Hover;
|
|
103
|
-
//# sourceMappingURL=Hover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Hover.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Hover.ts"],"names":[],"mappings":";;;AAAA,4CAA2F;AAC3F,iDAAqD;AAGrD,4CAA4C;AAC5C,kDAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAa,KAAM,SAAQ,kBAAW;IAelC;;;OAGG;IACH,YAA6B,MAA+C;QACxE,KAAK,EAAE,CAAC;QADiB,WAAM,GAAN,MAAM,CAAyC;IAE5E,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,MAA+C;QACvD,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAUD;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,KAAuC;QAC7C,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,GAAqB,CAAC;aAChC,OAAO,EAAE,CACjB,CAAC;IACN,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACJ,OAAO,IAAA,cAAS,EAAC,gCAAgC,IAAI,CAAC,MAAM,EAAE,CAAC;IACnE,CAAC;CACJ;AAtDD,sBAsDC"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { Answerable, Duration, Interaction } from '@serenity-js/core';
|
|
2
|
-
/**
|
|
3
|
-
* @desc
|
|
4
|
-
* Allows the {@link @serenity-js/core/lib/screenplay/actor~Actor} to navigate to a specific destination,
|
|
5
|
-
* as well as back and forth in the browser history, or reload the current page.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Navigate {
|
|
8
|
-
/**
|
|
9
|
-
* @desc
|
|
10
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
11
|
-
* navigate to a given URL.
|
|
12
|
-
*
|
|
13
|
-
* The URL can be:
|
|
14
|
-
* - absolute, i.e. `https://example.org/search`
|
|
15
|
-
* - relative, i.e. `/search`
|
|
16
|
-
*
|
|
17
|
-
* If the URL is relative, Protractor will append it to `baseUrl` configured in [`protractor.conf.js`](https://github.com/angular/protractor/blob/master/lib/config.ts).
|
|
18
|
-
*
|
|
19
|
-
* @example <caption>protractor.conf.js</caption>
|
|
20
|
-
* exports.config = {
|
|
21
|
-
* baseUrl: 'https://example.org',
|
|
22
|
-
* // ...
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
26
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
27
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
28
|
-
*
|
|
29
|
-
* actorCalled('Hannu')
|
|
30
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
31
|
-
* .attemptsTo(
|
|
32
|
-
* Navigate.to('/search'),
|
|
33
|
-
* );
|
|
34
|
-
*
|
|
35
|
-
* @example <caption>Navigate to an absolute URL (overrides baseUrl)</caption>
|
|
36
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
37
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
38
|
-
*
|
|
39
|
-
* actorCalled('Hannu')
|
|
40
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
41
|
-
* .attemptsTo(
|
|
42
|
-
* Navigate.to('https://mycompany.org/login'),
|
|
43
|
-
* );
|
|
44
|
-
*
|
|
45
|
-
* @example <caption>Navigate to URL with timeout</caption>
|
|
46
|
-
* import { actorCalled, Duration } from '@serenity-js/core';
|
|
47
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
48
|
-
*
|
|
49
|
-
* actorCalled('Hannu')
|
|
50
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
51
|
-
* .attemptsTo(
|
|
52
|
-
* Navigate.to('/search').withTimeout(Duration.ofSeconds(2)),
|
|
53
|
-
* );
|
|
54
|
-
*
|
|
55
|
-
* @param {Answerable<string>} url
|
|
56
|
-
* An absolute URL or path an {@link @serenity-js/core/lib/screenplay/actor~Actor} should navigate to
|
|
57
|
-
*
|
|
58
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction & { withTimeout: (duration: Answerable<Duration>) => Interaction }}
|
|
59
|
-
*
|
|
60
|
-
* @see {@link BrowseTheWeb}
|
|
61
|
-
* @see {@link @serenity-js/core~Duration}
|
|
62
|
-
*/
|
|
63
|
-
static to(url: Answerable<string>): Interaction & {
|
|
64
|
-
withTimeout: (duration: Answerable<Duration>) => Interaction;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* @desc
|
|
68
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
69
|
-
* navigate back one page in the session history.
|
|
70
|
-
*
|
|
71
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
72
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
73
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
74
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
75
|
-
*
|
|
76
|
-
* actorCalled('Hannu')
|
|
77
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
78
|
-
* .attemptsTo(
|
|
79
|
-
* Navigate.to('/first'),
|
|
80
|
-
* Navigate.to('/second'),
|
|
81
|
-
*
|
|
82
|
-
* Navigate.back(),
|
|
83
|
-
*
|
|
84
|
-
* Ensure.that(Website.url(), endsWith('/first')),
|
|
85
|
-
* );
|
|
86
|
-
*
|
|
87
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
88
|
-
*
|
|
89
|
-
* @see {@link BrowseTheWeb}
|
|
90
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
91
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
92
|
-
*/
|
|
93
|
-
static back(): Interaction;
|
|
94
|
-
/**
|
|
95
|
-
* @desc
|
|
96
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
97
|
-
* navigate forward one page in the session history.
|
|
98
|
-
*
|
|
99
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
100
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
101
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
102
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
103
|
-
*
|
|
104
|
-
* actorCalled('Hannu')
|
|
105
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
106
|
-
* .attemptsTo(
|
|
107
|
-
* Navigate.to('/first'),
|
|
108
|
-
* Navigate.to('/second'),
|
|
109
|
-
*
|
|
110
|
-
* Navigate.back(),
|
|
111
|
-
* Navigate.forward(),
|
|
112
|
-
*
|
|
113
|
-
* Ensure.that(Website.url(), endsWith('/second')),
|
|
114
|
-
* );
|
|
115
|
-
*
|
|
116
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
117
|
-
*
|
|
118
|
-
* @see {@link BrowseTheWeb}
|
|
119
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
120
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
121
|
-
*/
|
|
122
|
-
static forward(): Interaction;
|
|
123
|
-
/**
|
|
124
|
-
* @desc
|
|
125
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
126
|
-
* reload the current page.
|
|
127
|
-
*
|
|
128
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
129
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
130
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
131
|
-
* import { Navigate, BrowseTheWeb, DeleteCookies } from '@serenity-js/protractor';
|
|
132
|
-
*
|
|
133
|
-
* actorCalled('Hannu')
|
|
134
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
135
|
-
* .attemptsTo(
|
|
136
|
-
* Navigate.to('/login'),
|
|
137
|
-
* DeleteCookies.called('session_id'),
|
|
138
|
-
* Navigate.reloadPage(),
|
|
139
|
-
* );
|
|
140
|
-
*
|
|
141
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
142
|
-
*
|
|
143
|
-
* @see {@link BrowseTheWeb}
|
|
144
|
-
* @see {@link DeleteCookies}
|
|
145
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
146
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
147
|
-
*/
|
|
148
|
-
static reloadPage(): Interaction;
|
|
149
|
-
}
|
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Navigate = void 0;
|
|
4
|
-
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
|
-
const promiseOf_1 = require("../../promiseOf");
|
|
7
|
-
const abilities_1 = require("../abilities");
|
|
8
|
-
/**
|
|
9
|
-
* @desc
|
|
10
|
-
* Allows the {@link @serenity-js/core/lib/screenplay/actor~Actor} to navigate to a specific destination,
|
|
11
|
-
* as well as back and forth in the browser history, or reload the current page.
|
|
12
|
-
*/
|
|
13
|
-
class Navigate {
|
|
14
|
-
/**
|
|
15
|
-
* @desc
|
|
16
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
17
|
-
* navigate to a given URL.
|
|
18
|
-
*
|
|
19
|
-
* The URL can be:
|
|
20
|
-
* - absolute, i.e. `https://example.org/search`
|
|
21
|
-
* - relative, i.e. `/search`
|
|
22
|
-
*
|
|
23
|
-
* If the URL is relative, Protractor will append it to `baseUrl` configured in [`protractor.conf.js`](https://github.com/angular/protractor/blob/master/lib/config.ts).
|
|
24
|
-
*
|
|
25
|
-
* @example <caption>protractor.conf.js</caption>
|
|
26
|
-
* exports.config = {
|
|
27
|
-
* baseUrl: 'https://example.org',
|
|
28
|
-
* // ...
|
|
29
|
-
* }
|
|
30
|
-
*
|
|
31
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
32
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
33
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
34
|
-
*
|
|
35
|
-
* actorCalled('Hannu')
|
|
36
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
37
|
-
* .attemptsTo(
|
|
38
|
-
* Navigate.to('/search'),
|
|
39
|
-
* );
|
|
40
|
-
*
|
|
41
|
-
* @example <caption>Navigate to an absolute URL (overrides baseUrl)</caption>
|
|
42
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
43
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
44
|
-
*
|
|
45
|
-
* actorCalled('Hannu')
|
|
46
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
47
|
-
* .attemptsTo(
|
|
48
|
-
* Navigate.to('https://mycompany.org/login'),
|
|
49
|
-
* );
|
|
50
|
-
*
|
|
51
|
-
* @example <caption>Navigate to URL with timeout</caption>
|
|
52
|
-
* import { actorCalled, Duration } from '@serenity-js/core';
|
|
53
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
54
|
-
*
|
|
55
|
-
* actorCalled('Hannu')
|
|
56
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
57
|
-
* .attemptsTo(
|
|
58
|
-
* Navigate.to('/search').withTimeout(Duration.ofSeconds(2)),
|
|
59
|
-
* );
|
|
60
|
-
*
|
|
61
|
-
* @param {Answerable<string>} url
|
|
62
|
-
* An absolute URL or path an {@link @serenity-js/core/lib/screenplay/actor~Actor} should navigate to
|
|
63
|
-
*
|
|
64
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction & { withTimeout: (duration: Answerable<Duration>) => Interaction }}
|
|
65
|
-
*
|
|
66
|
-
* @see {@link BrowseTheWeb}
|
|
67
|
-
* @see {@link @serenity-js/core~Duration}
|
|
68
|
-
*/
|
|
69
|
-
static to(url) {
|
|
70
|
-
return new NavigateToUrl(url);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* @desc
|
|
74
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
75
|
-
* navigate back one page in the session history.
|
|
76
|
-
*
|
|
77
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
78
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
79
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
80
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
81
|
-
*
|
|
82
|
-
* actorCalled('Hannu')
|
|
83
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
84
|
-
* .attemptsTo(
|
|
85
|
-
* Navigate.to('/first'),
|
|
86
|
-
* Navigate.to('/second'),
|
|
87
|
-
*
|
|
88
|
-
* Navigate.back(),
|
|
89
|
-
*
|
|
90
|
-
* Ensure.that(Website.url(), endsWith('/first')),
|
|
91
|
-
* );
|
|
92
|
-
*
|
|
93
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
94
|
-
*
|
|
95
|
-
* @see {@link BrowseTheWeb}
|
|
96
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
97
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
98
|
-
*/
|
|
99
|
-
static back() {
|
|
100
|
-
return new NavigateBack();
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* @desc
|
|
104
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
105
|
-
* navigate forward one page in the session history.
|
|
106
|
-
*
|
|
107
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
108
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
109
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
110
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/protractor';
|
|
111
|
-
*
|
|
112
|
-
* actorCalled('Hannu')
|
|
113
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
114
|
-
* .attemptsTo(
|
|
115
|
-
* Navigate.to('/first'),
|
|
116
|
-
* Navigate.to('/second'),
|
|
117
|
-
*
|
|
118
|
-
* Navigate.back(),
|
|
119
|
-
* Navigate.forward(),
|
|
120
|
-
*
|
|
121
|
-
* Ensure.that(Website.url(), endsWith('/second')),
|
|
122
|
-
* );
|
|
123
|
-
*
|
|
124
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
125
|
-
*
|
|
126
|
-
* @see {@link BrowseTheWeb}
|
|
127
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
128
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
129
|
-
*/
|
|
130
|
-
static forward() {
|
|
131
|
-
return new NavigateForward();
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* @desc
|
|
135
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
136
|
-
* reload the current page.
|
|
137
|
-
*
|
|
138
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
139
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
140
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
141
|
-
* import { Navigate, BrowseTheWeb, DeleteCookies } from '@serenity-js/protractor';
|
|
142
|
-
*
|
|
143
|
-
* actorCalled('Hannu')
|
|
144
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
145
|
-
* .attemptsTo(
|
|
146
|
-
* Navigate.to('/login'),
|
|
147
|
-
* DeleteCookies.called('session_id'),
|
|
148
|
-
* Navigate.reloadPage(),
|
|
149
|
-
* );
|
|
150
|
-
*
|
|
151
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
152
|
-
*
|
|
153
|
-
* @see {@link BrowseTheWeb}
|
|
154
|
-
* @see {@link DeleteCookies}
|
|
155
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
156
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
157
|
-
*/
|
|
158
|
-
static reloadPage() {
|
|
159
|
-
return new ReloadPage();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
exports.Navigate = Navigate;
|
|
163
|
-
/**
|
|
164
|
-
* @package
|
|
165
|
-
*/
|
|
166
|
-
class NavigateToUrl extends core_1.Interaction {
|
|
167
|
-
constructor(url) {
|
|
168
|
-
super();
|
|
169
|
-
this.url = url;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* @desc
|
|
173
|
-
* Specifies timeout to wait for an Angular app to load.
|
|
174
|
-
* Please note that the timeout is ignored if you disable
|
|
175
|
-
* synchronisation with Angular.
|
|
176
|
-
*
|
|
177
|
-
* @param {Answerable<Duration>} duration
|
|
178
|
-
*/
|
|
179
|
-
withTimeout(duration) {
|
|
180
|
-
return new NavigateToUrlWithTimeout(this.url, duration);
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* @desc
|
|
184
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
185
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
186
|
-
*
|
|
187
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
188
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
189
|
-
*
|
|
190
|
-
* @returns {PromiseLike<void>}
|
|
191
|
-
*
|
|
192
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
193
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
194
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
195
|
-
*/
|
|
196
|
-
performAs(actor) {
|
|
197
|
-
return actor.answer(this.url)
|
|
198
|
-
.then(url => abilities_1.BrowseTheWeb.as(actor).get(url)
|
|
199
|
-
.catch(error => {
|
|
200
|
-
throw new core_1.TestCompromisedError(`Couldn't navigate to ${url}`, error);
|
|
201
|
-
}));
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* @desc
|
|
205
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
206
|
-
*
|
|
207
|
-
* @returns {string}
|
|
208
|
-
*/
|
|
209
|
-
toString() {
|
|
210
|
-
return (0, io_1.formatted) `#actor navigates to ${this.url}`;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* @package
|
|
215
|
-
*/
|
|
216
|
-
class NavigateToUrlWithTimeout extends core_1.Interaction {
|
|
217
|
-
constructor(url, timeout) {
|
|
218
|
-
super();
|
|
219
|
-
this.url = url;
|
|
220
|
-
this.timeout = timeout;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* @desc
|
|
224
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
225
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
226
|
-
*
|
|
227
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
228
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
229
|
-
*
|
|
230
|
-
* @returns {PromiseLike<void>}
|
|
231
|
-
*
|
|
232
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
233
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
234
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
235
|
-
*/
|
|
236
|
-
performAs(actor) {
|
|
237
|
-
return Promise.all([
|
|
238
|
-
actor.answer(this.url),
|
|
239
|
-
actor.answer(this.timeout),
|
|
240
|
-
]).then(([url, timeout]) => abilities_1.BrowseTheWeb.as(actor).get(url, timeout.inMilliseconds()));
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* @desc
|
|
244
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
245
|
-
*
|
|
246
|
-
* @returns {string}
|
|
247
|
-
*/
|
|
248
|
-
toString() {
|
|
249
|
-
return (0, io_1.formatted) `#actor navigates to ${this.url} waiting up to ${this.timeout} for Angular to load`;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* @package
|
|
254
|
-
*/
|
|
255
|
-
class NavigateBack extends core_1.Interaction {
|
|
256
|
-
/**
|
|
257
|
-
* @desc
|
|
258
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
259
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
260
|
-
*
|
|
261
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
262
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
263
|
-
*
|
|
264
|
-
* @returns {PromiseLike<void>}
|
|
265
|
-
*
|
|
266
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
267
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
268
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
269
|
-
*/
|
|
270
|
-
performAs(actor) {
|
|
271
|
-
return (0, promiseOf_1.promiseOf)(abilities_1.BrowseTheWeb.as(actor).navigate().back());
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* @desc
|
|
275
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
276
|
-
*
|
|
277
|
-
* @returns {string}
|
|
278
|
-
*/
|
|
279
|
-
toString() {
|
|
280
|
-
return (0, io_1.formatted) `#actor navigates back in the browser history`;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* @package
|
|
285
|
-
*/
|
|
286
|
-
class NavigateForward extends core_1.Interaction {
|
|
287
|
-
/**
|
|
288
|
-
* @desc
|
|
289
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
290
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
291
|
-
*
|
|
292
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
293
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
294
|
-
*
|
|
295
|
-
* @returns {PromiseLike<void>}
|
|
296
|
-
*
|
|
297
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
298
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
299
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
300
|
-
*/
|
|
301
|
-
performAs(actor) {
|
|
302
|
-
return (0, promiseOf_1.promiseOf)(abilities_1.BrowseTheWeb.as(actor).navigate().forward());
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* @desc
|
|
306
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
307
|
-
*
|
|
308
|
-
* @returns {string}
|
|
309
|
-
*/
|
|
310
|
-
toString() {
|
|
311
|
-
return (0, io_1.formatted) `#actor navigates forward in the browser history`;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* @package
|
|
316
|
-
*/
|
|
317
|
-
class ReloadPage extends core_1.Interaction {
|
|
318
|
-
/**
|
|
319
|
-
* @desc
|
|
320
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
321
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
322
|
-
*
|
|
323
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
324
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
325
|
-
*
|
|
326
|
-
* @returns {PromiseLike<void>}
|
|
327
|
-
*
|
|
328
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
329
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
330
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
331
|
-
*/
|
|
332
|
-
performAs(actor) {
|
|
333
|
-
return (0, promiseOf_1.promiseOf)(abilities_1.BrowseTheWeb.as(actor).navigate().refresh());
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* @desc
|
|
337
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
338
|
-
*
|
|
339
|
-
* @returns {string}
|
|
340
|
-
*/
|
|
341
|
-
toString() {
|
|
342
|
-
return (0, io_1.formatted) `#actor reloads the page`;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
//# sourceMappingURL=Navigate.js.map
|