@serenity-js/webdriverio 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 +73 -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} +79 -23
- package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithWebdriverIO.js} +160 -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/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 +22 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js +75 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOPageElements.d.ts +15 -0
- package/lib/screenplay/models/WebdriverIOPageElements.js +65 -0
- package/lib/screenplay/models/WebdriverIOPageElements.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 +22 -32
- 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} +200 -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/WebdriverIONativeElementRoot.ts +3 -0
- package/src/screenplay/models/WebdriverIOPage.ts +120 -0
- package/src/screenplay/models/WebdriverIOPageElement.ts +92 -0
- package/src/screenplay/models/WebdriverIOPageElements.ts +91 -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,79 +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
|
-
* clear the `value` of a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
|
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>Clearing the value of an input field</caption>
|
|
23
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
24
|
-
* import { BrowseTheWeb, Clear, Enter, Value } from '@serenity-js/webdriverio';
|
|
25
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
26
|
-
*
|
|
27
|
-
* actorCalled('Inés')
|
|
28
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
29
|
-
* .attemptsTo(
|
|
30
|
-
* Enter.theValue('Hello world!').into(Form.exampleInput),
|
|
31
|
-
* Ensure.that(Value.of(Form.exampleInput), equals('Hello world!')),
|
|
32
|
-
*
|
|
33
|
-
* Clear.theValueOf(Form.exampleInput),
|
|
34
|
-
* Ensure.that(Value.of(Form.exampleInput), equals('')),
|
|
35
|
-
* );
|
|
36
|
-
*
|
|
37
|
-
* @see {@link BrowseTheWeb}
|
|
38
|
-
* @see {@link Enter}
|
|
39
|
-
* @see {@link Value}
|
|
40
|
-
* @see {@link Target}
|
|
41
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
42
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
43
|
-
*
|
|
44
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
45
|
-
*/
|
|
46
|
-
export declare class Clear extends WebElementInteraction {
|
|
47
|
-
private readonly field;
|
|
48
|
-
/**
|
|
49
|
-
* @desc
|
|
50
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
51
|
-
*
|
|
52
|
-
* @param {Answerable<Element<'async'>>} field
|
|
53
|
-
* The field to be cleared
|
|
54
|
-
*
|
|
55
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
56
|
-
*/
|
|
57
|
-
static theValueOf(field: Answerable<Element<'async'>>): Interaction;
|
|
58
|
-
/**
|
|
59
|
-
* @param {Answerable<Element<'async'>>} field
|
|
60
|
-
* The element to be clicked on
|
|
61
|
-
*/
|
|
62
|
-
constructor(field: 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
|
-
private capitaliseFirstLetter;
|
|
79
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Clear = void 0;
|
|
4
|
-
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
|
-
const WebElementInteraction_1 = require("./WebElementInteraction");
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
10
|
-
* clear the `value` of a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
|
11
|
-
*
|
|
12
|
-
* @example <caption>Example widget</caption>
|
|
13
|
-
* <form>
|
|
14
|
-
* <input type="text" name="example" id="example" />
|
|
15
|
-
* </form>
|
|
16
|
-
*
|
|
17
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
18
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
19
|
-
*
|
|
20
|
-
* class Form {
|
|
21
|
-
* static exampleInput = Target.the('example input')
|
|
22
|
-
* .located(by.id('example'));
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* @example <caption>Clearing the value of an input field</caption>
|
|
26
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
27
|
-
* import { BrowseTheWeb, Clear, Enter, Value } from '@serenity-js/webdriverio';
|
|
28
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
29
|
-
*
|
|
30
|
-
* actorCalled('Inés')
|
|
31
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
32
|
-
* .attemptsTo(
|
|
33
|
-
* Enter.theValue('Hello world!').into(Form.exampleInput),
|
|
34
|
-
* Ensure.that(Value.of(Form.exampleInput), equals('Hello world!')),
|
|
35
|
-
*
|
|
36
|
-
* Clear.theValueOf(Form.exampleInput),
|
|
37
|
-
* Ensure.that(Value.of(Form.exampleInput), equals('')),
|
|
38
|
-
* );
|
|
39
|
-
*
|
|
40
|
-
* @see {@link BrowseTheWeb}
|
|
41
|
-
* @see {@link Enter}
|
|
42
|
-
* @see {@link Value}
|
|
43
|
-
* @see {@link Target}
|
|
44
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
45
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
46
|
-
*
|
|
47
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
48
|
-
*/
|
|
49
|
-
class Clear extends WebElementInteraction_1.WebElementInteraction {
|
|
50
|
-
/**
|
|
51
|
-
* @param {Answerable<Element<'async'>>} field
|
|
52
|
-
* The element to be clicked on
|
|
53
|
-
*/
|
|
54
|
-
constructor(field) {
|
|
55
|
-
super((0, io_1.formatted) `#actor clears the value of ${field}`);
|
|
56
|
-
this.field = field;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @desc
|
|
60
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
61
|
-
*
|
|
62
|
-
* @param {Answerable<Element<'async'>>} field
|
|
63
|
-
* The field to be cleared
|
|
64
|
-
*
|
|
65
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
66
|
-
*/
|
|
67
|
-
static theValueOf(field) {
|
|
68
|
-
return new Clear(field);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @desc
|
|
72
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
73
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
74
|
-
*
|
|
75
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
76
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
77
|
-
*
|
|
78
|
-
* @returns {PromiseLike<void>}
|
|
79
|
-
*
|
|
80
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
81
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
82
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
83
|
-
*/
|
|
84
|
-
async performAs(actor) {
|
|
85
|
-
const element = await this.resolve(actor, this.field);
|
|
86
|
-
const value = await element.getValue();
|
|
87
|
-
if (value === undefined) {
|
|
88
|
-
throw new core_1.LogicError(this.capitaliseFirstLetter((0, io_1.formatted) `${this.field} doesn't seem to have a 'value' attribute that could be cleared.`));
|
|
89
|
-
}
|
|
90
|
-
return element.clearValue();
|
|
91
|
-
}
|
|
92
|
-
capitaliseFirstLetter(text) {
|
|
93
|
-
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.Clear = Clear;
|
|
97
|
-
//# sourceMappingURL=Clear.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Clear.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Clear.ts"],"names":[],"mappings":";;;AAAA,4CAAyG;AACzG,iDAAqD;AAGrD,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,KAAM,SAAQ,6CAAqB;IAe5C;;;OAGG;IACH,YAA6B,KAAmC;QAC5D,KAAK,CAAC,IAAA,cAAS,EAAC,8BAA+B,KAAM,EAAE,CAAC,CAAC;QADhC,UAAK,GAAL,KAAK,CAA8B;IAEhE,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,UAAU,CAAC,KAAmC;QACjD,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAUD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,SAAS,CAAC,KAAuC;QACnD,MAAM,OAAO,GAAK,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACxD,MAAM,KAAK,GAAO,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;QAE3C,IAAI,KAAK,KAAK,SAAS,EAAE;YACrB,MAAM,IAAI,iBAAU,CAChB,IAAI,CAAC,qBAAqB,CAAC,IAAA,cAAS,EAAC,GAAI,IAAI,CAAC,KAAM,kEAAkE,CAAC,CAC1H,CAAC;SACL;QAED,OAAO,OAAO,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAEO,qBAAqB,CAAC,IAAY;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ;AArDD,sBAqDC"}
|
|
@@ -1,73 +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
|
-
* [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 {WebElementInteraction}
|
|
40
|
-
*/
|
|
41
|
-
export declare class Click extends WebElementInteraction {
|
|
42
|
-
private readonly target;
|
|
43
|
-
/**
|
|
44
|
-
* @desc
|
|
45
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
46
|
-
*
|
|
47
|
-
* @param {Answerable<Element<'async'>>} target
|
|
48
|
-
* The element to be clicked on
|
|
49
|
-
*
|
|
50
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
51
|
-
*/
|
|
52
|
-
static on(target: Answerable<Element<'async'>>): Interaction;
|
|
53
|
-
/**
|
|
54
|
-
* @param {Answerable<Element<'async'>>} target
|
|
55
|
-
* The element to be clicked on
|
|
56
|
-
*/
|
|
57
|
-
constructor(target: Answerable<Element<'async'>>);
|
|
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
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
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 WebElementInteraction_1 = require("./WebElementInteraction");
|
|
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 {WebElementInteraction}
|
|
42
|
-
*/
|
|
43
|
-
class Click extends WebElementInteraction_1.WebElementInteraction {
|
|
44
|
-
/**
|
|
45
|
-
* @param {Answerable<Element<'async'>>} target
|
|
46
|
-
* The element to be clicked on
|
|
47
|
-
*/
|
|
48
|
-
constructor(target) {
|
|
49
|
-
super((0, io_1.formatted) `#actor clicks on ${target}`);
|
|
50
|
-
this.target = target;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* @desc
|
|
54
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
55
|
-
*
|
|
56
|
-
* @param {Answerable<Element<'async'>>} target
|
|
57
|
-
* The element to be clicked on
|
|
58
|
-
*
|
|
59
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
60
|
-
*/
|
|
61
|
-
static on(target) {
|
|
62
|
-
return new Click(target);
|
|
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.target);
|
|
80
|
-
return element.click();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.Click = Click;
|
|
84
|
-
//# sourceMappingURL=Click.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Click.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Click.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAGrD,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,KAAM,SAAQ,6CAAqB;IAe5C;;;OAGG;IACH,YAA6B,MAAoC;QAC7D,KAAK,CAAC,IAAA,cAAS,EAAC,oBAAqB,MAAO,EAAE,CAAC,CAAC;QADvB,WAAM,GAAN,MAAM,CAA8B;IAEjE,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,MAAoC;QAC1C,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,KAAK,EAAE,CAAC;IAC3B,CAAC;CACJ;AAzCD,sBAyCC"}
|
|
@@ -1,90 +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
|
-
* 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 {WebElementInteraction}
|
|
57
|
-
*/
|
|
58
|
-
export declare class DoubleClick extends WebElementInteraction {
|
|
59
|
-
private readonly target;
|
|
60
|
-
/**
|
|
61
|
-
* @desc
|
|
62
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
63
|
-
*
|
|
64
|
-
* @param {Answerable<Element<'async'>>} target
|
|
65
|
-
* The element to be double-clicked on
|
|
66
|
-
*
|
|
67
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
68
|
-
*/
|
|
69
|
-
static on(target: Answerable<Element<'async'>>): Interaction;
|
|
70
|
-
/**
|
|
71
|
-
* @param {Answerable<Element<'async'>>} target
|
|
72
|
-
* The element to be double-clicked on
|
|
73
|
-
*/
|
|
74
|
-
constructor(target: Answerable<Element<'async'>>);
|
|
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
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
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 WebElementInteraction_1 = require("./WebElementInteraction");
|
|
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 {WebElementInteraction}
|
|
59
|
-
*/
|
|
60
|
-
class DoubleClick extends WebElementInteraction_1.WebElementInteraction {
|
|
61
|
-
/**
|
|
62
|
-
* @param {Answerable<Element<'async'>>} 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<Element<'async'>>} 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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleClick.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/DoubleClick.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAGrD,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAa,WAAY,SAAQ,6CAAqB;IAelD;;;OAGG;IACH,YAA6B,MAAoC;QAC7D,KAAK,CAAC,IAAA,cAAS,EAAC,2BAA4B,MAAO,EAAE,CAAC,CAAC;QAD9B,WAAM,GAAN,MAAM,CAA8B;IAEjE,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,MAAoC;QAC1C,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"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Answerable, AnswersQuestions, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
import { EnterBuilder } from './EnterBuilder';
|
|
4
|
-
import { WebElementInteraction } from './WebElementInteraction';
|
|
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 {WebElementInteraction}
|
|
36
|
-
*/
|
|
37
|
-
export declare class Enter extends WebElementInteraction {
|
|
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<Element<'async'>>} field
|
|
55
|
-
* The field to enter the value into
|
|
56
|
-
*/
|
|
57
|
-
constructor(value: Array<Answerable<string | number | string[] | number[]>>, field: Answerable<Element<'async'>>);
|
|
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
|
-
}
|