@serenity-js/web 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 +50 -0
- package/LICENSE.md +201 -0
- package/NOTICE.md +1 -0
- package/README.md +21 -0
- package/lib/errors/CookieMissingError.d.ts +4 -0
- package/lib/errors/CookieMissingError.js +11 -0
- package/lib/errors/CookieMissingError.js.map +1 -0
- package/lib/errors/index.d.ts +1 -0
- package/lib/errors/index.js +14 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/expectations/ElementExpectation.d.ts +11 -0
- package/lib/expectations/ElementExpectation.js +27 -0
- package/lib/expectations/ElementExpectation.js.map +1 -0
- package/lib/expectations/index.d.ts +6 -0
- package/lib/expectations/index.js +19 -0
- package/lib/expectations/index.js.map +1 -0
- package/lib/expectations/isActive.d.ts +15 -0
- package/lib/expectations/isActive.js +22 -0
- package/lib/expectations/isActive.js.map +1 -0
- package/lib/expectations/isClickable.d.ts +20 -0
- package/lib/expectations/isClickable.js +30 -0
- package/lib/expectations/isClickable.js.map +1 -0
- package/lib/expectations/isEnabled.d.ts +14 -0
- package/lib/expectations/isEnabled.js +20 -0
- package/lib/expectations/isEnabled.js.map +1 -0
- package/lib/expectations/isPresent.d.ts +15 -0
- package/lib/expectations/isPresent.js +22 -0
- package/lib/expectations/isPresent.js.map +1 -0
- package/lib/expectations/isSelected.d.ts +14 -0
- package/lib/expectations/isSelected.js +23 -0
- package/lib/expectations/isSelected.js.map +1 -0
- package/lib/expectations/isVisible.d.ts +14 -0
- package/lib/expectations/isVisible.js +26 -0
- package/lib/expectations/isVisible.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/input/Key.d.ts +73 -0
- package/lib/input/Key.js +84 -0
- package/lib/input/Key.js.map +1 -0
- package/lib/input/index.d.ts +1 -0
- package/lib/input/index.js +14 -0
- package/lib/input/index.js.map +1 -0
- package/lib/screenplay/abilities/BrowseTheWeb.d.ts +58 -0
- package/lib/screenplay/abilities/BrowseTheWeb.js +19 -0
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +1 -0
- package/lib/screenplay/abilities/BrowserCapabilities.d.ts +5 -0
- package/lib/screenplay/abilities/BrowserCapabilities.js +3 -0
- package/lib/screenplay/abilities/BrowserCapabilities.js.map +1 -0
- package/lib/screenplay/abilities/index.d.ts +2 -0
- package/lib/screenplay/abilities/index.js +15 -0
- package/lib/screenplay/abilities/index.js.map +1 -0
- package/lib/screenplay/index.d.ts +4 -0
- package/lib/screenplay/index.js +17 -0
- package/lib/screenplay/index.js.map +1 -0
- package/lib/screenplay/interactions/Clear.d.ts +79 -0
- package/lib/screenplay/interactions/Clear.js +97 -0
- package/lib/screenplay/interactions/Clear.js.map +1 -0
- package/lib/screenplay/interactions/Click.d.ts +73 -0
- package/lib/screenplay/interactions/Click.js +85 -0
- package/lib/screenplay/interactions/Click.js.map +1 -0
- package/lib/screenplay/interactions/DoubleClick.d.ts +90 -0
- package/lib/screenplay/interactions/DoubleClick.js +101 -0
- package/lib/screenplay/interactions/DoubleClick.js.map +1 -0
- package/lib/screenplay/interactions/Enter.d.ts +73 -0
- package/lib/screenplay/interactions/Enter.js +86 -0
- package/lib/screenplay/interactions/Enter.js.map +1 -0
- package/lib/screenplay/interactions/EnterBuilder.d.ts +25 -0
- package/lib/screenplay/interactions/EnterBuilder.js +3 -0
- package/lib/screenplay/interactions/EnterBuilder.js.map +1 -0
- package/lib/screenplay/interactions/ExecuteScript.d.ts +206 -0
- package/lib/screenplay/interactions/ExecuteScript.js +312 -0
- package/lib/screenplay/interactions/ExecuteScript.js.map +1 -0
- package/lib/screenplay/interactions/Hover.d.ts +78 -0
- package/lib/screenplay/interactions/Hover.js +89 -0
- package/lib/screenplay/interactions/Hover.js.map +1 -0
- package/lib/screenplay/interactions/Navigate.d.ts +142 -0
- package/lib/screenplay/interactions/Navigate.js +198 -0
- package/lib/screenplay/interactions/Navigate.js.map +1 -0
- package/lib/screenplay/interactions/PageElementInteraction.d.ts +39 -0
- package/lib/screenplay/interactions/PageElementInteraction.js +54 -0
- package/lib/screenplay/interactions/PageElementInteraction.js.map +1 -0
- package/lib/screenplay/interactions/Press.d.ts +84 -0
- package/lib/screenplay/interactions/Press.js +171 -0
- package/lib/screenplay/interactions/Press.js.map +1 -0
- package/lib/screenplay/interactions/PressBuilder.d.ts +26 -0
- package/lib/screenplay/interactions/PressBuilder.js +3 -0
- package/lib/screenplay/interactions/PressBuilder.js.map +1 -0
- package/lib/screenplay/interactions/RightClick.d.ts +89 -0
- package/lib/screenplay/interactions/RightClick.js +100 -0
- package/lib/screenplay/interactions/RightClick.js.map +1 -0
- package/lib/screenplay/interactions/Scroll.d.ts +83 -0
- package/lib/screenplay/interactions/Scroll.js +97 -0
- package/lib/screenplay/interactions/Scroll.js.map +1 -0
- package/lib/screenplay/interactions/Select.d.ts +212 -0
- package/lib/screenplay/interactions/Select.js +291 -0
- package/lib/screenplay/interactions/Select.js.map +1 -0
- package/lib/screenplay/interactions/SelectBuilder.d.ts +33 -0
- package/lib/screenplay/interactions/SelectBuilder.js +3 -0
- package/lib/screenplay/interactions/SelectBuilder.js.map +1 -0
- package/lib/screenplay/interactions/Switch.d.ts +150 -0
- package/lib/screenplay/interactions/Switch.js +209 -0
- package/lib/screenplay/interactions/Switch.js.map +1 -0
- package/lib/screenplay/interactions/TakeScreenshot.d.ts +67 -0
- package/lib/screenplay/interactions/TakeScreenshot.js +86 -0
- package/lib/screenplay/interactions/TakeScreenshot.js.map +1 -0
- package/lib/screenplay/interactions/Wait.d.ts +143 -0
- package/lib/screenplay/interactions/Wait.js +242 -0
- package/lib/screenplay/interactions/Wait.js.map +1 -0
- package/lib/screenplay/interactions/WaitBuilder.d.ts +32 -0
- package/lib/screenplay/interactions/WaitBuilder.js +3 -0
- package/lib/screenplay/interactions/WaitBuilder.js.map +1 -0
- package/lib/screenplay/interactions/index.d.ts +16 -0
- package/lib/screenplay/interactions/index.js +29 -0
- package/lib/screenplay/interactions/index.js.map +1 -0
- package/lib/screenplay/models/Cookie.d.ts +117 -0
- package/lib/screenplay/models/Cookie.js +176 -0
- package/lib/screenplay/models/Cookie.js.map +1 -0
- package/lib/screenplay/models/CookieData.d.ts +89 -0
- package/lib/screenplay/models/CookieData.js +3 -0
- package/lib/screenplay/models/CookieData.js.map +1 -0
- package/lib/screenplay/models/ModalDialog.d.ts +9 -0
- package/lib/screenplay/models/ModalDialog.js +14 -0
- package/lib/screenplay/models/ModalDialog.js.map +1 -0
- package/lib/screenplay/models/Page.d.ts +83 -0
- package/lib/screenplay/models/Page.js +52 -0
- package/lib/screenplay/models/Page.js.map +1 -0
- package/lib/screenplay/models/PageElement.d.ts +30 -0
- package/lib/screenplay/models/PageElement.js +62 -0
- package/lib/screenplay/models/PageElement.js.map +1 -0
- package/lib/screenplay/models/PageElements.d.ts +20 -0
- package/lib/screenplay/models/PageElements.js +49 -0
- package/lib/screenplay/models/PageElements.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +6 -0
- package/lib/screenplay/models/index.js +19 -0
- package/lib/screenplay/models/index.js.map +1 -0
- package/lib/screenplay/questions/Attribute.d.ts +83 -0
- package/lib/screenplay/questions/Attribute.js +103 -0
- package/lib/screenplay/questions/Attribute.js.map +1 -0
- package/lib/screenplay/questions/CssClasses.d.ts +93 -0
- package/lib/screenplay/questions/CssClasses.js +113 -0
- package/lib/screenplay/questions/CssClasses.js.map +1 -0
- package/lib/screenplay/questions/ElementQuestion.d.ts +34 -0
- package/lib/screenplay/questions/ElementQuestion.js +53 -0
- package/lib/screenplay/questions/ElementQuestion.js.map +1 -0
- package/lib/screenplay/questions/LastScriptExecution.d.ts +14 -0
- package/lib/screenplay/questions/LastScriptExecution.js +22 -0
- package/lib/screenplay/questions/LastScriptExecution.js.map +1 -0
- package/lib/screenplay/questions/Selected.d.ts +185 -0
- package/lib/screenplay/questions/Selected.js +210 -0
- package/lib/screenplay/questions/Selected.js.map +1 -0
- package/lib/screenplay/questions/Text.d.ts +99 -0
- package/lib/screenplay/questions/Text.js +131 -0
- package/lib/screenplay/questions/Text.js.map +1 -0
- package/lib/screenplay/questions/Value.d.ts +64 -0
- package/lib/screenplay/questions/Value.js +78 -0
- package/lib/screenplay/questions/Value.js.map +1 -0
- package/lib/screenplay/questions/index.d.ts +6 -0
- package/lib/screenplay/questions/index.js +19 -0
- package/lib/screenplay/questions/index.js.map +1 -0
- package/lib/stage/crew/index.d.ts +1 -0
- package/lib/stage/crew/index.js +14 -0
- package/lib/stage/crew/index.js.map +1 -0
- package/lib/stage/crew/photographer/Photographer.d.ts +83 -0
- package/lib/stage/crew/photographer/Photographer.js +102 -0
- package/lib/stage/crew/photographer/Photographer.js.map +1 -0
- package/lib/stage/crew/photographer/index.d.ts +2 -0
- package/lib/stage/crew/photographer/index.js +15 -0
- package/lib/stage/crew/photographer/index.js.map +1 -0
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +28 -0
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +81 -0
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +1 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +18 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +30 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +1 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +17 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +28 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js.map +1 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +19 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +28 -0
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +1 -0
- package/lib/stage/crew/photographer/strategies/index.d.ts +4 -0
- package/lib/stage/crew/photographer/strategies/index.js +17 -0
- package/lib/stage/crew/photographer/strategies/index.js.map +1 -0
- package/lib/stage/index.d.ts +1 -0
- package/lib/stage/index.js +14 -0
- package/lib/stage/index.js.map +1 -0
- package/package.json +85 -0
- package/src/errors/CookieMissingError.ts +7 -0
- package/src/errors/index.ts +1 -0
- package/src/expectations/ElementExpectation.ts +32 -0
- package/src/expectations/index.ts +6 -0
- package/src/expectations/isActive.ts +22 -0
- package/src/expectations/isClickable.ts +32 -0
- package/src/expectations/isEnabled.ts +19 -0
- package/src/expectations/isPresent.ts +21 -0
- package/src/expectations/isSelected.ts +24 -0
- package/src/expectations/isVisible.ts +28 -0
- package/src/index.ts +5 -0
- package/src/input/Key.ts +83 -0
- package/src/input/index.ts +1 -0
- package/src/screenplay/abilities/BrowseTheWeb.ts +89 -0
- package/src/screenplay/abilities/BrowserCapabilities.ts +5 -0
- package/src/screenplay/abilities/index.ts +2 -0
- package/src/screenplay/index.ts +4 -0
- package/src/screenplay/interactions/Clear.ts +102 -0
- package/src/screenplay/interactions/Click.ts +86 -0
- package/src/screenplay/interactions/DoubleClick.ts +102 -0
- package/src/screenplay/interactions/Enter.ts +92 -0
- package/src/screenplay/interactions/EnterBuilder.ts +28 -0
- package/src/screenplay/interactions/ExecuteScript.ts +345 -0
- package/src/screenplay/interactions/Hover.ts +90 -0
- package/src/screenplay/interactions/Navigate.ts +209 -0
- package/src/screenplay/interactions/PageElementInteraction.ts +59 -0
- package/src/screenplay/interactions/Press.ts +194 -0
- package/src/screenplay/interactions/PressBuilder.ts +29 -0
- package/src/screenplay/interactions/RightClick.ts +100 -0
- package/src/screenplay/interactions/Scroll.ts +99 -0
- package/src/screenplay/interactions/Select.ts +317 -0
- package/src/screenplay/interactions/SelectBuilder.ts +36 -0
- package/src/screenplay/interactions/Switch.ts +225 -0
- package/src/screenplay/interactions/TakeScreenshot.ts +89 -0
- package/src/screenplay/interactions/Wait.ts +264 -0
- package/src/screenplay/interactions/WaitBuilder.ts +34 -0
- package/src/screenplay/interactions/index.ts +16 -0
- package/src/screenplay/models/Cookie.ts +219 -0
- package/src/screenplay/models/CookieData.ts +97 -0
- package/src/screenplay/models/ModalDialog.ts +19 -0
- package/src/screenplay/models/Page.ts +147 -0
- package/src/screenplay/models/PageElement.ts +95 -0
- package/src/screenplay/models/PageElements.ts +70 -0
- package/src/screenplay/models/index.ts +6 -0
- package/src/screenplay/questions/Attribute.ts +112 -0
- package/src/screenplay/questions/CssClasses.ts +118 -0
- package/src/screenplay/questions/ElementQuestion.ts +60 -0
- package/src/screenplay/questions/LastScriptExecution.ts +21 -0
- package/src/screenplay/questions/Selected.ts +212 -0
- package/src/screenplay/questions/Text.ts +153 -0
- package/src/screenplay/questions/Value.ts +82 -0
- package/src/screenplay/questions/index.ts +6 -0
- package/src/stage/crew/index.ts +1 -0
- package/src/stage/crew/photographer/Photographer.ts +108 -0
- package/src/stage/crew/photographer/index.ts +2 -0
- package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +116 -0
- package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +28 -0
- package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +26 -0
- package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +26 -0
- package/src/stage/crew/photographer/strategies/index.ts +4 -0
- package/src/stage/index.ts +1 -0
- package/tsconfig.eslint.json +10 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Answerable, AnswersQuestions, Interaction, UsesAbilities } from '@serenity-js/core';
|
|
2
|
+
import { PageElement } from '../models';
|
|
3
|
+
import { PageElementInteraction } from './PageElementInteraction';
|
|
4
|
+
/**
|
|
5
|
+
* @desc
|
|
6
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
7
|
+
* [click](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) on a given Web element.
|
|
8
|
+
*
|
|
9
|
+
* @example <caption>Example widget</caption>
|
|
10
|
+
* <form>
|
|
11
|
+
* <input type="text" name="example" id="example" />
|
|
12
|
+
* </form>
|
|
13
|
+
*
|
|
14
|
+
* @example <caption>Lean Page Object describing the widget</caption>
|
|
15
|
+
* import { by, Target } from '@serenity-js/webdriverio';
|
|
16
|
+
*
|
|
17
|
+
* class Form {
|
|
18
|
+
* static exampleInput = Target.the('example input')
|
|
19
|
+
* .located(by.id('example'));
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* @example <caption>Clicking on an element</caption>
|
|
23
|
+
* import { actorCalled } from '@serenity-js/core';
|
|
24
|
+
* import { BrowseTheWeb, Click, isSelected } from '@serenity-js/webdriverio';
|
|
25
|
+
* import { Ensure } from '@serenity-js/assertions';
|
|
26
|
+
*
|
|
27
|
+
* actorCalled('Chloé')
|
|
28
|
+
* .whoCan(BrowseTheWeb.using(browser))
|
|
29
|
+
* .attemptsTo(
|
|
30
|
+
* Click.on(Form.exampleInput),
|
|
31
|
+
* Ensure.that(Form.exampleInput, isSelected()),
|
|
32
|
+
* );
|
|
33
|
+
*
|
|
34
|
+
* @see {@link BrowseTheWeb}
|
|
35
|
+
* @see {@link Target}
|
|
36
|
+
* @see {@link @serenity-js/assertions~Ensure}
|
|
37
|
+
* @see {@link isSelected}
|
|
38
|
+
*
|
|
39
|
+
* @extends {ElementInteraction}
|
|
40
|
+
*/
|
|
41
|
+
export declare class Click extends PageElementInteraction {
|
|
42
|
+
private readonly element;
|
|
43
|
+
/**
|
|
44
|
+
* @desc
|
|
45
|
+
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
46
|
+
*
|
|
47
|
+
* @param {Answerable<PageElement>} pageElement
|
|
48
|
+
* The element to be clicked on
|
|
49
|
+
*
|
|
50
|
+
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
51
|
+
*/
|
|
52
|
+
static on(pageElement: Answerable<PageElement>): Interaction;
|
|
53
|
+
/**
|
|
54
|
+
* @param {Answerable<PageElement>} element
|
|
55
|
+
* The element to be clicked on
|
|
56
|
+
*/
|
|
57
|
+
constructor(element: Answerable<PageElement>);
|
|
58
|
+
/**
|
|
59
|
+
* @desc
|
|
60
|
+
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
61
|
+
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
62
|
+
*
|
|
63
|
+
* @param {UsesAbilities & AnswersQuestions} actor
|
|
64
|
+
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
65
|
+
*
|
|
66
|
+
* @returns {PromiseLike<void>}
|
|
67
|
+
*
|
|
68
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
69
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
70
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
71
|
+
*/
|
|
72
|
+
performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
|
|
73
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Click = void 0;
|
|
4
|
+
const io_1 = require("@serenity-js/core/lib/io");
|
|
5
|
+
const PageElementInteraction_1 = require("./PageElementInteraction");
|
|
6
|
+
/**
|
|
7
|
+
* @desc
|
|
8
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
9
|
+
* [click](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) on a given Web element.
|
|
10
|
+
*
|
|
11
|
+
* @example <caption>Example widget</caption>
|
|
12
|
+
* <form>
|
|
13
|
+
* <input type="text" name="example" id="example" />
|
|
14
|
+
* </form>
|
|
15
|
+
*
|
|
16
|
+
* @example <caption>Lean Page Object describing the widget</caption>
|
|
17
|
+
* import { by, Target } from '@serenity-js/webdriverio';
|
|
18
|
+
*
|
|
19
|
+
* class Form {
|
|
20
|
+
* static exampleInput = Target.the('example input')
|
|
21
|
+
* .located(by.id('example'));
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* @example <caption>Clicking on an element</caption>
|
|
25
|
+
* import { actorCalled } from '@serenity-js/core';
|
|
26
|
+
* import { BrowseTheWeb, Click, isSelected } from '@serenity-js/webdriverio';
|
|
27
|
+
* import { Ensure } from '@serenity-js/assertions';
|
|
28
|
+
*
|
|
29
|
+
* actorCalled('Chloé')
|
|
30
|
+
* .whoCan(BrowseTheWeb.using(browser))
|
|
31
|
+
* .attemptsTo(
|
|
32
|
+
* Click.on(Form.exampleInput),
|
|
33
|
+
* Ensure.that(Form.exampleInput, isSelected()),
|
|
34
|
+
* );
|
|
35
|
+
*
|
|
36
|
+
* @see {@link BrowseTheWeb}
|
|
37
|
+
* @see {@link Target}
|
|
38
|
+
* @see {@link @serenity-js/assertions~Ensure}
|
|
39
|
+
* @see {@link isSelected}
|
|
40
|
+
*
|
|
41
|
+
* @extends {ElementInteraction}
|
|
42
|
+
*/
|
|
43
|
+
class Click extends PageElementInteraction_1.PageElementInteraction {
|
|
44
|
+
/**
|
|
45
|
+
* @param {Answerable<PageElement>} element
|
|
46
|
+
* The element to be clicked on
|
|
47
|
+
*/
|
|
48
|
+
constructor(element) {
|
|
49
|
+
super((0, io_1.formatted) `#actor clicks on ${element}`);
|
|
50
|
+
this.element = element;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @desc
|
|
54
|
+
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
55
|
+
*
|
|
56
|
+
* @param {Answerable<PageElement>} pageElement
|
|
57
|
+
* The element to be clicked on
|
|
58
|
+
*
|
|
59
|
+
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
60
|
+
*/
|
|
61
|
+
static on(pageElement) {
|
|
62
|
+
return new Click(pageElement);
|
|
63
|
+
}
|
|
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
|
+
async performAs(actor) {
|
|
79
|
+
const element = await this.resolve(actor, this.element);
|
|
80
|
+
await element.scrollIntoView();
|
|
81
|
+
return element.click();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.Click = Click;
|
|
85
|
+
//# sourceMappingURL=Click.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Click.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Click.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAGrD,qEAAkE;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,KAAM,SAAQ,+CAAsB;IAe7C;;;OAGG;IACH,YAA6B,OAAgC;QACzD,KAAK,CAAC,IAAA,cAAS,EAAC,oBAAqB,OAAQ,EAAE,CAAC,CAAC;QADxB,YAAO,GAAP,OAAO,CAAyB;IAE7D,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,WAAoC;QAC1C,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAUD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,SAAS,CAAC,KAAuC;QACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACJ;AA1CD,sBA0CC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Answerable, AnswersQuestions, Interaction, UsesAbilities } from '@serenity-js/core';
|
|
2
|
+
import { PageElement } from '../models';
|
|
3
|
+
import { PageElementInteraction } from './PageElementInteraction';
|
|
4
|
+
/**
|
|
5
|
+
* @desc
|
|
6
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
7
|
+
* perform a double-click on a given Web element.
|
|
8
|
+
*
|
|
9
|
+
* @example <caption>Example widget</caption>
|
|
10
|
+
* <!--
|
|
11
|
+
* The editor shows up when the user double-clicks
|
|
12
|
+
* on one of the properties of their profile
|
|
13
|
+
* and let's them change the value of that property.
|
|
14
|
+
* -->
|
|
15
|
+
* <div id="user-profile">
|
|
16
|
+
* <ul>
|
|
17
|
+
* <li id="display-name" ondblclick="edit(this)">User12345</li>
|
|
18
|
+
* <li id="email-address" ondblclick="edit(this)">tester@example.org</li>
|
|
19
|
+
* </ul>
|
|
20
|
+
* <form id="editor" class="hidden">
|
|
21
|
+
* <input type="text" value="" />
|
|
22
|
+
* </form>
|
|
23
|
+
* </div>
|
|
24
|
+
*
|
|
25
|
+
* @example <caption>Lean Page Object describing the widget</caption>
|
|
26
|
+
* import { by, Target } from '@serenity-js/webdriverio';
|
|
27
|
+
*
|
|
28
|
+
* class UserProfile {
|
|
29
|
+
* static displayName = Target.the('display name')
|
|
30
|
+
* .located(by.id('display-name'));
|
|
31
|
+
* static emailAddress = Target.the('email address')
|
|
32
|
+
* .located(by.id('email-address'));
|
|
33
|
+
* static editor = Target.the('editor')
|
|
34
|
+
* .located(by.id('editor'));
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* @example <caption>Double-clicking on an element</caption>
|
|
38
|
+
* import { actorCalled } from '@serenity-js/core';
|
|
39
|
+
* import { BrowseTheWeb, DoubleClick, isVisible, Enter, Text, Wait } from '@serenity-js/webdriverio';
|
|
40
|
+
* import { Ensure, equals, not } from '@serenity-js/assertions';
|
|
41
|
+
*
|
|
42
|
+
* actorCalled('Dorothy')
|
|
43
|
+
* .whoCan(BrowseTheWeb.using(browser))
|
|
44
|
+
* .attemptsTo(
|
|
45
|
+
* DoubleClick.on(UserProfile.displayName),
|
|
46
|
+
* Wait.until(UserProfile.editor, isVisible()),
|
|
47
|
+
*
|
|
48
|
+
* Enter.theValue('New username').into(UserProfile.editor),
|
|
49
|
+
*
|
|
50
|
+
* Ensure.that(Text.of(UserProfile.displayName), equals('New username')),
|
|
51
|
+
* Ensure.that(UserProfile.editor, not(isVisible()))
|
|
52
|
+
* );
|
|
53
|
+
*
|
|
54
|
+
* @see {@link Target}
|
|
55
|
+
*
|
|
56
|
+
* @extends {ElementInteraction}
|
|
57
|
+
*/
|
|
58
|
+
export declare class DoubleClick extends PageElementInteraction {
|
|
59
|
+
private readonly target;
|
|
60
|
+
/**
|
|
61
|
+
* @desc
|
|
62
|
+
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
63
|
+
*
|
|
64
|
+
* @param {Answerable<PageElement>} target
|
|
65
|
+
* The element to be double-clicked on
|
|
66
|
+
*
|
|
67
|
+
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
68
|
+
*/
|
|
69
|
+
static on(target: Answerable<PageElement>): Interaction;
|
|
70
|
+
/**
|
|
71
|
+
* @param {Answerable<PageElement>} target
|
|
72
|
+
* The element to be double-clicked on
|
|
73
|
+
*/
|
|
74
|
+
constructor(target: Answerable<PageElement>);
|
|
75
|
+
/**
|
|
76
|
+
* @desc
|
|
77
|
+
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
78
|
+
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
79
|
+
*
|
|
80
|
+
* @param {UsesAbilities & AnswersQuestions} actor
|
|
81
|
+
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
82
|
+
*
|
|
83
|
+
* @returns {PromiseLike<void>}
|
|
84
|
+
*
|
|
85
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
86
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
87
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
88
|
+
*/
|
|
89
|
+
performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DoubleClick = void 0;
|
|
4
|
+
const io_1 = require("@serenity-js/core/lib/io");
|
|
5
|
+
const PageElementInteraction_1 = require("./PageElementInteraction");
|
|
6
|
+
/**
|
|
7
|
+
* @desc
|
|
8
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
9
|
+
* perform a double-click on a given Web element.
|
|
10
|
+
*
|
|
11
|
+
* @example <caption>Example widget</caption>
|
|
12
|
+
* <!--
|
|
13
|
+
* The editor shows up when the user double-clicks
|
|
14
|
+
* on one of the properties of their profile
|
|
15
|
+
* and let's them change the value of that property.
|
|
16
|
+
* -->
|
|
17
|
+
* <div id="user-profile">
|
|
18
|
+
* <ul>
|
|
19
|
+
* <li id="display-name" ondblclick="edit(this)">User12345</li>
|
|
20
|
+
* <li id="email-address" ondblclick="edit(this)">tester@example.org</li>
|
|
21
|
+
* </ul>
|
|
22
|
+
* <form id="editor" class="hidden">
|
|
23
|
+
* <input type="text" value="" />
|
|
24
|
+
* </form>
|
|
25
|
+
* </div>
|
|
26
|
+
*
|
|
27
|
+
* @example <caption>Lean Page Object describing the widget</caption>
|
|
28
|
+
* import { by, Target } from '@serenity-js/webdriverio';
|
|
29
|
+
*
|
|
30
|
+
* class UserProfile {
|
|
31
|
+
* static displayName = Target.the('display name')
|
|
32
|
+
* .located(by.id('display-name'));
|
|
33
|
+
* static emailAddress = Target.the('email address')
|
|
34
|
+
* .located(by.id('email-address'));
|
|
35
|
+
* static editor = Target.the('editor')
|
|
36
|
+
* .located(by.id('editor'));
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* @example <caption>Double-clicking on an element</caption>
|
|
40
|
+
* import { actorCalled } from '@serenity-js/core';
|
|
41
|
+
* import { BrowseTheWeb, DoubleClick, isVisible, Enter, Text, Wait } from '@serenity-js/webdriverio';
|
|
42
|
+
* import { Ensure, equals, not } from '@serenity-js/assertions';
|
|
43
|
+
*
|
|
44
|
+
* actorCalled('Dorothy')
|
|
45
|
+
* .whoCan(BrowseTheWeb.using(browser))
|
|
46
|
+
* .attemptsTo(
|
|
47
|
+
* DoubleClick.on(UserProfile.displayName),
|
|
48
|
+
* Wait.until(UserProfile.editor, isVisible()),
|
|
49
|
+
*
|
|
50
|
+
* Enter.theValue('New username').into(UserProfile.editor),
|
|
51
|
+
*
|
|
52
|
+
* Ensure.that(Text.of(UserProfile.displayName), equals('New username')),
|
|
53
|
+
* Ensure.that(UserProfile.editor, not(isVisible()))
|
|
54
|
+
* );
|
|
55
|
+
*
|
|
56
|
+
* @see {@link Target}
|
|
57
|
+
*
|
|
58
|
+
* @extends {ElementInteraction}
|
|
59
|
+
*/
|
|
60
|
+
class DoubleClick extends PageElementInteraction_1.PageElementInteraction {
|
|
61
|
+
/**
|
|
62
|
+
* @param {Answerable<PageElement>} target
|
|
63
|
+
* The element to be double-clicked on
|
|
64
|
+
*/
|
|
65
|
+
constructor(target) {
|
|
66
|
+
super((0, io_1.formatted) `#actor double-clicks on ${target}`);
|
|
67
|
+
this.target = target;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @desc
|
|
71
|
+
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
72
|
+
*
|
|
73
|
+
* @param {Answerable<PageElement>} target
|
|
74
|
+
* The element to be double-clicked on
|
|
75
|
+
*
|
|
76
|
+
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
77
|
+
*/
|
|
78
|
+
static on(target) {
|
|
79
|
+
return new DoubleClick(target);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @desc
|
|
83
|
+
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
84
|
+
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
85
|
+
*
|
|
86
|
+
* @param {UsesAbilities & AnswersQuestions} actor
|
|
87
|
+
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
88
|
+
*
|
|
89
|
+
* @returns {PromiseLike<void>}
|
|
90
|
+
*
|
|
91
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
92
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
93
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
94
|
+
*/
|
|
95
|
+
async performAs(actor) {
|
|
96
|
+
const element = await this.resolve(actor, this.target);
|
|
97
|
+
return element.doubleClick();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.DoubleClick = DoubleClick;
|
|
101
|
+
//# sourceMappingURL=DoubleClick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoubleClick.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/DoubleClick.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAGrD,qEAAkE;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAa,WAAY,SAAQ,+CAAsB;IAenD;;;OAGG;IACH,YAA6B,MAA+B;QACxD,KAAK,CAAC,IAAA,cAAS,EAAC,2BAA4B,MAAO,EAAE,CAAC,CAAC;QAD9B,WAAM,GAAN,MAAM,CAAyB;IAE5D,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,MAA+B;QACrC,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,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,WAAW,EAAE,CAAC;IACjC,CAAC;CACJ;AAzCD,kCAyCC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Answerable, AnswersQuestions, UsesAbilities } from '@serenity-js/core';
|
|
2
|
+
import { PageElement } from '../models';
|
|
3
|
+
import { EnterBuilder } from './EnterBuilder';
|
|
4
|
+
import { PageElementInteraction } from './PageElementInteraction';
|
|
5
|
+
/**
|
|
6
|
+
* @desc
|
|
7
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
8
|
+
* enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
|
|
9
|
+
*
|
|
10
|
+
* @example <caption>Example widget</caption>
|
|
11
|
+
* <form>
|
|
12
|
+
* <input type="text" name="example" id="example" />
|
|
13
|
+
* </form>
|
|
14
|
+
*
|
|
15
|
+
* @example <caption>Lean Page Object describing the widget</caption>
|
|
16
|
+
* import { by, Target } from '@serenity-js/webdriverio';
|
|
17
|
+
*
|
|
18
|
+
* class Form {
|
|
19
|
+
* static exampleInput = Target.the('example input')
|
|
20
|
+
* .located(by.id('example'));
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* @example <caption>Entering the value into a form field</caption>
|
|
24
|
+
* import { actorCalled } from '@serenity-js/core';
|
|
25
|
+
* import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';
|
|
26
|
+
*
|
|
27
|
+
* actorCalled('Esme')
|
|
28
|
+
* .whoCan(BrowseTheWeb.using(browser))
|
|
29
|
+
* .attemptsTo(
|
|
30
|
+
* Enter.theValue('Hello world!').into(Form.exampleInput),
|
|
31
|
+
* );
|
|
32
|
+
*
|
|
33
|
+
* @see {@link Target}
|
|
34
|
+
*
|
|
35
|
+
* @extends {ElementInteraction}
|
|
36
|
+
*/
|
|
37
|
+
export declare class Enter extends PageElementInteraction {
|
|
38
|
+
private readonly value;
|
|
39
|
+
private readonly field;
|
|
40
|
+
/**
|
|
41
|
+
* @desc
|
|
42
|
+
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
43
|
+
*
|
|
44
|
+
* @param {Array<Answerable<string | number | string[] | number[]>>} value
|
|
45
|
+
* The value to be entered
|
|
46
|
+
*
|
|
47
|
+
* @returns {EnterBuilder}
|
|
48
|
+
*/
|
|
49
|
+
static theValue(...value: Array<Answerable<string | number | string[] | number[]>>): EnterBuilder;
|
|
50
|
+
/**
|
|
51
|
+
* @param {Array<Answerable<string | number | string[] | number[]>>} value
|
|
52
|
+
* The value to be entered
|
|
53
|
+
*
|
|
54
|
+
* @param {Answerable<PageElement>} field
|
|
55
|
+
* The field to enter the value into
|
|
56
|
+
*/
|
|
57
|
+
constructor(value: Array<Answerable<string | number | string[] | number[]>>, field: Answerable<PageElement>);
|
|
58
|
+
/**
|
|
59
|
+
* @desc
|
|
60
|
+
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
61
|
+
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
62
|
+
*
|
|
63
|
+
* @param {UsesAbilities & AnswersQuestions} actor
|
|
64
|
+
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
65
|
+
*
|
|
66
|
+
* @returns {Promise<void>}
|
|
67
|
+
*
|
|
68
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
69
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
70
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
71
|
+
*/
|
|
72
|
+
performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
|
|
73
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Enter = void 0;
|
|
4
|
+
const io_1 = require("@serenity-js/core/lib/io");
|
|
5
|
+
const PageElementInteraction_1 = require("./PageElementInteraction");
|
|
6
|
+
/**
|
|
7
|
+
* @desc
|
|
8
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
9
|
+
* enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
|
|
10
|
+
*
|
|
11
|
+
* @example <caption>Example widget</caption>
|
|
12
|
+
* <form>
|
|
13
|
+
* <input type="text" name="example" id="example" />
|
|
14
|
+
* </form>
|
|
15
|
+
*
|
|
16
|
+
* @example <caption>Lean Page Object describing the widget</caption>
|
|
17
|
+
* import { by, Target } from '@serenity-js/webdriverio';
|
|
18
|
+
*
|
|
19
|
+
* class Form {
|
|
20
|
+
* static exampleInput = Target.the('example input')
|
|
21
|
+
* .located(by.id('example'));
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* @example <caption>Entering the value into a form field</caption>
|
|
25
|
+
* import { actorCalled } from '@serenity-js/core';
|
|
26
|
+
* import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';
|
|
27
|
+
*
|
|
28
|
+
* actorCalled('Esme')
|
|
29
|
+
* .whoCan(BrowseTheWeb.using(browser))
|
|
30
|
+
* .attemptsTo(
|
|
31
|
+
* Enter.theValue('Hello world!').into(Form.exampleInput),
|
|
32
|
+
* );
|
|
33
|
+
*
|
|
34
|
+
* @see {@link Target}
|
|
35
|
+
*
|
|
36
|
+
* @extends {ElementInteraction}
|
|
37
|
+
*/
|
|
38
|
+
class Enter extends PageElementInteraction_1.PageElementInteraction {
|
|
39
|
+
/**
|
|
40
|
+
* @param {Array<Answerable<string | number | string[] | number[]>>} value
|
|
41
|
+
* The value to be entered
|
|
42
|
+
*
|
|
43
|
+
* @param {Answerable<PageElement>} field
|
|
44
|
+
* The field to enter the value into
|
|
45
|
+
*/
|
|
46
|
+
constructor(value, field /* todo | Question<AlertPromise> | AlertPromise */) {
|
|
47
|
+
super((0, io_1.formatted) `#actor enters ${value.join(', ')} into ${field}`);
|
|
48
|
+
this.value = value;
|
|
49
|
+
this.field = field;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @desc
|
|
53
|
+
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
54
|
+
*
|
|
55
|
+
* @param {Array<Answerable<string | number | string[] | number[]>>} value
|
|
56
|
+
* The value to be entered
|
|
57
|
+
*
|
|
58
|
+
* @returns {EnterBuilder}
|
|
59
|
+
*/
|
|
60
|
+
static theValue(...value) {
|
|
61
|
+
return {
|
|
62
|
+
into: (field /* todo Question<AlertPromise> | AlertPromise */) => new Enter(value, field),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @desc
|
|
67
|
+
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
68
|
+
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
69
|
+
*
|
|
70
|
+
* @param {UsesAbilities & AnswersQuestions} actor
|
|
71
|
+
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
72
|
+
*
|
|
73
|
+
* @returns {Promise<void>}
|
|
74
|
+
*
|
|
75
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
76
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
77
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
78
|
+
*/
|
|
79
|
+
async performAs(actor) {
|
|
80
|
+
const values = await Promise.all(this.value.map(part => actor.answer(part)));
|
|
81
|
+
const field = await this.resolve(actor, this.field);
|
|
82
|
+
return field.enterValue(values.flat());
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.Enter = Enter;
|
|
86
|
+
//# sourceMappingURL=Enter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Enter.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Enter.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAIrD,qEAAkE;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAa,KAAM,SAAQ,+CAAsB;IAkB7C;;;;;;OAMG;IACH,YACqB,KAA+D,EAC/D,KAA8B,CAAC,kDAAkD;QAElG,KAAK,CAAC,IAAA,cAAS,EAAC,iBAAkB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAE,SAAU,KAAM,EAAE,CAAC,CAAC;QAHtD,UAAK,GAAL,KAAK,CAA0D;QAC/D,UAAK,GAAL,KAAK,CAAyB;IAGnD,CAAC;IA5BD;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,KAA+D;QAC9E,OAAO;YACH,IAAI,EAAE,CAAC,KAA8B,CAAE,gDAAgD,EAAE,EAAE,CACvF,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC;SAC9B,CAAC;IACN,CAAC;IAgBD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,SAAS,CAAC,KAAuC;QACnD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,KAAK,GAAI,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAErD,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;CACJ;AApDD,sBAoDC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Answerable, Interaction } from '@serenity-js/core';
|
|
2
|
+
import { PageElement } from '../models';
|
|
3
|
+
/**
|
|
4
|
+
* @desc
|
|
5
|
+
* Fluent interface to make the instantiation of
|
|
6
|
+
* the {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
7
|
+
* to {@link Enter} more readable.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link Enter}
|
|
10
|
+
*
|
|
11
|
+
* @interface
|
|
12
|
+
*/
|
|
13
|
+
export interface EnterBuilder {
|
|
14
|
+
/**
|
|
15
|
+
* @desc
|
|
16
|
+
* Instantiates an {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
17
|
+
* to {@link Enter}.
|
|
18
|
+
*
|
|
19
|
+
* @param {Answerable<PageElement>} field
|
|
20
|
+
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
21
|
+
*
|
|
22
|
+
* @see {@link Target}
|
|
23
|
+
*/
|
|
24
|
+
into: (field: Answerable<PageElement>) => Interaction;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnterBuilder.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/EnterBuilder.ts"],"names":[],"mappings":""}
|