@serenity-js/webdriverio 2.32.3 → 3.0.0-rc.1
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 +70 -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 +21 -31
- 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,219 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.by = exports.Locators = exports.Locator = void 0;
|
|
4
|
-
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const abilities_1 = require("../abilities");
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Represents a way to retrieve one and multiple Web elements using a given strategy.
|
|
9
|
-
*
|
|
10
|
-
* @see {@link by}
|
|
11
|
-
* @see {@link Locators}
|
|
12
|
-
*/
|
|
13
|
-
class Locator {
|
|
14
|
-
constructor(description, locateOne, locateAll) {
|
|
15
|
-
this.description = description;
|
|
16
|
-
this.locateOne = locateOne;
|
|
17
|
-
this.locateAll = locateAll;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @desc
|
|
21
|
-
* Returns a {@link @serenity-js/core/lib/screenplay~Question} that resolves
|
|
22
|
-
* to the first Web element found using a given strategy.
|
|
23
|
-
*
|
|
24
|
-
* @returns {@serenity-js/core/lib/screenplay~Question<Promise<Element<'async'>>>}
|
|
25
|
-
*/
|
|
26
|
-
firstMatching() {
|
|
27
|
-
return core_1.Question.about(this.description, actor => this.locateOne(abilities_1.BrowseTheWeb.as(actor).browser));
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @desc
|
|
31
|
-
* Returns a {@link @serenity-js/core/lib/screenplay~Question} that resolves
|
|
32
|
-
* to all the Web elements found using a given strategy.
|
|
33
|
-
*
|
|
34
|
-
* @returns {@serenity-js/core/lib/screenplay~Question<Promise<ElementArray>>}
|
|
35
|
-
*/
|
|
36
|
-
allMatching() {
|
|
37
|
-
return core_1.Question.about(this.description, actor => this.locateAll(abilities_1.BrowseTheWeb.as(actor).browser));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.Locator = Locator;
|
|
41
|
-
/**
|
|
42
|
-
* @desc
|
|
43
|
-
* {@link Locator} factory. You probably want to use {@link by} instead in your tests.
|
|
44
|
-
*/
|
|
45
|
-
class Locators {
|
|
46
|
-
/**
|
|
47
|
-
* @desc
|
|
48
|
-
* Locates elements by their `id` attribute.
|
|
49
|
-
*
|
|
50
|
-
* @example <caption>Example widget</caption>
|
|
51
|
-
* <input id="username" />
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
55
|
-
*
|
|
56
|
-
* const usernameField = Target.the('username field').located(by.id('username'));
|
|
57
|
-
*
|
|
58
|
-
* @param {string} id
|
|
59
|
-
* @returns {Locator}
|
|
60
|
-
*
|
|
61
|
-
* @see {@link Target}
|
|
62
|
-
* @see https://webdriver.io/docs/selectors/#id
|
|
63
|
-
*/
|
|
64
|
-
id(id) {
|
|
65
|
-
return new Locator(`by id #${id}`, browser => browser.$(`#${id}`), browser => browser.$$(`#${id}`));
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @desc
|
|
69
|
-
* Locates elements using a CSS selector
|
|
70
|
-
*
|
|
71
|
-
* @example <caption>Example widget</caption>
|
|
72
|
-
* <div id="article">
|
|
73
|
-
* <h1>Title</h1>
|
|
74
|
-
* <h2>Section 1</h2>
|
|
75
|
-
* <h2>Section 2</h2>
|
|
76
|
-
* </div>
|
|
77
|
-
*
|
|
78
|
-
* @example <caption>Locating a single element</caption>
|
|
79
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
80
|
-
*
|
|
81
|
-
* const title = Target.the('article title').located(by.css('#article h1'));
|
|
82
|
-
*
|
|
83
|
-
* @example <caption>Locating multiple elements</caption>
|
|
84
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
85
|
-
*
|
|
86
|
-
* const titles = Target.all('section titles').located(by.css('#article h2'));
|
|
87
|
-
*
|
|
88
|
-
* @param {Selector} selector
|
|
89
|
-
* @returns {Locator}
|
|
90
|
-
*
|
|
91
|
-
* @see {@link Target}
|
|
92
|
-
* @see https://webdriver.io/docs/selectors/#css-query-selector
|
|
93
|
-
*/
|
|
94
|
-
css(selector) {
|
|
95
|
-
return new Locator(`by css ${selector}`, browser => browser.$(selector), browser => browser.$$(selector));
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @desc
|
|
99
|
-
* Locates elements by HTML tag name
|
|
100
|
-
*
|
|
101
|
-
* @example <caption>Example widget</caption>
|
|
102
|
-
* <ul>
|
|
103
|
-
* <li>Item 1</li>
|
|
104
|
-
* <li>Item 2</li>
|
|
105
|
-
* </ul>
|
|
106
|
-
* <span>Total price: £5</span>
|
|
107
|
-
*
|
|
108
|
-
* @example <caption>Locating a single element</caption>
|
|
109
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
110
|
-
*
|
|
111
|
-
* const totalPrice = Target.the('total price').located(by.tagName('span'));
|
|
112
|
-
*
|
|
113
|
-
* @example <caption>Locating multiple elements</caption>
|
|
114
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
115
|
-
*
|
|
116
|
-
* const items = Target.all('shopping basket items').located(by.tagName('li'));
|
|
117
|
-
*
|
|
118
|
-
* @param {string} tagName
|
|
119
|
-
* @returns {Locator}
|
|
120
|
-
*
|
|
121
|
-
* @see {@link Target}
|
|
122
|
-
* @see https://webdriver.io/docs/selectors/#tag-name
|
|
123
|
-
*/
|
|
124
|
-
tagName(tagName) {
|
|
125
|
-
return new Locator(`by tag name <${tagName} />`, browser => browser.$(`<${tagName} />`), browser => browser.$$(`<${tagName} />`));
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* @desc
|
|
129
|
-
* Locates an HTML anchor element with a specific text in it.
|
|
130
|
-
*
|
|
131
|
-
* @example <caption>Example widget</caption>
|
|
132
|
-
* <a href="https://serenity-js.org">Serenity/JS</a>
|
|
133
|
-
*
|
|
134
|
-
* @example <caption>Locating a single element</caption>
|
|
135
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
136
|
-
*
|
|
137
|
-
* const serenityWebsite = Target.the('Serenity/JS website link').located(by.linkText('Serenity/JS'));
|
|
138
|
-
*
|
|
139
|
-
* @example <caption>Locating multiple elements</caption>
|
|
140
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
141
|
-
*
|
|
142
|
-
* const items = Target.all('Serenity/JS website links').located(by.linkText('Serenity/JS'));
|
|
143
|
-
*
|
|
144
|
-
* @param {string} linkText
|
|
145
|
-
* @returns {Locator}
|
|
146
|
-
*
|
|
147
|
-
* @see {@link Target}
|
|
148
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
|
|
149
|
-
* @see https://webdriver.io/docs/selectors/#link-text
|
|
150
|
-
*/
|
|
151
|
-
linkText(linkText) {
|
|
152
|
-
return new Locator(`by link text ${linkText}`, browser => browser.$(`=${linkText}`), browser => browser.$$(`=${linkText}`));
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* @desc
|
|
156
|
-
* Locates an HTML anchor element with which visible text partially matches `partialLinkText`
|
|
157
|
-
*
|
|
158
|
-
* @example <caption>Example widget</caption>
|
|
159
|
-
* <a href="https://serenity-js.org">Serenity/JS</a>
|
|
160
|
-
* <a href="https://serenity-bdd.info/#/">Serenity BDD</a>
|
|
161
|
-
*
|
|
162
|
-
* @example <caption>Locating a single element</caption>
|
|
163
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
164
|
-
*
|
|
165
|
-
* const serenityWebsite = Target.the('Serenity/JS website link').located(by.partialLinkText('JS'));
|
|
166
|
-
*
|
|
167
|
-
* @example <caption>Locating multiple elements</caption>
|
|
168
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
169
|
-
*
|
|
170
|
-
* const serenityWebsites = Target.all('Serenity frameworks').located(by.partialLinkText('Serenity'));
|
|
171
|
-
*
|
|
172
|
-
* @param {string} partialLinkText
|
|
173
|
-
* @returns {Locator}
|
|
174
|
-
*
|
|
175
|
-
* @see {@link Target}
|
|
176
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
|
|
177
|
-
* @see https://webdriver.io/docs/selectors/#link-text
|
|
178
|
-
*/
|
|
179
|
-
partialLinkText(partialLinkText) {
|
|
180
|
-
return new Locator(`by partial link text ${partialLinkText}`, browser => browser.$(`*=${partialLinkText}`), browser => browser.$$(`*=${partialLinkText}`));
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* @desc
|
|
184
|
-
* Locates elements using an [XPath](https://developer.mozilla.org/en-US/docs/Web/XPath) selector.
|
|
185
|
-
*
|
|
186
|
-
* Please note that whenever possible you should use {@link Locators#id} and {@link Locators#css} locators
|
|
187
|
-
* instead of XPath to make your tests more robust.
|
|
188
|
-
*
|
|
189
|
-
* @example <caption>Example widget</caption>
|
|
190
|
-
* <div id="article">
|
|
191
|
-
* <h1>Title</h1>
|
|
192
|
-
* <h2>Section 1</h2>
|
|
193
|
-
* <h2>Section 2</h2>
|
|
194
|
-
* </div>
|
|
195
|
-
*
|
|
196
|
-
* @example <caption>Locating a single element</caption>
|
|
197
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
198
|
-
*
|
|
199
|
-
* const title = Target.the('article title').located(by.xpath('//*[@id="article"]/h1'));
|
|
200
|
-
*
|
|
201
|
-
* @example <caption>Locating multiple elements</caption>
|
|
202
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
203
|
-
*
|
|
204
|
-
* const title = Target.the('article title').located(by.xpath('//*[@id="article"]/h2'));
|
|
205
|
-
*
|
|
206
|
-
* @param {string} xpath
|
|
207
|
-
* @returns {Locator}
|
|
208
|
-
*
|
|
209
|
-
* @see {@link Target}
|
|
210
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/XPath
|
|
211
|
-
* @see https://webdriver.io/docs/selectors/#xpath
|
|
212
|
-
*/
|
|
213
|
-
xpath(xpath) {
|
|
214
|
-
return new Locator(`by xpath ${xpath}`, browser => browser.$(xpath), browser => browser.$$(xpath));
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
exports.Locators = Locators;
|
|
218
|
-
exports.by = new Locators();
|
|
219
|
-
//# sourceMappingURL=locators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locators.js","sourceRoot":"","sources":["../../../src/screenplay/questions/locators.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { Answerable, AnswersQuestions, Expectation, List, MetaQuestion, Question, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import type { Element, ElementArray } from 'webdriverio';
|
|
3
|
-
import { ElementArrayListAdapter } from './lists';
|
|
4
|
-
import { Locator } from './locators';
|
|
5
|
-
import { NestedTargetBuilder } from './NestedTargetBuilder';
|
|
6
|
-
import { TargetBuilder } from './TargetBuilder';
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* A type alias representing a {@link @serenity-js/core/lib/screenplay/questions~List} of WebdriverIO Web elements.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*
|
|
13
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~List}
|
|
14
|
-
*
|
|
15
|
-
* @typedef {List<ElementArrayListAdapter, Promise<Element<'async'>>, Promise<ElementArray>>} TargetList
|
|
16
|
-
*/
|
|
17
|
-
export declare type TargetList = List<ElementArrayListAdapter, Promise<Element<'async'>>, Promise<ElementArray>>;
|
|
18
|
-
/**
|
|
19
|
-
* @desc
|
|
20
|
-
* Provides a convenient way to retrieve a single web element or multiple web elements,
|
|
21
|
-
* so that they can be used with Serenity/JS {@link @serenity-js/core/lib/screenplay~Interaction}s.
|
|
22
|
-
*
|
|
23
|
-
* Check out the examples below, as well as the unit tests demonstrating the usage.
|
|
24
|
-
*
|
|
25
|
-
* @example <caption>Imaginary website under test</caption>
|
|
26
|
-
* <body>
|
|
27
|
-
* <ul id="basket">
|
|
28
|
-
* <li><a href="#">Apple</a></li>
|
|
29
|
-
* <li><a href="#">Banana</a></li>
|
|
30
|
-
* <li><a href="#">Coconut</a></li>
|
|
31
|
-
* <li><a href="#" class="has-discount">Date</a></li>
|
|
32
|
-
* </ul>
|
|
33
|
-
* <div id="summary">
|
|
34
|
-
* <strong class="out-of-stock">Coconut</strong> is not available
|
|
35
|
-
* </div>
|
|
36
|
-
* <button type="submit">Proceed to Checkout</button>
|
|
37
|
-
* </body>
|
|
38
|
-
*
|
|
39
|
-
* @example <caption>Locating a single element</caption>
|
|
40
|
-
* import { by, Target, TargetElement } from '@serenity-js/webdriverio';
|
|
41
|
-
*
|
|
42
|
-
* const proceedToCheckoutButton: TargetElement =
|
|
43
|
-
* Target.the('Proceed to Checkout button').located(by.css(`button[type='submit']`));
|
|
44
|
-
*
|
|
45
|
-
* @example <caption>Locating multiple elements</caption>
|
|
46
|
-
* import { by, Target, TargetElements } from '@serenity-js/webdriverio';
|
|
47
|
-
*
|
|
48
|
-
* const basketItems: TargetElements =
|
|
49
|
-
* Target.all('items in the basket').located(by.css('ul#basket li'));
|
|
50
|
-
*
|
|
51
|
-
* @example <caption>Locating element relative to another element</caption>
|
|
52
|
-
* import { by, Target, TargetElement } from '@serenity-js/webdriverio';
|
|
53
|
-
*
|
|
54
|
-
* const summary: TargetElement =
|
|
55
|
-
* Target.the('summary').located(by.id('message'));
|
|
56
|
-
*
|
|
57
|
-
* const outOfStockItem: TargetElement =
|
|
58
|
-
* Target.the('out of stock item').of(summary).located(by.css('.out-of-stock'))
|
|
59
|
-
*
|
|
60
|
-
* @example <caption>Filtering elements matched by a locator</caption>
|
|
61
|
-
* import { by, Target, Text } from '@serenity-js/webdriverio';
|
|
62
|
-
* import { endsWith } from '@serenity-js/assertions';
|
|
63
|
-
*
|
|
64
|
-
* const basketItems =
|
|
65
|
-
* Target.all('items in the basket').located(by.css('ul#basket li'))
|
|
66
|
-
* .where(Text, endsWith('e')); // Apple, Date
|
|
67
|
-
*
|
|
68
|
-
* @example <caption>Counting items matched by a locator</caption>
|
|
69
|
-
* import { endsWith } from '@serenity-js/assertions';
|
|
70
|
-
* import { Question } from '@serenity-js/core';
|
|
71
|
-
* import { by, Target, Text } from '@serenity-js/webdriverio';
|
|
72
|
-
*
|
|
73
|
-
* const basketItemsCount: Question<Promise<number>> =
|
|
74
|
-
* Target.all('items in the basket').located(by.css('ul#basket li'))
|
|
75
|
-
* .count() // 4
|
|
76
|
-
*
|
|
77
|
-
* @example <caption>Getting first item matched by a locator</caption>
|
|
78
|
-
* import { Question } from '@serenity-js/core';
|
|
79
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
80
|
-
* import { Element } from 'webdriverio';
|
|
81
|
-
*
|
|
82
|
-
* const apple: Question<Promise<Element<'async'>>> =
|
|
83
|
-
* Target.all('items in the basket').located(by.css('ul#basket li'))
|
|
84
|
-
* .first()
|
|
85
|
-
*
|
|
86
|
-
* @example <caption>Getting last item matched by a locator</caption>
|
|
87
|
-
* import { Question } from '@serenity-js/core';
|
|
88
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
89
|
-
* import { endsWith } from '@serenity-js/assertions';
|
|
90
|
-
* import { Element } from 'webdriverio';
|
|
91
|
-
*
|
|
92
|
-
* const date: Question<Promise<Element<'async'>>> =
|
|
93
|
-
* Target.all('items in the basket').located(by.css('ul#basket li'))
|
|
94
|
-
* .last()
|
|
95
|
-
*
|
|
96
|
-
* @example <caption>Getting nth item matched by a locator</caption>
|
|
97
|
-
* import { Question } from '@serenity-js/core';
|
|
98
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
99
|
-
* import { Element } from 'webdriverio';
|
|
100
|
-
*
|
|
101
|
-
* const banana: Question<Promise<Element<'async'>>> =
|
|
102
|
-
* Target.all('items in the basket').located(by.css('ul#basket li'))
|
|
103
|
-
* .get(1)
|
|
104
|
-
*
|
|
105
|
-
* @example <caption>Using multiple filters and nested targets</caption>
|
|
106
|
-
* import { Question } from '@serenity-js/core';
|
|
107
|
-
* import { contain, endsWith } from '@serenity-js/assertions';
|
|
108
|
-
* import { by, CSSClasses, Target, Text } from '@serenity-js/webdriverio';
|
|
109
|
-
* import { Element } from 'webdriverio';
|
|
110
|
-
*
|
|
111
|
-
* class Basket {
|
|
112
|
-
* static component = Target.the('basket').located(by.id('basket'));
|
|
113
|
-
*
|
|
114
|
-
* static items = Target.all('items').located(by.css('li'))
|
|
115
|
-
* .of(Basket.component);
|
|
116
|
-
*
|
|
117
|
-
* static link = Target.the('link').located(by.css('a'));
|
|
118
|
-
* }
|
|
119
|
-
*
|
|
120
|
-
* const date: Question<Promise<Element<'async'>>> =
|
|
121
|
-
* Basket.items
|
|
122
|
-
* .where(Text, endsWith('e'))
|
|
123
|
-
* .where(CSSClasses.of(Basket.link), contain('has-discount'))
|
|
124
|
-
* .first()
|
|
125
|
-
*
|
|
126
|
-
* @example <caption>Clicking on an element</caption>
|
|
127
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
128
|
-
* import { BrowseTheWeb, Click } from '@serenity-js/webdriverio';
|
|
129
|
-
*
|
|
130
|
-
* actorCalled('Jane')
|
|
131
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
132
|
-
* .attemptsTo(
|
|
133
|
-
* Click.on(proceedToCheckoutButton),
|
|
134
|
-
* );
|
|
135
|
-
*
|
|
136
|
-
* @example <caption>Retrieving text of multiple elements and performing an assertion</caption>
|
|
137
|
-
* import { Ensure, contain } from '@serenity-js/assertions';
|
|
138
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
139
|
-
* import { BrowseTheWeb, Text } from '@serenity-js/webdriverio';
|
|
140
|
-
*
|
|
141
|
-
* const basketItemNames = Text.ofAll(basketItems);
|
|
142
|
-
*
|
|
143
|
-
* actorCalled('Jane')
|
|
144
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
145
|
-
* .attemptsTo(
|
|
146
|
-
* Ensure.that(basketItemNames, contain('Apple'))
|
|
147
|
-
* );
|
|
148
|
-
*
|
|
149
|
-
* @example <caption>Waiting on an element</caption>
|
|
150
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
151
|
-
* import { BrowseTheWeb, Wait, isClickable } from '@serenity-js/webdriverio';
|
|
152
|
-
*
|
|
153
|
-
* actorCalled('Jane')
|
|
154
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
155
|
-
* .attemptsTo(
|
|
156
|
-
* Wait.until(proceedToCheckoutButton, isClickable()),
|
|
157
|
-
* );
|
|
158
|
-
*/
|
|
159
|
-
export declare class Target {
|
|
160
|
-
/**
|
|
161
|
-
* @desc
|
|
162
|
-
* Locates a single Web element
|
|
163
|
-
*
|
|
164
|
-
* @param {string} description
|
|
165
|
-
* A human-readable name of the element, which will be used in the report
|
|
166
|
-
*
|
|
167
|
-
* @returns {TargetBuilder<TargetElement> & NestedTargetBuilder<TargetNestedElement>}
|
|
168
|
-
*/
|
|
169
|
-
static the(description: string): TargetBuilder<TargetElement> & NestedTargetBuilder<TargetNestedElement>;
|
|
170
|
-
/**
|
|
171
|
-
* @desc
|
|
172
|
-
* Locates a group of Web elements
|
|
173
|
-
*
|
|
174
|
-
* @param {string} description
|
|
175
|
-
* A human-readable name of the group of elements, which will be used in the report
|
|
176
|
-
*
|
|
177
|
-
* @returns {TargetBuilder<TargetElements> & NestedTargetBuilder<TargetNestedElements>}
|
|
178
|
-
*/
|
|
179
|
-
static all(description: string): TargetBuilder<TargetElements> & NestedTargetBuilder<TargetNestedElements>;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* @desc
|
|
183
|
-
* You probably don't want to use this class directly. See {@link Target} instead.
|
|
184
|
-
*
|
|
185
|
-
* @extends {@serenity-js/core/lib/screenplay~Question}
|
|
186
|
-
* @implements {@serenity-js/core/lib/screenplay/questions~MetaQuestion}
|
|
187
|
-
*
|
|
188
|
-
* @see {@link Target}
|
|
189
|
-
*/
|
|
190
|
-
export declare class TargetElements extends Question<Promise<ElementArray>> implements MetaQuestion<Answerable<Element<'async'>>, Promise<ElementArray>> {
|
|
191
|
-
private readonly locator;
|
|
192
|
-
private readonly list;
|
|
193
|
-
constructor(description: string, locator: Locator);
|
|
194
|
-
of(parent: Answerable<Element<'async'>>): TargetNestedElements;
|
|
195
|
-
count(): Question<Promise<number>>;
|
|
196
|
-
first(): Question<Promise<Element<'async'>>>;
|
|
197
|
-
last(): Question<Promise<Element<'async'>>>;
|
|
198
|
-
get(index: number): Question<Promise<Element<'async'>>>;
|
|
199
|
-
where<Answer_Type>(question: MetaQuestion<Answerable<Element<'async'>>, Promise<Answer_Type> | Answer_Type>, expectation: Expectation<any, Answer_Type>): TargetList;
|
|
200
|
-
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<ElementArray>;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* @desc
|
|
204
|
-
* You probably don't want to use this class directly. See {@link Target} instead.
|
|
205
|
-
*
|
|
206
|
-
* @extends {@serenity-js/core/lib/screenplay~Question}
|
|
207
|
-
* @implements {@serenity-js/core/lib/screenplay/questions~MetaQuestion}
|
|
208
|
-
*
|
|
209
|
-
* @see {@link Target}
|
|
210
|
-
*/
|
|
211
|
-
export declare class TargetNestedElements extends Question<Promise<ElementArray>> implements MetaQuestion<Answerable<Element<'async'>>, Promise<ElementArray>> {
|
|
212
|
-
private readonly parent;
|
|
213
|
-
private readonly children;
|
|
214
|
-
private readonly list;
|
|
215
|
-
constructor(parent: Answerable<Element<'async'>>, children: Answerable<ElementArray>);
|
|
216
|
-
of(parent: Answerable<Element<'async'>>): Question<Promise<ElementArray>>;
|
|
217
|
-
count(): Question<Promise<number>>;
|
|
218
|
-
first(): Question<Promise<Element<'async'>>>;
|
|
219
|
-
last(): Question<Promise<Element<'async'>>>;
|
|
220
|
-
get(index: number): Question<Promise<Element<'async'>>>;
|
|
221
|
-
where<Answer_Type>(question: MetaQuestion<Answerable<Element<'async'>>, Promise<Answer_Type> | Answer_Type>, expectation: Expectation<any, Answer_Type>): TargetList;
|
|
222
|
-
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<ElementArray>;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* @desc
|
|
226
|
-
* You probably don't want to use this class directly. See {@link Target} instead.
|
|
227
|
-
*
|
|
228
|
-
* @extends {@serenity-js/core/lib/screenplay~Question}
|
|
229
|
-
* @implements {@serenity-js/core/lib/screenplay/questions~MetaQuestion}
|
|
230
|
-
*
|
|
231
|
-
* @see {@link Target}
|
|
232
|
-
*/
|
|
233
|
-
export declare class TargetElement extends Question<Promise<Element<'async'>>> implements MetaQuestion<Answerable<Element<'async'>>, Promise<Element<'async'>>> {
|
|
234
|
-
private readonly locator;
|
|
235
|
-
constructor(description: string, locator: Locator);
|
|
236
|
-
of(parent: Answerable<Element<'async'>>): Question<Promise<Element<'async'>>>;
|
|
237
|
-
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<Element<'async'>>;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* @desc
|
|
241
|
-
* You probably don't want to use this class directly. See {@link Target} instead.
|
|
242
|
-
*
|
|
243
|
-
* @extends {@serenity-js/core/lib/screenplay~Question}
|
|
244
|
-
* @implements {@serenity-js/core/lib/screenplay/questions~MetaQuestion}
|
|
245
|
-
*
|
|
246
|
-
* @see {@link Target}
|
|
247
|
-
*/
|
|
248
|
-
export declare class TargetNestedElement extends Question<Promise<Element<'async'>>> implements MetaQuestion<Answerable<Element<'async'>>, Promise<Element<'async'>>> {
|
|
249
|
-
private readonly parent;
|
|
250
|
-
private readonly child;
|
|
251
|
-
constructor(parent: Answerable<Element<'async'>>, child: Answerable<Element<'async'>>);
|
|
252
|
-
of(parent: Answerable<Element<'async'>>): Question<Promise<Element<'async'>>>;
|
|
253
|
-
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<Element<'async'>>;
|
|
254
|
-
}
|