@rnw-community/wdio 0.26.0 → 0.26.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/dist/component/component/component.d.ts +19 -0
- package/dist/component/component/component.d.ts.map +1 -0
- package/dist/component/component/component.js +258 -0
- package/dist/component/component/component.js.map +1 -0
- package/dist/component/create-component/create-component.d.ts +3 -0
- package/dist/component/create-component/create-component.d.ts.map +1 -0
- package/dist/component/create-component/create-component.js +9 -0
- package/dist/component/create-component/create-component.js.map +1 -0
- package/dist/component/create-rooted-component/create-rooted-component.d.ts +3 -0
- package/dist/component/create-rooted-component/create-rooted-component.d.ts.map +1 -0
- package/dist/component/create-rooted-component/create-rooted-component.js +7 -0
- package/dist/component/create-rooted-component/create-rooted-component.js.map +1 -0
- package/dist/component/element.mock.d.ts +14 -0
- package/dist/component/element.mock.d.ts.map +1 -0
- package/dist/component/element.mock.js +29 -0
- package/dist/component/element.mock.js.map +1 -0
- package/dist/component/get-component/get-component.d.ts +5 -0
- package/dist/component/get-component/get-component.d.ts.map +1 -0
- package/dist/component/get-component/get-component.js +41 -0
- package/dist/component/get-component/get-component.js.map +1 -0
- package/dist/component/get-rooted-component/get-rooted-component.d.ts +5 -0
- package/dist/component/get-rooted-component/get-rooted-component.d.ts.map +1 -0
- package/dist/component/get-rooted-component/get-rooted-component.js +50 -0
- package/dist/component/get-rooted-component/get-rooted-component.js.map +1 -0
- package/dist/component/index.d.ts +6 -1
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/index.js +13 -15
- package/dist/component/index.js.map +1 -1
- package/dist/component/rooted-component/rooted-component.d.ts +19 -0
- package/dist/component/rooted-component/rooted-component.d.ts.map +1 -0
- package/dist/component/rooted-component/rooted-component.js +218 -0
- package/dist/component/rooted-component/rooted-component.js.map +1 -0
- package/dist/component/visible.component.d.ts.map +1 -1
- package/dist/type/component-with-selectors.type.d.ts +7 -0
- package/dist/type/component-with-selectors.type.d.ts.map +1 -0
- package/dist/type/component-with-selectors.type.js +3 -0
- package/dist/type/component-with-selectors.type.js.map +1 -0
- package/dist/type/index.d.ts +1 -2
- package/dist/type/index.d.ts.map +1 -1
- package/dist/type/selector-object.type.d.ts +4 -0
- package/dist/type/selector-object.type.d.ts.map +1 -1
- package/dist/type/visible-component-with-selectors.type.d.ts.map +1 -1
- package/dist/util/get-visible-component.util.d.ts +12 -0
- package/dist/util/get-visible-component.util.d.ts.map +1 -0
- package/dist/util/get-visible-component.util.js +63 -0
- package/dist/util/get-visible-component.util.js.map +1 -0
- package/dist/util/index.d.ts +0 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +1 -5
- package/dist/util/index.js.map +1 -1
- package/dist/visible-component/component/component.d.ts +19 -0
- package/dist/visible-component/component/component.d.ts.map +1 -0
- package/dist/visible-component/component/component.js +258 -0
- package/dist/visible-component/component/component.js.map +1 -0
- package/dist/visible-component/create-component/create-component.d.ts +3 -0
- package/dist/visible-component/create-component/create-component.d.ts.map +1 -0
- package/dist/visible-component/create-component/create-component.js +9 -0
- package/dist/visible-component/create-component/create-component.js.map +1 -0
- package/dist/visible-component/create-rooted-component/create-rooted-component.d.ts +3 -0
- package/dist/visible-component/create-rooted-component/create-rooted-component.d.ts.map +1 -0
- package/dist/visible-component/create-rooted-component/create-rooted-component.js +7 -0
- package/dist/visible-component/create-rooted-component/create-rooted-component.js.map +1 -0
- package/dist/visible-component/get-component/get-component.d.ts +5 -0
- package/dist/visible-component/get-component/get-component.d.ts.map +1 -0
- package/dist/visible-component/get-component/get-component.js +41 -0
- package/dist/visible-component/get-component/get-component.js.map +1 -0
- package/dist/visible-component/get-rooted-component/get-rooted-component.d.ts +5 -0
- package/dist/visible-component/get-rooted-component/get-rooted-component.d.ts.map +1 -0
- package/dist/visible-component/get-rooted-component/get-rooted-component.js +50 -0
- package/dist/visible-component/get-rooted-component/get-rooted-component.js.map +1 -0
- package/dist/visible-component/index.d.ts +7 -0
- package/dist/visible-component/index.d.ts.map +1 -0
- package/dist/visible-component/index.js +16 -0
- package/dist/visible-component/index.js.map +1 -0
- package/dist/visible-component/mocks.d.ts +14 -0
- package/dist/visible-component/mocks.d.ts.map +1 -0
- package/dist/visible-component/mocks.js +29 -0
- package/dist/visible-component/mocks.js.map +1 -0
- package/dist/visible-component/rooted-component/rooted-component.d.ts +19 -0
- package/dist/visible-component/rooted-component/rooted-component.d.ts.map +1 -0
- package/dist/visible-component/rooted-component/rooted-component.js +218 -0
- package/dist/visible-component/rooted-component/rooted-component.js.map +1 -0
- package/dist/wdio.d.ts +25 -0
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="webdriverio/async" />
|
|
2
|
+
import type { Enum, SelectorObject, SetValueArgs, WaitForDisplayedArgs, WaitForEnabledArgs, WaitForExistArgs } from '../../type';
|
|
3
|
+
export declare class Component {
|
|
4
|
+
clickChildEl(selector: string): Promise<void>;
|
|
5
|
+
clickByIdxChildEl(selector: string, idx: number): Promise<void>;
|
|
6
|
+
setValueChildEl(selector: string, args: SetValueArgs): Promise<void>;
|
|
7
|
+
isDisplayedChildEl(selector: string): Promise<boolean>;
|
|
8
|
+
isExistingChildEl(selector: string): Promise<boolean>;
|
|
9
|
+
getTextChildEl(selector: string): Promise<string>;
|
|
10
|
+
waitForExistsChildEl(selector: string, args: WaitForExistArgs): Promise<void>;
|
|
11
|
+
waitForDisplayedChildEl(selector: string, args: WaitForDisplayedArgs): Promise<void>;
|
|
12
|
+
waitForEnabledChildEl(selector: string, args: WaitForEnabledArgs): Promise<void>;
|
|
13
|
+
getChildEl(selector: string): Promise<WebdriverIO.Element>;
|
|
14
|
+
getChildEls(selector: string): Promise<WebdriverIO.ElementArray>;
|
|
15
|
+
getChildElByIdx(selector: string, idx: number): Promise<WebdriverIO.Element>;
|
|
16
|
+
protected getSelectorObject(selectorValue: string): SelectorObject;
|
|
17
|
+
protected callDynamicMethod<T extends string>(selectors: Enum<T>, field: string): unknown;
|
|
18
|
+
}
|
|
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AAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;IAIlF,SAAS,CAAC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc;IAkBlE,SAAS,CAAC,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;CAsB5F"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Component = void 0;
|
|
40
|
+
var shared_1 = require("@rnw-community/shared");
|
|
41
|
+
var command_1 = require("../../command");
|
|
42
|
+
var Component = /** @class */ (function () {
|
|
43
|
+
function Component() {
|
|
44
|
+
}
|
|
45
|
+
Component.prototype.clickChildEl = function (selector) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
return __generator(this, function (_a) {
|
|
48
|
+
switch (_a.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
50
|
+
case 1: return [4 /*yield*/, (_a.sent()).click()];
|
|
51
|
+
case 2:
|
|
52
|
+
_a.sent();
|
|
53
|
+
return [2 /*return*/];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
Component.prototype.clickByIdxChildEl = function (selector, idx) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
+
return __generator(this, function (_a) {
|
|
61
|
+
switch (_a.label) {
|
|
62
|
+
case 0: return [4 /*yield*/, this.getChildElByIdx(selector, idx)];
|
|
63
|
+
case 1: return [4 /*yield*/, (_a.sent()).click()];
|
|
64
|
+
case 2:
|
|
65
|
+
_a.sent();
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
Component.prototype.setValueChildEl = function (selector, args) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
var _a;
|
|
74
|
+
return __generator(this, function (_b) {
|
|
75
|
+
switch (_b.label) {
|
|
76
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
77
|
+
case 1: return [4 /*yield*/, (_a = (_b.sent())).setValue.apply(_a, args)];
|
|
78
|
+
case 2:
|
|
79
|
+
_b.sent();
|
|
80
|
+
return [2 /*return*/];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
Component.prototype.isDisplayedChildEl = function (selector) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
+
return __generator(this, function (_a) {
|
|
88
|
+
switch (_a.label) {
|
|
89
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
90
|
+
case 1: return [4 /*yield*/, (_a.sent()).isDisplayed()];
|
|
91
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
Component.prototype.isExistingChildEl = function (selector) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
101
|
+
case 1: return [4 /*yield*/, (_a.sent()).isExisting()];
|
|
102
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
Component.prototype.getTextChildEl = function (selector) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
switch (_a.label) {
|
|
111
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
112
|
+
case 1: return [4 /*yield*/, (_a.sent()).getText()];
|
|
113
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
Component.prototype.waitForExistsChildEl = function (selector, args) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
120
|
+
var _a;
|
|
121
|
+
return __generator(this, function (_b) {
|
|
122
|
+
switch (_b.label) {
|
|
123
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
124
|
+
case 1: return [4 /*yield*/, (_a = (_b.sent())).waitForExist.apply(_a, args)];
|
|
125
|
+
case 2:
|
|
126
|
+
_b.sent();
|
|
127
|
+
return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
Component.prototype.waitForDisplayedChildEl = function (selector, args) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
var _a;
|
|
135
|
+
return __generator(this, function (_b) {
|
|
136
|
+
switch (_b.label) {
|
|
137
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
138
|
+
case 1: return [4 /*yield*/, (_a = (_b.sent())).waitForDisplayed.apply(_a, args)];
|
|
139
|
+
case 2:
|
|
140
|
+
_b.sent();
|
|
141
|
+
return [2 /*return*/];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
Component.prototype.waitForEnabledChildEl = function (selector, args) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
148
|
+
var _a;
|
|
149
|
+
return __generator(this, function (_b) {
|
|
150
|
+
switch (_b.label) {
|
|
151
|
+
case 0: return [4 /*yield*/, this.getChildEl(selector)];
|
|
152
|
+
case 1: return [4 /*yield*/, (_a = (_b.sent())).waitForEnabled.apply(_a, args)];
|
|
153
|
+
case 2:
|
|
154
|
+
_b.sent();
|
|
155
|
+
return [2 /*return*/];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
// eslint-disable-next-line class-methods-use-this
|
|
161
|
+
Component.prototype.getChildEl = function (selector) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0: return [4 /*yield*/, (0, command_1.testID$)(selector)];
|
|
166
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
// eslint-disable-next-line class-methods-use-this
|
|
172
|
+
Component.prototype.getChildEls = function (selector) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
+
return __generator(this, function (_a) {
|
|
175
|
+
switch (_a.label) {
|
|
176
|
+
case 0: return [4 /*yield*/, (0, command_1.testID$$)(selector)];
|
|
177
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
// eslint-disable-next-line class-methods-use-this
|
|
183
|
+
Component.prototype.getChildElByIdx = function (selector, idx) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
return __generator(this, function (_a) {
|
|
186
|
+
switch (_a.label) {
|
|
187
|
+
case 0: return [4 /*yield*/, (0, command_1.testID$$Index)(selector, idx)];
|
|
188
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
Component.prototype.getSelectorObject = function (selectorValue) {
|
|
194
|
+
var _this = this;
|
|
195
|
+
return {
|
|
196
|
+
el: function () { return _this.getChildEl(selectorValue); },
|
|
197
|
+
els: function () { return _this.getChildEls(selectorValue); },
|
|
198
|
+
byIdx: function (idx) { return _this.getChildElByIdx(selectorValue, idx); },
|
|
199
|
+
waitForDisplayed: function () {
|
|
200
|
+
var args = [];
|
|
201
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
202
|
+
args[_i] = arguments[_i];
|
|
203
|
+
}
|
|
204
|
+
return _this.waitForDisplayedChildEl(selectorValue, args);
|
|
205
|
+
},
|
|
206
|
+
waitForExist: function () {
|
|
207
|
+
var args = [];
|
|
208
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
209
|
+
args[_i] = arguments[_i];
|
|
210
|
+
}
|
|
211
|
+
return _this.waitForExistsChildEl(selectorValue, args);
|
|
212
|
+
},
|
|
213
|
+
waitForEnabled: function () {
|
|
214
|
+
var args = [];
|
|
215
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
216
|
+
args[_i] = arguments[_i];
|
|
217
|
+
}
|
|
218
|
+
return _this.waitForEnabledChildEl(selectorValue, args);
|
|
219
|
+
},
|
|
220
|
+
setValue: function () {
|
|
221
|
+
var args = [];
|
|
222
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
223
|
+
args[_i] = arguments[_i];
|
|
224
|
+
}
|
|
225
|
+
return _this.setValueChildEl(selectorValue, args);
|
|
226
|
+
},
|
|
227
|
+
click: function () { return _this.clickChildEl(selectorValue); },
|
|
228
|
+
clickByIdx: function (idx) { return _this.clickByIdxChildEl(selectorValue, idx); },
|
|
229
|
+
getText: function () { return _this.getTextChildEl(selectorValue); },
|
|
230
|
+
isDisplayed: function () { return _this.isDisplayedChildEl(selectorValue); },
|
|
231
|
+
isExisting: function () { return _this.isExistingChildEl(selectorValue); },
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
// eslint-disable-next-line max-statements
|
|
235
|
+
Component.prototype.callDynamicMethod = function (selectors, field) {
|
|
236
|
+
var selectorKeys = Object.keys(selectors);
|
|
237
|
+
// TODO: This logic need improvement to avoid false positives
|
|
238
|
+
var selectorKey = selectorKeys.find(function (key) { return field.includes(key); });
|
|
239
|
+
if (!(0, shared_1.isDefined)(selectorKey)) {
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
var selectorValue = selectors[selectorKey];
|
|
243
|
+
var selectorObject = this.getSelectorObject(selectorValue);
|
|
244
|
+
if (field === selectorKey) {
|
|
245
|
+
return selectorObject;
|
|
246
|
+
}
|
|
247
|
+
else if (field.endsWith('Els')) {
|
|
248
|
+
return this.getChildEls(selectorValue);
|
|
249
|
+
}
|
|
250
|
+
else if (field.endsWith('El')) {
|
|
251
|
+
return this.getChildEl(selectorValue);
|
|
252
|
+
}
|
|
253
|
+
return undefined;
|
|
254
|
+
};
|
|
255
|
+
return Component;
|
|
256
|
+
}());
|
|
257
|
+
exports.Component = Component;
|
|
258
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/component/component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkD;AAElD,yCAAiE;AAWjE;IAAA;IA4FA,CAAC;IA3FS,gCAAY,GAAlB,UAAmB,QAAgB;;;;4BACxB,qBAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAA;4BAAtC,qBAAM,CAAC,SAA+B,CAAC,CAAC,KAAK,EAAE,EAAA;;wBAA/C,SAA+C,CAAC;;;;;KACnD;IAEK,qCAAiB,GAAvB,UAAwB,QAAgB,EAAE,GAAW;;;;4BAC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M,CAAC,IAAI,CAAC,SAAS,CAAQ,CAAC;QACnD,6DAA6D;QAC7D,IAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAnB,CAAmB,CAAC,CAAC;QAElE,IAAI,CAAC,IAAA,kBAAS,EAAC,WAAW,CAAC,EAAE;YACzB,OAAO,SAAS,CAAC;SACpB;QAED,IAAM,aAAa,GAAG,SAAS,CAAC,WAAW,CAAW,CAAC;QACvD,IAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QAE7D,IAAI,KAAK,KAAK,WAAW,EAAE;YACvB,OAAO,cAAc,CAAC;SACzB;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC9B,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;SAC1C;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;SACzC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IACL,gBAAC;AAAD,CAAC,AA5FD,IA4FC;AA5FY,8BAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-component.d.ts","sourceRoot":"","sources":["../../../src/component/create-component/create-component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE/D,eAAO,MAAM,eAAe,qEACU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createComponent = void 0;
|
|
4
|
+
var get_component_1 = require("../get-component/get-component");
|
|
5
|
+
var createComponent = function (selectors) {
|
|
6
|
+
return new ((0, get_component_1.getComponent)(selectors))();
|
|
7
|
+
};
|
|
8
|
+
exports.createComponent = createComponent;
|
|
9
|
+
//# sourceMappingURL=create-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-component.js","sourceRoot":"","sources":["../../../src/component/create-component/create-component.ts"],"names":[],"mappings":";;;AAAA,gEAA8D;AAIvD,IAAM,eAAe,GAAG,UAAmB,SAAkB;IAChE,OAAA,IAAI,CAAC,IAAA,4BAAY,EAAI,SAAS,CAAC,CAAC,EAAE;AAAlC,CAAkC,CAAC;AAD1B,QAAA,eAAe,mBACW"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ComponentWithSelectors, Enum } from '../../type';
|
|
2
|
+
export declare const createRootedComponent: <T extends string>(selectors: Enum<T>, selectorOrElement?: WebdriverIO.Element | string) => ComponentWithSelectors<T>;
|
|
3
|
+
//# sourceMappingURL=create-rooted-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-rooted-component.d.ts","sourceRoot":"","sources":["../../../src/component/create-rooted-component/create-rooted-component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE/D,eAAO,MAAM,qBAAqB,6DAEV,YAAY,OAAO,GAAG,MAAM,8BACqC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRootedComponent = void 0;
|
|
4
|
+
var get_rooted_component_1 = require("../get-rooted-component/get-rooted-component");
|
|
5
|
+
var createRootedComponent = function (selectors, selectorOrElement) { return new ((0, get_rooted_component_1.getRootedComponent)(selectors))(selectorOrElement); };
|
|
6
|
+
exports.createRootedComponent = createRootedComponent;
|
|
7
|
+
//# sourceMappingURL=create-rooted-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-rooted-component.js","sourceRoot":"","sources":["../../../src/component/create-rooted-component/create-rooted-component.ts"],"names":[],"mappings":";;;AAAA,qFAAkF;AAI3E,IAAM,qBAAqB,GAAG,UACjC,SAAkB,EAClB,iBAAgD,IACpB,OAAA,IAAI,CAAC,IAAA,yCAAkB,EAAI,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAzD,CAAyD,CAAC;AAH7E,QAAA,qBAAqB,yBAGwD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const mockElement: {
|
|
2
|
+
click: any;
|
|
3
|
+
testID$: any;
|
|
4
|
+
testID$$: any;
|
|
5
|
+
testID$$Index: any;
|
|
6
|
+
getText: any;
|
|
7
|
+
isDisplayed: any;
|
|
8
|
+
isExisting: any;
|
|
9
|
+
waitForExist: any;
|
|
10
|
+
waitForDisplayed: any;
|
|
11
|
+
waitForEnabled: any;
|
|
12
|
+
setValue: any;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=element.mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.mock.d.ts","sourceRoot":"","sources":["../../src/component/element.mock.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,WAAW;;;;;;;;;;;;CAMvB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.mockElement = void 0;
|
|
15
|
+
var elementMethods = {
|
|
16
|
+
testID$: jest.fn(function () { return Promise.resolve({}); }),
|
|
17
|
+
testID$$: jest.fn(function () { return Promise.resolve([{}]); }),
|
|
18
|
+
testID$$Index: jest.fn(function () { return Promise.resolve({}); }),
|
|
19
|
+
click: jest.fn(function () { return Promise.resolve(void 0); }),
|
|
20
|
+
getText: jest.fn(function () { return Promise.resolve(''); }),
|
|
21
|
+
isDisplayed: jest.fn(function () { return Promise.resolve(true); }),
|
|
22
|
+
isExisting: jest.fn(function () { return Promise.resolve(true); }),
|
|
23
|
+
waitForExist: jest.fn(function () { return Promise.resolve(void 0); }),
|
|
24
|
+
waitForDisplayed: jest.fn(function () { return Promise.resolve(void 0); }),
|
|
25
|
+
waitForEnabled: jest.fn(function () { return Promise.resolve(void 0); }),
|
|
26
|
+
setValue: jest.fn(function () { return Promise.resolve(void 0); }),
|
|
27
|
+
};
|
|
28
|
+
exports.mockElement = __assign(__assign({}, elementMethods), { click: jest.fn(function () { return Promise.resolve(void 0); }), testID$: jest.fn(function () { return Promise.resolve(elementMethods); }), testID$$: jest.fn(function () { return Promise.resolve([elementMethods]); }), testID$$Index: jest.fn(function () { return Promise.resolve(elementMethods); }) });
|
|
29
|
+
//# sourceMappingURL=element.mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.mock.js","sourceRoot":"","sources":["../../src/component/element.mock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,IAAM,cAAc,GAAG;IACnB,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAnB,CAAmB,CAAC;IAC3C,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAArB,CAAqB,CAAC;IAC9C,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAnB,CAAmB,CAAC;IACjD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AM,OAAA,OAAO,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,EAAjC,CAAiC,CAAC,EAC1D,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,EAA/B,CAA+B,CAAC,IAC/D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentWithSelectors, Enum } from '../../type';
|
|
2
|
+
declare type ComponentWithSelectorsCtor<T extends string> = new (selectorOrElement?: WebdriverIO.Element | string) => ComponentWithSelectors<T>;
|
|
3
|
+
export declare const getComponent: <T extends string>(selectors: Enum<T>) => ComponentWithSelectorsCtor<T>;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=get-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-component.d.ts","sourceRoot":"","sources":["../../../src/component/get-component/get-component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE/D,aAAK,0BAA0B,CAAC,CAAC,SAAS,MAAM,IAAI,KAChD,iBAAiB,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,MAAM,KAC/C,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE/B,eAAO,MAAM,YAAY,yEAkBpB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.getComponent = void 0;
|
|
19
|
+
var component_1 = require("../component/component");
|
|
20
|
+
var getComponent = function (selectors) {
|
|
21
|
+
// @ts-expect-error We use proxy for dynamic fields
|
|
22
|
+
return /** @class */ (function (_super) {
|
|
23
|
+
__extends(class_1, _super);
|
|
24
|
+
function class_1() {
|
|
25
|
+
var _this = _super.call(this) || this;
|
|
26
|
+
// eslint-disable-next-line no-constructor-return
|
|
27
|
+
return new Proxy(_this, {
|
|
28
|
+
get: function (client, field, receiver) {
|
|
29
|
+
if (field in client) {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
31
|
+
return Reflect.get(client, field, receiver);
|
|
32
|
+
}
|
|
33
|
+
return client.callDynamicMethod(selectors, field);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return class_1;
|
|
38
|
+
}(component_1.Component));
|
|
39
|
+
};
|
|
40
|
+
exports.getComponent = getComponent;
|
|
41
|
+
//# sourceMappingURL=get-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-component.js","sourceRoot":"","sources":["../../../src/component/get-component/get-component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oDAAmD;AAQ5C,IAAM,YAAY,GAAG,UAAmB,SAAkB;IAC7D,mDAAmD;IACnD;QAAc,2BAAS;QACnB;YAAA,YACI,iBAAO,SAaV;YAXG,iDAAiD;YACjD,OAAO,IAAI,KAAK,CAAC,KAAI,EAAE;gBACnB,GAAG,EAAH,UAAI,MAAM,EAAE,KAAQ,EAAE,QAAQ;oBAC1B,IAAI,KAAK,IAAI,MAAM,EAAE;wBACjB,+DAA+D;wBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;qBAC/C;oBAED,OAAO,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBACtD,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;QACL,cAAC;IAAD,CAAC,AAhBD,CAAc,qBAAS;AAAvB,CAgBC,CAAC;AAlBO,QAAA,YAAY,gBAkBnB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentWithSelectors, Enum } from '../../type';
|
|
2
|
+
declare type RootedComponentWithSelectorsCtor<T extends string> = new (selectorOrElement?: WebdriverIO.Element | string) => ComponentWithSelectors<T>;
|
|
3
|
+
export declare const getRootedComponent: <T extends string>(selectors: Enum<T>) => RootedComponentWithSelectorsCtor<T>;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=get-rooted-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-rooted-component.d.ts","sourceRoot":"","sources":["../../../src/component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE/D,aAAK,gCAAgC,CAAC,CAAC,SAAS,MAAM,IAAI,KACtD,iBAAiB,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,MAAM,KAC/C,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE/B,eAAO,MAAM,kBAAkB,+EA4B1B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.getRootedComponent = void 0;
|
|
19
|
+
var shared_1 = require("@rnw-community/shared");
|
|
20
|
+
var rooted_component_1 = require("../rooted-component/rooted-component");
|
|
21
|
+
var getRootedComponent = function (selectors) {
|
|
22
|
+
// @ts-expect-error We use proxy for dynamic fields
|
|
23
|
+
return /** @class */ (function (_super) {
|
|
24
|
+
__extends(class_1, _super);
|
|
25
|
+
function class_1(selectorOrElement) {
|
|
26
|
+
var _this = this;
|
|
27
|
+
var selectorKeys = Object.keys(selectors);
|
|
28
|
+
var rootSelectorKey = selectorKeys.find(function (key) { return key === 'Root'; });
|
|
29
|
+
var selectorRootKey = (0, shared_1.isDefined)(rootSelectorKey) ? selectors[rootSelectorKey] : undefined;
|
|
30
|
+
var rootSelector = (0, shared_1.isDefined)(selectorOrElement) ? selectorOrElement : selectorRootKey;
|
|
31
|
+
if (!(0, shared_1.isDefined)(rootSelector)) {
|
|
32
|
+
throw new Error('Cannot create RootedVisibleComponent - Neither root selector not root element is passed');
|
|
33
|
+
}
|
|
34
|
+
_this = _super.call(this, rootSelector) || this;
|
|
35
|
+
// eslint-disable-next-line no-constructor-return
|
|
36
|
+
return new Proxy(_this, {
|
|
37
|
+
get: function (client, field, receiver) {
|
|
38
|
+
if (field in client) {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
40
|
+
return Reflect.get(client, field, receiver);
|
|
41
|
+
}
|
|
42
|
+
return client.callDynamicMethod(selectors, field);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return class_1;
|
|
47
|
+
}(rooted_component_1.RootedComponent));
|
|
48
|
+
};
|
|
49
|
+
exports.getRootedComponent = getRootedComponent;
|
|
50
|
+
//# sourceMappingURL=get-rooted-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-rooted-component.js","sourceRoot":"","sources":["../../../src/component/get-rooted-component/get-rooted-component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gDAAkD;AAElD,yEAAuE;AAQhE,IAAM,kBAAkB,GAAG,UAAmB,SAAkB;IACnE,mDAAmD;IACnD;QAAc,2BAAe;QACzB,iBAAY,iBAA+C;YAA3D,iBAwBC;YAvBG,IAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAQ,CAAC;YAEnD,IAAM,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,KAAK,MAAM,EAAd,CAAc,CAAC,CAAC;YACjE,IAAM,eAAe,GAAG,IAAA,kBAAS,EAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5F,IAAM,YAAY,GAAG,IAAA,kBAAS,EAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,CAAC;YAExF,IAAI,CAAC,IAAA,kBAAS,EAAC,YAAY,CAAC,EAAE;gBAC1B,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC,CAAC;aAC9G;oBAED,kBAAM,YAAY,CAAC;YAEnB,iDAAiD;YACjD,OAAO,IAAI,KAAK,CAAC,KAAI,EAAE;gBACnB,GAAG,EAAH,UAAI,MAAM,EAAE,KAAQ,EAAE,QAAQ;oBAC1B,IAAI,KAAK,IAAI,MAAM,EAAE;wBACjB,+DAA+D;wBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;qBAC/C;oBAED,OAAO,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBACtD,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;QACL,cAAC;IAAD,CAAC,AA1BD,CAAc,kCAAe;AAA7B,CA0BC,CAAC;AA5BO,QAAA,kBAAkB,sBA4BzB"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { Component } from './component/component';
|
|
2
|
+
export { getComponent } from './get-component/get-component';
|
|
3
|
+
export { createComponent } from './create-component/create-component';
|
|
4
|
+
export { RootedComponent } from './rooted-component/rooted-component';
|
|
5
|
+
export { getRootedComponent } from './get-rooted-component/get-rooted-component';
|
|
6
|
+
export { createRootedComponent } from './create-rooted-component/create-rooted-component';
|
|
2
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC"}
|
package/dist/component/index.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
3
|
+
exports.createRootedComponent = exports.getRootedComponent = exports.RootedComponent = exports.createComponent = exports.getComponent = exports.Component = void 0;
|
|
4
|
+
var component_1 = require("./component/component");
|
|
5
|
+
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return component_1.Component; } });
|
|
6
|
+
var get_component_1 = require("./get-component/get-component");
|
|
7
|
+
Object.defineProperty(exports, "getComponent", { enumerable: true, get: function () { return get_component_1.getComponent; } });
|
|
8
|
+
var create_component_1 = require("./create-component/create-component");
|
|
9
|
+
Object.defineProperty(exports, "createComponent", { enumerable: true, get: function () { return create_component_1.createComponent; } });
|
|
10
|
+
var rooted_component_1 = require("./rooted-component/rooted-component");
|
|
11
|
+
Object.defineProperty(exports, "RootedComponent", { enumerable: true, get: function () { return rooted_component_1.RootedComponent; } });
|
|
12
|
+
var get_rooted_component_1 = require("./get-rooted-component/get-rooted-component");
|
|
13
|
+
Object.defineProperty(exports, "getRootedComponent", { enumerable: true, get: function () { return get_rooted_component_1.getRootedComponent; } });
|
|
14
|
+
var create_rooted_component_1 = require("./create-rooted-component/create-rooted-component");
|
|
15
|
+
Object.defineProperty(exports, "createRootedComponent", { enumerable: true, get: function () { return create_rooted_component_1.createRootedComponent; } });
|
|
18
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/component/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,sGAAA,SAAS,OAAA;AAClB,+DAA6D;AAApD,6GAAA,YAAY,OAAA;AACrB,wEAAsE;AAA7D,mHAAA,eAAe,OAAA;AAExB,wEAAsE;AAA7D,mHAAA,eAAe,OAAA;AACxB,oFAAiF;AAAxE,0HAAA,kBAAkB,OAAA;AAC3B,6FAA0F;AAAjF,gIAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="webdriverio/async" />
|
|
2
|
+
import { Component } from '../component/component';
|
|
3
|
+
import type { WaitForDisplayedArgs, WaitForEnabledArgs, WaitForExistArgs } from '../../type';
|
|
4
|
+
export declare class RootedComponent extends Component {
|
|
5
|
+
private readonly constructorEl;
|
|
6
|
+
private readonly constructorSelector;
|
|
7
|
+
constructor(selectorOrElement: WebdriverIO.Element | string);
|
|
8
|
+
get RootEl(): Promise<WebdriverIO.Element>;
|
|
9
|
+
waitForDisplayed(...args: WaitForDisplayedArgs): Promise<void>;
|
|
10
|
+
waitForEnabled(...args: WaitForEnabledArgs): Promise<void>;
|
|
11
|
+
waitForExist(...args: WaitForExistArgs): Promise<void>;
|
|
12
|
+
isDisplayed(): Promise<boolean>;
|
|
13
|
+
isExisting(): Promise<boolean>;
|
|
14
|
+
click(): Promise<void>;
|
|
15
|
+
getChildEl(selector: string): Promise<WebdriverIO.Element>;
|
|
16
|
+
getChildEls(selector: string): Promise<WebdriverIO.ElementArray>;
|
|
17
|
+
getChildElByIdx(selector: string, idx: number): Promise<WebdriverIO.Element>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=rooted-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooted-component.d.ts","sourceRoot":"","sources":["../../../src/component/rooted-component/rooted-component.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE7F,qBAAa,eAAgB,SAAQ,SAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkC;IAChE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAc;gBAEtC,iBAAiB,EAAE,WAAW,CAAC,OAAO,GAAG,MAAM;IAU3D,IAAI,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAMzC;IAEK,gBAAgB,CAAC,GAAG,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D,cAAc,CAAC,GAAG,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1D,YAAY,CAAC,GAAG,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAIb,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1D,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC;IAIhE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;CAG9F"}
|