@serenity-js/webdriverio 2.32.5 → 3.0.0-rc.3
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 +81 -0
- package/lib/adapter/WebdriverIOFrameworkAdapter.js +1 -1
- package/lib/adapter/WebdriverIOFrameworkAdapter.js.map +1 -1
- package/lib/adapter/WebdriverIONotifier.d.ts +35 -1
- package/lib/adapter/WebdriverIONotifier.js +174 -13
- package/lib/adapter/WebdriverIONotifier.js.map +1 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/lib/screenplay/abilities/{BrowseTheWeb.d.ts → BrowseTheWebWithWebdriverIO.d.ts} +53 -23
- package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithWebdriverIO.js} +122 -25
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.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 -2
- package/lib/screenplay/index.js +1 -2
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOCookie.d.ts +8 -0
- package/lib/screenplay/models/WebdriverIOCookie.js +39 -0
- package/lib/screenplay/models/WebdriverIOCookie.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOModalDialog.d.ts +11 -0
- package/lib/screenplay/models/WebdriverIOModalDialog.js +40 -0
- package/lib/screenplay/models/WebdriverIOModalDialog.js.map +1 -0
- package/lib/screenplay/models/WebdriverIONativeElementLocator.d.ts +27 -0
- package/lib/screenplay/models/WebdriverIONativeElementLocator.js +56 -0
- package/lib/screenplay/models/WebdriverIONativeElementLocator.js.map +1 -0
- package/lib/screenplay/models/WebdriverIONativeElementRoot.d.ts +2 -0
- package/lib/screenplay/{interactions/EnterBuilder.js → models/WebdriverIONativeElementRoot.js} +1 -1
- package/lib/screenplay/models/WebdriverIONativeElementRoot.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOPage.d.ts +24 -0
- package/lib/screenplay/models/WebdriverIOPage.js +98 -0
- package/lib/screenplay/models/WebdriverIOPage.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOPageElement.d.ts +31 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js +114 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +6 -0
- package/lib/{input → screenplay/models}/index.js +6 -1
- package/lib/screenplay/models/index.js.map +1 -0
- package/package.json +15 -25
- package/src/adapter/WebdriverIOFrameworkAdapter.ts +2 -0
- package/src/adapter/WebdriverIONotifier.ts +225 -23
- package/src/index.ts +0 -3
- package/src/screenplay/abilities/{BrowseTheWeb.ts → BrowseTheWebWithWebdriverIO.ts} +152 -31
- package/src/screenplay/abilities/index.ts +1 -1
- package/src/screenplay/index.ts +1 -2
- package/src/screenplay/models/WebdriverIOCookie.ts +44 -0
- package/src/screenplay/models/WebdriverIOModalDialog.ts +45 -0
- package/src/screenplay/models/WebdriverIONativeElementLocator.ts +78 -0
- package/src/screenplay/models/WebdriverIONativeElementRoot.ts +3 -0
- package/src/screenplay/models/WebdriverIOPage.ts +120 -0
- package/src/screenplay/models/WebdriverIOPageElement.ts +145 -0
- package/src/screenplay/models/index.ts +6 -0
- package/lib/expectations/ElementExpectation.d.ts +0 -11
- package/lib/expectations/ElementExpectation.js +0 -27
- package/lib/expectations/ElementExpectation.js.map +0 -1
- package/lib/expectations/index.d.ts +0 -6
- package/lib/expectations/index.js +0 -19
- package/lib/expectations/index.js.map +0 -1
- package/lib/expectations/isActive.d.ts +0 -15
- package/lib/expectations/isActive.js +0 -21
- package/lib/expectations/isActive.js.map +0 -1
- package/lib/expectations/isClickable.d.ts +0 -20
- package/lib/expectations/isClickable.js +0 -26
- package/lib/expectations/isClickable.js.map +0 -1
- package/lib/expectations/isEnabled.d.ts +0 -14
- package/lib/expectations/isEnabled.js +0 -20
- package/lib/expectations/isEnabled.js.map +0 -1
- package/lib/expectations/isPresent.d.ts +0 -15
- package/lib/expectations/isPresent.js +0 -21
- package/lib/expectations/isPresent.js.map +0 -1
- package/lib/expectations/isSelected.d.ts +0 -14
- package/lib/expectations/isSelected.js +0 -20
- package/lib/expectations/isSelected.js.map +0 -1
- package/lib/expectations/isVisible.d.ts +0 -14
- package/lib/expectations/isVisible.js +0 -20
- package/lib/expectations/isVisible.js.map +0 -1
- package/lib/input/Key.d.ts +0 -73
- package/lib/input/Key.js +0 -84
- package/lib/input/Key.js.map +0 -1
- package/lib/input/index.d.ts +0 -1
- package/lib/input/index.js.map +0 -1
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +0 -1
- package/lib/screenplay/interactions/Clear.d.ts +0 -79
- package/lib/screenplay/interactions/Clear.js +0 -97
- package/lib/screenplay/interactions/Clear.js.map +0 -1
- package/lib/screenplay/interactions/Click.d.ts +0 -73
- package/lib/screenplay/interactions/Click.js +0 -84
- package/lib/screenplay/interactions/Click.js.map +0 -1
- package/lib/screenplay/interactions/DoubleClick.d.ts +0 -90
- package/lib/screenplay/interactions/DoubleClick.js +0 -101
- package/lib/screenplay/interactions/DoubleClick.js.map +0 -1
- package/lib/screenplay/interactions/Enter.d.ts +0 -73
- package/lib/screenplay/interactions/Enter.js +0 -87
- package/lib/screenplay/interactions/Enter.js.map +0 -1
- package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -25
- package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ExecuteScript.d.ts +0 -206
- package/lib/screenplay/interactions/ExecuteScript.js +0 -311
- package/lib/screenplay/interactions/ExecuteScript.js.map +0 -1
- package/lib/screenplay/interactions/Hover.d.ts +0 -78
- package/lib/screenplay/interactions/Hover.js +0 -89
- package/lib/screenplay/interactions/Hover.js.map +0 -1
- package/lib/screenplay/interactions/Navigate.d.ts +0 -141
- package/lib/screenplay/interactions/Navigate.js +0 -197
- package/lib/screenplay/interactions/Navigate.js.map +0 -1
- package/lib/screenplay/interactions/Press.d.ts +0 -84
- package/lib/screenplay/interactions/Press.js +0 -152
- package/lib/screenplay/interactions/Press.js.map +0 -1
- package/lib/screenplay/interactions/PressBuilder.d.ts +0 -26
- package/lib/screenplay/interactions/PressBuilder.js +0 -3
- package/lib/screenplay/interactions/PressBuilder.js.map +0 -1
- package/lib/screenplay/interactions/RightClick.d.ts +0 -89
- package/lib/screenplay/interactions/RightClick.js +0 -100
- package/lib/screenplay/interactions/RightClick.js.map +0 -1
- package/lib/screenplay/interactions/Scroll.d.ts +0 -75
- package/lib/screenplay/interactions/Scroll.js +0 -86
- package/lib/screenplay/interactions/Scroll.js.map +0 -1
- package/lib/screenplay/interactions/Wait.d.ts +0 -143
- 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 -32
- package/lib/screenplay/interactions/WaitBuilder.js +0 -3
- package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
- package/lib/screenplay/interactions/WebElementInteraction.d.ts +0 -37
- package/lib/screenplay/interactions/WebElementInteraction.js +0 -52
- package/lib/screenplay/interactions/WebElementInteraction.js.map +0 -1
- package/lib/screenplay/interactions/index.d.ts +0 -13
- package/lib/screenplay/interactions/index.js +0 -26
- package/lib/screenplay/interactions/index.js.map +0 -1
- package/lib/screenplay/questions/Attribute.d.ts +0 -82
- package/lib/screenplay/questions/Attribute.js +0 -102
- package/lib/screenplay/questions/Attribute.js.map +0 -1
- package/lib/screenplay/questions/CSSClasses.d.ts +0 -92
- package/lib/screenplay/questions/CSSClasses.js +0 -112
- package/lib/screenplay/questions/CSSClasses.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/NestedTargetBuilder.d.ts +0 -27
- package/lib/screenplay/questions/NestedTargetBuilder.js +0 -3
- package/lib/screenplay/questions/NestedTargetBuilder.js.map +0 -1
- package/lib/screenplay/questions/TargetBuilder.d.ts +0 -25
- package/lib/screenplay/questions/TargetBuilder.js +0 -3
- package/lib/screenplay/questions/TargetBuilder.js.map +0 -1
- package/lib/screenplay/questions/Text.d.ts +0 -95
- package/lib/screenplay/questions/Text.js +0 -130
- package/lib/screenplay/questions/Text.js.map +0 -1
- package/lib/screenplay/questions/Value.d.ts +0 -63
- package/lib/screenplay/questions/Value.js +0 -78
- package/lib/screenplay/questions/Value.js.map +0 -1
- package/lib/screenplay/questions/Website.d.ts +0 -21
- package/lib/screenplay/questions/Website.js +0 -31
- package/lib/screenplay/questions/Website.js.map +0 -1
- package/lib/screenplay/questions/index.d.ts +0 -10
- package/lib/screenplay/questions/index.js +0 -23
- package/lib/screenplay/questions/index.js.map +0 -1
- package/lib/screenplay/questions/lists.d.ts +0 -86
- package/lib/screenplay/questions/lists.js +0 -137
- package/lib/screenplay/questions/lists.js.map +0 -1
- package/lib/screenplay/questions/locators.d.ts +0 -196
- package/lib/screenplay/questions/locators.js +0 -219
- package/lib/screenplay/questions/locators.js.map +0 -1
- package/lib/screenplay/questions/targets.d.ts +0 -254
- package/lib/screenplay/questions/targets.js +0 -334
- package/lib/screenplay/questions/targets.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/ElementExpectation.ts +0 -31
- package/src/expectations/index.ts +0 -6
- package/src/expectations/isActive.ts +0 -21
- package/src/expectations/isClickable.ts +0 -26
- package/src/expectations/isEnabled.ts +0 -19
- package/src/expectations/isPresent.ts +0 -20
- package/src/expectations/isSelected.ts +0 -19
- package/src/expectations/isVisible.ts +0 -19
- package/src/input/Key.ts +0 -83
- package/src/input/index.ts +0 -1
- package/src/screenplay/interactions/Clear.ts +0 -102
- package/src/screenplay/interactions/Click.ts +0 -85
- package/src/screenplay/interactions/DoubleClick.ts +0 -102
- package/src/screenplay/interactions/Enter.ts +0 -93
- package/src/screenplay/interactions/EnterBuilder.ts +0 -27
- package/src/screenplay/interactions/ExecuteScript.ts +0 -344
- package/src/screenplay/interactions/Hover.ts +0 -90
- package/src/screenplay/interactions/Navigate.ts +0 -208
- package/src/screenplay/interactions/Press.ts +0 -172
- package/src/screenplay/interactions/PressBuilder.ts +0 -28
- package/src/screenplay/interactions/RightClick.ts +0 -100
- package/src/screenplay/interactions/Scroll.ts +0 -87
- package/src/screenplay/interactions/Wait.ts +0 -267
- package/src/screenplay/interactions/WaitBuilder.ts +0 -34
- package/src/screenplay/interactions/WebElementInteraction.ts +0 -56
- package/src/screenplay/interactions/index.ts +0 -13
- package/src/screenplay/questions/Attribute.ts +0 -112
- package/src/screenplay/questions/CSSClasses.ts +0 -116
- package/src/screenplay/questions/LastScriptExecution.ts +0 -21
- package/src/screenplay/questions/NestedTargetBuilder.ts +0 -30
- package/src/screenplay/questions/TargetBuilder.ts +0 -27
- package/src/screenplay/questions/Text.ts +0 -140
- package/src/screenplay/questions/Value.ts +0 -82
- package/src/screenplay/questions/Website.ts +0 -34
- package/src/screenplay/questions/index.ts +0 -10
- package/src/screenplay/questions/lists.ts +0 -161
- package/src/screenplay/questions/locators.ts +0 -254
- package/src/screenplay/questions/targets.ts +0 -401
- 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 -103
- 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,78 +0,0 @@
|
|
|
1
|
-
import { Answerable, AnswersQuestions, Interaction, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
import { WebElementInteraction } from './WebElementInteraction';
|
|
4
|
-
/**
|
|
5
|
-
* @desc
|
|
6
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
7
|
-
* hover the mouse pointer over a given Web element.
|
|
8
|
-
*
|
|
9
|
-
* @example <caption>Example widget</caption>
|
|
10
|
-
* <a data-test="example-link"
|
|
11
|
-
* class="off"
|
|
12
|
-
* onmouseover="this.className='on';"
|
|
13
|
-
* onmouseout="this.className='off';"
|
|
14
|
-
* href="/">hover over me</a>
|
|
15
|
-
*
|
|
16
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
17
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
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/webdriverio';
|
|
27
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
28
|
-
*
|
|
29
|
-
* actorCalled('Hank')
|
|
30
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
31
|
-
* .attemptsTo(
|
|
32
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'off' ])),
|
|
33
|
-
*
|
|
34
|
-
* Hover.over(Example.link),
|
|
35
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'on' ])),
|
|
36
|
-
* );
|
|
37
|
-
*
|
|
38
|
-
* @see {@link BrowseTheWeb}
|
|
39
|
-
* @see {@link Target}
|
|
40
|
-
* @see {@link CSSClasses}
|
|
41
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
42
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
43
|
-
*
|
|
44
|
-
* @extends {WebElementInteraction}
|
|
45
|
-
*/
|
|
46
|
-
export declare class Hover extends WebElementInteraction {
|
|
47
|
-
private readonly target;
|
|
48
|
-
/**
|
|
49
|
-
* @desc
|
|
50
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
51
|
-
*
|
|
52
|
-
* @param {Answerable<Element<'async'>>} target
|
|
53
|
-
* The element to be hovered over
|
|
54
|
-
*
|
|
55
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
56
|
-
*/
|
|
57
|
-
static over(target: Answerable<Element<'async'>>): Interaction;
|
|
58
|
-
/**
|
|
59
|
-
* @param {Answerable<Element<'async'>>} target
|
|
60
|
-
* The element to be hovered over
|
|
61
|
-
*/
|
|
62
|
-
constructor(target: Answerable<Element<'async'>>);
|
|
63
|
-
/**
|
|
64
|
-
* @desc
|
|
65
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
66
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
67
|
-
*
|
|
68
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
69
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
70
|
-
*
|
|
71
|
-
* @returns {PromiseLike<void>}
|
|
72
|
-
*
|
|
73
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
74
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
75
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
76
|
-
*/
|
|
77
|
-
performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
|
|
78
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hover = void 0;
|
|
4
|
-
const io_1 = require("@serenity-js/core/lib/io");
|
|
5
|
-
const WebElementInteraction_1 = require("./WebElementInteraction");
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
9
|
-
* hover the mouse pointer over a given Web element.
|
|
10
|
-
*
|
|
11
|
-
* @example <caption>Example widget</caption>
|
|
12
|
-
* <a data-test="example-link"
|
|
13
|
-
* class="off"
|
|
14
|
-
* onmouseover="this.className='on';"
|
|
15
|
-
* onmouseout="this.className='off';"
|
|
16
|
-
* href="/">hover over me</a>
|
|
17
|
-
*
|
|
18
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
19
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
20
|
-
*
|
|
21
|
-
* class Example {
|
|
22
|
-
* static link = Target.the('example link')
|
|
23
|
-
* .located(by.css('[data-test="example-link"]'));
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* @example <caption>Hovering over an element</caption>
|
|
27
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
28
|
-
* import { BrowseTheWeb, Hover, CSSClasses } from '@serenity-js/webdriverio';
|
|
29
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
30
|
-
*
|
|
31
|
-
* actorCalled('Hank')
|
|
32
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
33
|
-
* .attemptsTo(
|
|
34
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'off' ])),
|
|
35
|
-
*
|
|
36
|
-
* Hover.over(Example.link),
|
|
37
|
-
* Ensure.that(CSSClasses.of(Example.link), equals([ 'on' ])),
|
|
38
|
-
* );
|
|
39
|
-
*
|
|
40
|
-
* @see {@link BrowseTheWeb}
|
|
41
|
-
* @see {@link Target}
|
|
42
|
-
* @see {@link CSSClasses}
|
|
43
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
44
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
45
|
-
*
|
|
46
|
-
* @extends {WebElementInteraction}
|
|
47
|
-
*/
|
|
48
|
-
class Hover extends WebElementInteraction_1.WebElementInteraction {
|
|
49
|
-
/**
|
|
50
|
-
* @param {Answerable<Element<'async'>>} target
|
|
51
|
-
* The element to be hovered over
|
|
52
|
-
*/
|
|
53
|
-
constructor(target) {
|
|
54
|
-
super((0, io_1.formatted) `#actor hovers the mouse over ${target}`);
|
|
55
|
-
this.target = target;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* @desc
|
|
59
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
60
|
-
*
|
|
61
|
-
* @param {Answerable<Element<'async'>>} target
|
|
62
|
-
* The element to be hovered over
|
|
63
|
-
*
|
|
64
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
65
|
-
*/
|
|
66
|
-
static over(target) {
|
|
67
|
-
return new Hover(target);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @desc
|
|
71
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
72
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
73
|
-
*
|
|
74
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
75
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
76
|
-
*
|
|
77
|
-
* @returns {PromiseLike<void>}
|
|
78
|
-
*
|
|
79
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
80
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
81
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
82
|
-
*/
|
|
83
|
-
async performAs(actor) {
|
|
84
|
-
const element = await this.resolve(actor, this.target);
|
|
85
|
-
return element.moveTo();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.Hover = Hover;
|
|
89
|
-
//# sourceMappingURL=Hover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Hover.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Hover.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAGrD,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,KAAM,SAAQ,6CAAqB;IAe5C;;;OAGG;IACH,YAA6B,MAAoC;QAC7D,KAAK,CAAC,IAAA,cAAS,EAAC,gCAAiC,MAAO,EAAE,CAAC,CAAC;QADnC,WAAM,GAAN,MAAM,CAA8B;IAEjE,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,MAAoC;QAC5C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAUD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,SAAS,CAAC,KAAuC;QACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACJ;AAzCD,sBAyCC"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { Answerable, Interaction } from '@serenity-js/core';
|
|
2
|
-
/**
|
|
3
|
-
* @desc
|
|
4
|
-
* Allows the {@link @serenity-js/core/lib/screenplay/actor~Actor} to navigate
|
|
5
|
-
* to a specific destination, as well as back and forth in the browser history,
|
|
6
|
-
* or reload the current page.
|
|
7
|
-
*/
|
|
8
|
-
export declare class Navigate {
|
|
9
|
-
/**
|
|
10
|
-
* @desc
|
|
11
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
12
|
-
* to navigate to a given URL.
|
|
13
|
-
*
|
|
14
|
-
* The URL can be:
|
|
15
|
-
* - absolute, i.e. `https://example.org/search`
|
|
16
|
-
* - relative, i.e. `/search`
|
|
17
|
-
*
|
|
18
|
-
* If the URL is relative, WebdriverIO will append it to `baseUrl` specified in
|
|
19
|
-
* the [configuration file](https://webdriver.io/docs/configurationfile/).
|
|
20
|
-
*
|
|
21
|
-
* @example <caption>wdio.conf.ts</caption>
|
|
22
|
-
* export const config = {
|
|
23
|
-
* baseUrl: 'https://example.org',
|
|
24
|
-
* // ...
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
28
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
29
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/webdriverio';
|
|
30
|
-
*
|
|
31
|
-
* actorCalled('Hannu')
|
|
32
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
33
|
-
* .attemptsTo(
|
|
34
|
-
* Navigate.to('/search'),
|
|
35
|
-
* );
|
|
36
|
-
*
|
|
37
|
-
* @example <caption>Navigate to an absolute URL (overrides baseUrl)</caption>
|
|
38
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
39
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/webdriverio';
|
|
40
|
-
*
|
|
41
|
-
* actorCalled('Hannu')
|
|
42
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
43
|
-
* .attemptsTo(
|
|
44
|
-
* Navigate.to('https://mycompany.org/login'),
|
|
45
|
-
* );
|
|
46
|
-
*
|
|
47
|
-
* @param {Answerable<string>} url
|
|
48
|
-
* An absolute URL or path an {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
49
|
-
* should navigate to
|
|
50
|
-
*
|
|
51
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
52
|
-
*
|
|
53
|
-
* @see {@link BrowseTheWeb}
|
|
54
|
-
*/
|
|
55
|
-
static to(url: Answerable<string>): Interaction;
|
|
56
|
-
/**
|
|
57
|
-
* @desc
|
|
58
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
59
|
-
* navigate back one page in the joint session history of the current top-level browsing context.
|
|
60
|
-
*
|
|
61
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
62
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
63
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
64
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/webdriverio';
|
|
65
|
-
*
|
|
66
|
-
* actorCalled('Hannu')
|
|
67
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
68
|
-
* .attemptsTo(
|
|
69
|
-
* Navigate.to('/first'),
|
|
70
|
-
* Navigate.to('/second'),
|
|
71
|
-
*
|
|
72
|
-
* Navigate.back(),
|
|
73
|
-
*
|
|
74
|
-
* Ensure.that(Website.url(), endsWith('/first')),
|
|
75
|
-
* );
|
|
76
|
-
*
|
|
77
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
78
|
-
*
|
|
79
|
-
* @see https://webdriver.io/docs/api/webdriver/#back
|
|
80
|
-
* @see {@link BrowseTheWeb}
|
|
81
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
82
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
83
|
-
*/
|
|
84
|
-
static back(): Interaction;
|
|
85
|
-
/**
|
|
86
|
-
* @desc
|
|
87
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
88
|
-
* navigate forward one page in the session history.
|
|
89
|
-
*
|
|
90
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
91
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
92
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
93
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/webdriverio';
|
|
94
|
-
*
|
|
95
|
-
* actorCalled('Hannu')
|
|
96
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
97
|
-
* .attemptsTo(
|
|
98
|
-
* Navigate.to('/first'),
|
|
99
|
-
* Navigate.to('/second'),
|
|
100
|
-
*
|
|
101
|
-
* Navigate.back(),
|
|
102
|
-
* Navigate.forward(),
|
|
103
|
-
*
|
|
104
|
-
* Ensure.that(Website.url(), endsWith('/second')),
|
|
105
|
-
* );
|
|
106
|
-
*
|
|
107
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
108
|
-
*
|
|
109
|
-
* @see {@link BrowseTheWeb}
|
|
110
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
111
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
112
|
-
* @see https://webdriver.io/docs/api/webdriver/#forward
|
|
113
|
-
*/
|
|
114
|
-
static forward(): Interaction;
|
|
115
|
-
/**
|
|
116
|
-
* @desc
|
|
117
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
118
|
-
* reload the current page.
|
|
119
|
-
*
|
|
120
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
121
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
122
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
123
|
-
* import { Navigate, BrowseTheWeb, DeleteCookies } from '@serenity-js/webdriverio';
|
|
124
|
-
*
|
|
125
|
-
* actorCalled('Hannu')
|
|
126
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
127
|
-
* .attemptsTo(
|
|
128
|
-
* Navigate.to('/login'),
|
|
129
|
-
* DeleteCookies.called('session_id'),
|
|
130
|
-
* Navigate.reloadPage(),
|
|
131
|
-
* );
|
|
132
|
-
*
|
|
133
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
134
|
-
*
|
|
135
|
-
* @see {@link BrowseTheWeb}
|
|
136
|
-
* @see {@link DeleteCookies}
|
|
137
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
138
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
139
|
-
*/
|
|
140
|
-
static reloadPage(): Interaction;
|
|
141
|
-
}
|
|
@@ -1,197 +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 __1 = require("../");
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* Allows the {@link @serenity-js/core/lib/screenplay/actor~Actor} to navigate
|
|
10
|
-
* to a specific destination, as well as back and forth in the browser history,
|
|
11
|
-
* or reload the current page.
|
|
12
|
-
*/
|
|
13
|
-
class Navigate {
|
|
14
|
-
/**
|
|
15
|
-
* @desc
|
|
16
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
17
|
-
* to 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, WebdriverIO will append it to `baseUrl` specified in
|
|
24
|
-
* the [configuration file](https://webdriver.io/docs/configurationfile/).
|
|
25
|
-
*
|
|
26
|
-
* @example <caption>wdio.conf.ts</caption>
|
|
27
|
-
* export const config = {
|
|
28
|
-
* baseUrl: 'https://example.org',
|
|
29
|
-
* // ...
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
33
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
34
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/webdriverio';
|
|
35
|
-
*
|
|
36
|
-
* actorCalled('Hannu')
|
|
37
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
38
|
-
* .attemptsTo(
|
|
39
|
-
* Navigate.to('/search'),
|
|
40
|
-
* );
|
|
41
|
-
*
|
|
42
|
-
* @example <caption>Navigate to an absolute URL (overrides baseUrl)</caption>
|
|
43
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
44
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/webdriverio';
|
|
45
|
-
*
|
|
46
|
-
* actorCalled('Hannu')
|
|
47
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
48
|
-
* .attemptsTo(
|
|
49
|
-
* Navigate.to('https://mycompany.org/login'),
|
|
50
|
-
* );
|
|
51
|
-
*
|
|
52
|
-
* @param {Answerable<string>} url
|
|
53
|
-
* An absolute URL or path an {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
54
|
-
* should navigate to
|
|
55
|
-
*
|
|
56
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
57
|
-
*
|
|
58
|
-
* @see {@link BrowseTheWeb}
|
|
59
|
-
*/
|
|
60
|
-
static to(url) {
|
|
61
|
-
return new NavigateToUrl(url);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* @desc
|
|
65
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
66
|
-
* navigate back one page in the joint session history of the current top-level browsing context.
|
|
67
|
-
*
|
|
68
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
69
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
70
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
71
|
-
* import { BrowseTheWeb, Navigate } from '@serenity-js/webdriverio';
|
|
72
|
-
*
|
|
73
|
-
* actorCalled('Hannu')
|
|
74
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
75
|
-
* .attemptsTo(
|
|
76
|
-
* Navigate.to('/first'),
|
|
77
|
-
* Navigate.to('/second'),
|
|
78
|
-
*
|
|
79
|
-
* Navigate.back(),
|
|
80
|
-
*
|
|
81
|
-
* Ensure.that(Website.url(), endsWith('/first')),
|
|
82
|
-
* );
|
|
83
|
-
*
|
|
84
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
85
|
-
*
|
|
86
|
-
* @see https://webdriver.io/docs/api/webdriver/#back
|
|
87
|
-
* @see {@link BrowseTheWeb}
|
|
88
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
89
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
90
|
-
*/
|
|
91
|
-
static back() {
|
|
92
|
-
return core_1.Interaction.where(`#actor navigates back in the browser history`, actor => __1.BrowseTheWeb.as(actor).browser.back());
|
|
93
|
-
}
|
|
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/webdriverio';
|
|
103
|
-
*
|
|
104
|
-
* actorCalled('Hannu')
|
|
105
|
-
* .whoCan(BrowseTheWeb.using(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
|
-
* @see https://webdriver.io/docs/api/webdriver/#forward
|
|
122
|
-
*/
|
|
123
|
-
static forward() {
|
|
124
|
-
return core_1.Interaction.where(`#actor navigates forward in the browser history`, actor => __1.BrowseTheWeb.as(actor).browser.forward());
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* @desc
|
|
128
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
129
|
-
* reload the current page.
|
|
130
|
-
*
|
|
131
|
-
* @example <caption>Navigate to path relative to baseUrl</caption>
|
|
132
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
133
|
-
* import { Ensure, endsWith } from '@serenity-js/assertions';
|
|
134
|
-
* import { Navigate, BrowseTheWeb, DeleteCookies } from '@serenity-js/webdriverio';
|
|
135
|
-
*
|
|
136
|
-
* actorCalled('Hannu')
|
|
137
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
138
|
-
* .attemptsTo(
|
|
139
|
-
* Navigate.to('/login'),
|
|
140
|
-
* DeleteCookies.called('session_id'),
|
|
141
|
-
* Navigate.reloadPage(),
|
|
142
|
-
* );
|
|
143
|
-
*
|
|
144
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
145
|
-
*
|
|
146
|
-
* @see {@link BrowseTheWeb}
|
|
147
|
-
* @see {@link DeleteCookies}
|
|
148
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
149
|
-
* @see {@link @serenity-js/assertions/lib/expectations~endsWith}
|
|
150
|
-
*/
|
|
151
|
-
static reloadPage() {
|
|
152
|
-
return core_1.Interaction.where(`#actor reloads the page`, actor => __1.BrowseTheWeb.as(actor).browser.refresh());
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
exports.Navigate = Navigate;
|
|
156
|
-
/**
|
|
157
|
-
* @package
|
|
158
|
-
*/
|
|
159
|
-
class NavigateToUrl extends core_1.Interaction {
|
|
160
|
-
constructor(url) {
|
|
161
|
-
super();
|
|
162
|
-
this.url = url;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* @desc
|
|
166
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
167
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
168
|
-
*
|
|
169
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
170
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
171
|
-
* to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
172
|
-
*
|
|
173
|
-
* @returns {PromiseLike<void>}
|
|
174
|
-
*
|
|
175
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
176
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
177
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
178
|
-
*/
|
|
179
|
-
performAs(actor) {
|
|
180
|
-
return actor.answer(this.url)
|
|
181
|
-
.then(url => __1.BrowseTheWeb.as(actor)
|
|
182
|
-
.get(url)
|
|
183
|
-
.catch(error => {
|
|
184
|
-
throw new core_1.TestCompromisedError(`Couldn't navigate to ${url}`, error);
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* @desc
|
|
189
|
-
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
190
|
-
*
|
|
191
|
-
* @returns {string}
|
|
192
|
-
*/
|
|
193
|
-
toString() {
|
|
194
|
-
return (0, io_1.formatted) `#actor navigates to ${this.url}`;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
//# sourceMappingURL=Navigate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Navigate.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Navigate.ts"],"names":[],"mappings":";;;AAAA,4CAAmH;AACnH,iDAAqD;AAErD,2BAAmC;AAEnC;;;;;GAKG;AACH,MAAa,QAAQ;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,MAAM,CAAC,EAAE,CAAC,GAAuB;QAC7B,OAAO,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,IAAI;QACP,OAAO,kBAAW,CAAC,KAAK,CAAC,8CAA8C,EAAE,KAAK,CAAC,EAAE,CAC7E,gBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CACxC,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,OAAO;QACV,OAAO,kBAAW,CAAC,KAAK,CAAC,iDAAiD,EAAE,KAAK,CAAC,EAAE,CAChF,gBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAC3C,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,UAAU;QACb,OAAO,kBAAW,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,EAAE,CACxD,gBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAC3C,CAAC;IACN,CAAC;CACJ;AAvJD,4BAuJC;AAED;;GAEG;AACH,MAAM,aAAc,SAAQ,kBAAW;IACnC,YAA6B,GAAuB;QAChD,KAAK,EAAE,CAAC;QADiB,QAAG,GAAH,GAAG,CAAoB;IAEpD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,KAAuC;QAC7C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;aACxB,IAAI,CAAC,GAAG,CAAC,EAAE,CACR,gBAAY,CAAC,EAAE,CAAC,KAAK,CAAC;aACjB,GAAG,CAAC,GAAG,CAAC;aACR,KAAK,CAAC,KAAK,CAAC,EAAE;YACX,MAAM,IAAI,2BAAoB,CAAC,wBAAyB,GAAI,EAAE,EAAE,KAAK,CAAC,CAAC;QAC3E,CAAC,CAAC,CACT,CAAA;IACT,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACJ,OAAO,IAAA,cAAS,EAAC,uBAAwB,IAAI,CAAC,GAAI,EAAE,CAAC;IACzD,CAAC;CACJ"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { Activity, Answerable, AnswersQuestions, Interaction, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
import { Key } from '../../input';
|
|
4
|
-
import { PressBuilder } from './PressBuilder';
|
|
5
|
-
import { WebElementInteraction } from './WebElementInteraction';
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
9
|
-
* send a key press or a sequence of keys to a Web element.
|
|
10
|
-
*
|
|
11
|
-
* *Please note*: On macOS, some keyboard shortcuts might not work with the [`devtools` protocol](https://webdriver.io/docs/automationProtocols/#devtools-protocol).
|
|
12
|
-
*
|
|
13
|
-
* For example:
|
|
14
|
-
* - to *copy*, instead of `Meta+C`, use `Control+Insert`
|
|
15
|
-
* - to *cut*, instead of `Meta+X`, use `Control+Delete`
|
|
16
|
-
* - to *paste*, instead of `Meta+V`, use `Shift+Insert`
|
|
17
|
-
*
|
|
18
|
-
* @example <caption>Example widget</caption>
|
|
19
|
-
* <form>
|
|
20
|
-
* <input type="text" name="example" id="example" />
|
|
21
|
-
* </form>
|
|
22
|
-
*
|
|
23
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
24
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
25
|
-
*
|
|
26
|
-
* class Form {
|
|
27
|
-
* static exampleInput = Target.the('example input')
|
|
28
|
-
* .located(by.id('example'));
|
|
29
|
-
* }
|
|
30
|
-
*
|
|
31
|
-
* @example <caption>Pressing keys</caption>
|
|
32
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
33
|
-
* import { BrowseTheWeb, Key, Press, Value } from '@serenity-js/webdriverio';
|
|
34
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
35
|
-
*
|
|
36
|
-
* actorCalled('Priyanka')
|
|
37
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
38
|
-
* .attemptsTo(
|
|
39
|
-
* Press.the('H', 'i', '!', Key.ENTER).in(Form.exampleInput),
|
|
40
|
-
* Ensure.that(Value.of(Form.exampleInput), equals('Hi!')),
|
|
41
|
-
* );
|
|
42
|
-
*
|
|
43
|
-
* @see {@link Key}
|
|
44
|
-
* @see {@link BrowseTheWeb}
|
|
45
|
-
* @see {@link Target}
|
|
46
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
47
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
48
|
-
*
|
|
49
|
-
* @extends {WebElementInteraction}
|
|
50
|
-
*/
|
|
51
|
-
export declare class Press extends WebElementInteraction {
|
|
52
|
-
private readonly keys;
|
|
53
|
-
/**
|
|
54
|
-
* @desc
|
|
55
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
56
|
-
*
|
|
57
|
-
* @param {...keys: Array<Answerable<Key | string | Key[] | string[]>>} keys
|
|
58
|
-
* A sequence of one or more keys to press
|
|
59
|
-
*
|
|
60
|
-
* @returns {PressBuilder}
|
|
61
|
-
*/
|
|
62
|
-
static the(...keys: Array<Answerable<Key | string | Key[] | string[]>>): Activity & PressBuilder;
|
|
63
|
-
in(field: Answerable<Element<'async'>>): Interaction;
|
|
64
|
-
/**
|
|
65
|
-
* @param {Answerable<Array<Key | string>>} keys
|
|
66
|
-
* A sequence of one or more keys to press
|
|
67
|
-
*/
|
|
68
|
-
constructor(keys: Answerable<Array<Key | string>>);
|
|
69
|
-
/**
|
|
70
|
-
* @desc
|
|
71
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
72
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
73
|
-
*
|
|
74
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
75
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
76
|
-
*
|
|
77
|
-
* @returns {PromiseLike<void>}
|
|
78
|
-
*
|
|
79
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
80
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
81
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
82
|
-
*/
|
|
83
|
-
performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
|
|
84
|
-
}
|