@rnw-community/wdio 0.43.3 → 0.44.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/dist/cjs/component/component/component.d.ts +5 -16
- package/dist/cjs/component/component/component.d.ts.map +1 -1
- package/dist/cjs/component/component/component.js +22 -71
- package/dist/cjs/component/component/component.js.map +1 -1
- package/dist/cjs/component/component/get-exteded-component/get-extended-component.d.ts.map +1 -1
- package/dist/cjs/component/component/get-exteded-component/get-extended-component.js.map +1 -1
- package/dist/cjs/component/rooted-component/rooted-component.d.ts +4 -9
- package/dist/cjs/component/rooted-component/rooted-component.d.ts.map +1 -1
- package/dist/cjs/component/rooted-component/rooted-component.js +16 -18
- package/dist/cjs/component/rooted-component/rooted-component.js.map +1 -1
- package/dist/cjs/component/selector-element/selector-element.d.ts +24 -0
- package/dist/cjs/component/selector-element/selector-element.d.ts.map +1 -0
- package/dist/cjs/component/selector-element/selector-element.js +47 -0
- package/dist/cjs/component/selector-element/selector-element.js.map +1 -0
- package/dist/cjs/component/type/component-with-selectors.type.d.ts +2 -2
- package/dist/cjs/component/type/component-with-selectors.type.d.ts.map +1 -1
- package/dist/cjs/component/type/index.d.ts +0 -2
- package/dist/cjs/component/type/index.d.ts.map +1 -1
- package/dist/cjs/component/type/rooted-component-with-selectors.type.d.ts +2 -2
- package/dist/cjs/component/type/rooted-component-with-selectors.type.d.ts.map +1 -1
- package/dist/esm/component/component/component.d.ts +5 -16
- package/dist/esm/component/component/component.d.ts.map +1 -1
- package/dist/esm/component/component/component.js +22 -71
- package/dist/esm/component/component/component.js.map +1 -1
- package/dist/esm/component/component/get-exteded-component/get-extended-component.d.ts.map +1 -1
- package/dist/esm/component/component/get-exteded-component/get-extended-component.js.map +1 -1
- package/dist/esm/component/rooted-component/rooted-component.d.ts +4 -9
- package/dist/esm/component/rooted-component/rooted-component.d.ts.map +1 -1
- package/dist/esm/component/rooted-component/rooted-component.js +16 -18
- package/dist/esm/component/rooted-component/rooted-component.js.map +1 -1
- package/dist/esm/component/selector-element/selector-element.d.ts +24 -0
- package/dist/esm/component/selector-element/selector-element.d.ts.map +1 -0
- package/dist/esm/component/selector-element/selector-element.js +45 -0
- package/dist/esm/component/selector-element/selector-element.js.map +1 -0
- package/dist/esm/component/type/component-with-selectors.type.d.ts +2 -2
- package/dist/esm/component/type/component-with-selectors.type.d.ts.map +1 -1
- package/dist/esm/component/type/index.d.ts +0 -2
- package/dist/esm/component/type/index.d.ts.map +1 -1
- package/dist/esm/component/type/rooted-component-with-selectors.type.d.ts +2 -2
- package/dist/esm/component/type/rooted-component-with-selectors.type.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/command/by-index-command/by-index.command.d.ts +0 -3
- package/dist/cjs/command/by-index-command/by-index.command.d.ts.map +0 -1
- package/dist/cjs/command/by-index-command/by-index.command.js +0 -12
- package/dist/cjs/command/by-index-command/by-index.command.js.map +0 -1
- package/dist/cjs/component/type/selector-object.type.d.ts +0 -22
- package/dist/cjs/component/type/selector-object.type.d.ts.map +0 -1
- package/dist/cjs/component/type/selector-object.type.js +0 -3
- package/dist/cjs/component/type/selector-object.type.js.map +0 -1
- package/dist/cjs/component/type/wdio-types.type.d.ts +0 -6
- package/dist/cjs/component/type/wdio-types.type.d.ts.map +0 -1
- package/dist/cjs/component/type/wdio-types.type.js +0 -3
- package/dist/cjs/component/type/wdio-types.type.js.map +0 -1
- package/dist/esm/command/by-index-command/by-index.command.d.ts +0 -3
- package/dist/esm/command/by-index-command/by-index.command.d.ts.map +0 -1
- package/dist/esm/command/by-index-command/by-index.command.js +0 -8
- package/dist/esm/command/by-index-command/by-index.command.js.map +0 -1
- package/dist/esm/component/type/selector-object.type.d.ts +0 -22
- package/dist/esm/component/type/selector-object.type.d.ts.map +0 -1
- package/dist/esm/component/type/selector-object.type.js +0 -2
- package/dist/esm/component/type/selector-object.type.js.map +0 -1
- package/dist/esm/component/type/wdio-types.type.d.ts +0 -6
- package/dist/esm/component/type/wdio-types.type.d.ts.map +0 -1
- package/dist/esm/component/type/wdio-types.type.js +0 -2
- package/dist/esm/component/type/wdio-types.type.js.map +0 -1
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
/// <reference types="webdriverio/async" />
|
|
2
2
|
import type { ElSelectorFn, ElsIndexSelectorFn, ElsSelectorFn } from '../../type';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentConfigInterface } from '../type';
|
|
4
|
+
import type { Enum } from '@rnw-community/shared';
|
|
4
5
|
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
5
|
-
import type { Location } from 'webdriverio/build/commands/element/getLocation';
|
|
6
|
-
import type { Size } from 'webdriverio/build/commands/element/getSize';
|
|
7
6
|
export declare class Component<T = any> {
|
|
8
|
-
selectors: T
|
|
7
|
+
selectors: Enum<T>;
|
|
9
8
|
protected elSelectorFn: ElSelectorFn;
|
|
10
9
|
protected elsSelectorFn: ElsSelectorFn;
|
|
11
10
|
protected elsIndexSelectorFn: ElsIndexSelectorFn;
|
|
12
11
|
protected parentComponents: Component[];
|
|
13
|
-
constructor(config: ComponentConfigInterface, selectors: T);
|
|
12
|
+
constructor(config: ComponentConfigInterface, selectors: Enum<T>);
|
|
14
13
|
addParentComponent(component: Component): void;
|
|
15
|
-
clickChildEl(selector: string, ...args: ClickArgs): Promise<void>;
|
|
16
|
-
clickByIdxChildEl(selector: string, idx: number, ...args: ClickArgs): Promise<void>;
|
|
17
|
-
setValueChildEl(selector: string, ...args: SetValueArgs): Promise<void>;
|
|
18
|
-
isDisplayedChildEl(selector: string): Promise<boolean>;
|
|
19
|
-
isExistingChildEl(selector: string): Promise<boolean>;
|
|
20
|
-
getTextChildEl(selector: string): Promise<string>;
|
|
21
|
-
waitForExistChildEl(selector: string, ...args: WaitForExistArgs): Promise<void>;
|
|
22
|
-
waitForDisplayedChildEl(selector: string, ...args: WaitForDisplayedArgs): Promise<void>;
|
|
23
|
-
waitForEnabledChildEl(selector: string, ...args: WaitForEnabledArgs): Promise<void>;
|
|
24
|
-
getLocationChildEl(selector: string): Promise<Location>;
|
|
25
|
-
getSizeChildEl(selector: string): Promise<Size>;
|
|
26
14
|
getChildEl(selector: string): ChainablePromiseElement<WebdriverIO.Element>;
|
|
27
15
|
getChildEls(selector: string): ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
28
16
|
getChildElByIdx(selector: string, idx: number): ChainablePromiseElement<WebdriverIO.Element>;
|
|
17
|
+
protected proxyGet(field: string, receiver: unknown): unknown;
|
|
29
18
|
}
|
|
30
19
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMlF,qBAAa,SAAS,CAAC,CAAC,GAAG,GAAG;IAM2B,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IALvE,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACrC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACjD,SAAS,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAM;gBAEjC,MAAM,EAAE,wBAAwB,EAAS,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAavE,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAI9C,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;IAI9E,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI5F,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO;CAoBhE"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Component = void 0;
|
|
4
4
|
const shared_1 = require("@rnw-community/shared");
|
|
5
|
+
const selector_element_1 = require("../selector-element/selector-element");
|
|
6
|
+
/*
|
|
7
|
+
* TODO: Fix getLocation|getSize usage to handle both signatures through variable args array
|
|
8
|
+
*/
|
|
5
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
10
|
class Component {
|
|
7
11
|
constructor(config, selectors) {
|
|
@@ -13,83 +17,13 @@ class Component {
|
|
|
13
17
|
// eslint-disable-next-line no-constructor-return
|
|
14
18
|
return new Proxy(this, {
|
|
15
19
|
get(client, field, receiver) {
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18
|
-
return Reflect.get(client, field, receiver);
|
|
19
|
-
}
|
|
20
|
-
// @ts-expect-error TODO: Can we improve this types? We need this to be T for IDE intellisense support
|
|
21
|
-
const selectorValue = client.selectors[field];
|
|
22
|
-
if (!(0, shared_1.isDefined)(selectorValue)) {
|
|
23
|
-
for (const parentComponent of client.parentComponents) {
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
25
|
-
const parentComponentValue = parentComponent.selectors[field];
|
|
26
|
-
if (field in parentComponent) {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
28
|
-
return Reflect.get(parentComponent, field, receiver);
|
|
29
|
-
}
|
|
30
|
-
else if ((0, shared_1.isDefined)(parentComponentValue)) {
|
|
31
|
-
// @ts-expect-error TODO: Improve typings and eslint ignores
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
33
|
-
return parentComponent[field];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
el: () => client.getChildEl(selectorValue),
|
|
40
|
-
els: () => client.getChildEls(selectorValue),
|
|
41
|
-
byIdx: (idx) => client.getChildElByIdx(selectorValue, idx),
|
|
42
|
-
waitForDisplayed: (...args) => client.waitForDisplayedChildEl(selectorValue, ...args),
|
|
43
|
-
waitForExist: (...args) => client.waitForExistChildEl(selectorValue, ...args),
|
|
44
|
-
waitForEnabled: (...args) => client.waitForEnabledChildEl(selectorValue, ...args),
|
|
45
|
-
setValue: (...args) => client.setValueChildEl(selectorValue, ...args),
|
|
46
|
-
click: (...args) => client.clickChildEl(selectorValue, ...args),
|
|
47
|
-
clickByIdx: (idx, ...args) => client.clickByIdxChildEl(selectorValue, idx, ...args),
|
|
48
|
-
getText: () => client.getTextChildEl(selectorValue),
|
|
49
|
-
isDisplayed: () => client.isDisplayedChildEl(selectorValue),
|
|
50
|
-
isExisting: () => client.isExistingChildEl(selectorValue),
|
|
51
|
-
getLocation: () => client.getLocationChildEl(selectorValue),
|
|
52
|
-
getSize: () => client.getSizeChildEl(selectorValue),
|
|
53
|
-
};
|
|
20
|
+
return client.proxyGet(field, receiver);
|
|
54
21
|
},
|
|
55
22
|
});
|
|
56
23
|
}
|
|
57
24
|
addParentComponent(component) {
|
|
58
25
|
this.parentComponents.push(component);
|
|
59
26
|
}
|
|
60
|
-
async clickChildEl(selector, ...args) {
|
|
61
|
-
await (await this.getChildEl(selector)).click(...args);
|
|
62
|
-
}
|
|
63
|
-
async clickByIdxChildEl(selector, idx, ...args) {
|
|
64
|
-
await (await this.getChildElByIdx(selector, idx)).click(...args);
|
|
65
|
-
}
|
|
66
|
-
async setValueChildEl(selector, ...args) {
|
|
67
|
-
await (await this.getChildEl(selector)).setValue(...args);
|
|
68
|
-
}
|
|
69
|
-
async isDisplayedChildEl(selector) {
|
|
70
|
-
return await (await this.getChildEl(selector)).isDisplayed();
|
|
71
|
-
}
|
|
72
|
-
async isExistingChildEl(selector) {
|
|
73
|
-
return await (await this.getChildEl(selector)).isExisting();
|
|
74
|
-
}
|
|
75
|
-
async getTextChildEl(selector) {
|
|
76
|
-
return await (await this.getChildEl(selector)).getText();
|
|
77
|
-
}
|
|
78
|
-
async waitForExistChildEl(selector, ...args) {
|
|
79
|
-
await (await this.getChildEl(selector)).waitForExist(...args);
|
|
80
|
-
}
|
|
81
|
-
async waitForDisplayedChildEl(selector, ...args) {
|
|
82
|
-
await (await this.getChildEl(selector)).waitForDisplayed(...args);
|
|
83
|
-
}
|
|
84
|
-
async waitForEnabledChildEl(selector, ...args) {
|
|
85
|
-
await (await this.getChildEl(selector)).waitForEnabled(...args);
|
|
86
|
-
}
|
|
87
|
-
async getLocationChildEl(selector) {
|
|
88
|
-
return await (await this.getChildEl(selector)).getLocation();
|
|
89
|
-
}
|
|
90
|
-
async getSizeChildEl(selector) {
|
|
91
|
-
return await (await this.getChildEl(selector)).getSize();
|
|
92
|
-
}
|
|
93
27
|
getChildEl(selector) {
|
|
94
28
|
return this.elSelectorFn(selector);
|
|
95
29
|
}
|
|
@@ -99,6 +33,23 @@ class Component {
|
|
|
99
33
|
getChildElByIdx(selector, idx) {
|
|
100
34
|
return this.elsIndexSelectorFn(selector, idx);
|
|
101
35
|
}
|
|
36
|
+
proxyGet(field, receiver) {
|
|
37
|
+
if (Reflect.has(this, field)) {
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
39
|
+
return Reflect.get(this, field, receiver);
|
|
40
|
+
}
|
|
41
|
+
const selector = this.selectors[field];
|
|
42
|
+
if ((0, shared_1.isDefined)(selector)) {
|
|
43
|
+
return new selector_element_1.SelectorElement(this, selector);
|
|
44
|
+
}
|
|
45
|
+
for (const parentComponent of this.parentComponents) {
|
|
46
|
+
if (Reflect.has(parentComponent, field) || field in parentComponent.selectors) {
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
48
|
+
return Reflect.get(parentComponent, field, receiver);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
102
53
|
}
|
|
103
54
|
exports.Component = Component;
|
|
104
55
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":";;;AAAA,kDAAkD;AAElD,2EAAuE;AAOvE;;GAEG;AACH,8DAA8D;AAC9D,MAAa,SAAS;IAMlB,YAAY,MAAgC,EAAS,SAAkB;QAAlB,cAAS,GAAT,SAAS,CAAS;QAF7D,qBAAgB,GAAgB,EAAE,CAAC;QAGzC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QAEpD,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAa,EAAE,QAAQ;gBAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC5C,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED,kBAAkB,CAAC,SAAoB;QACnC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,QAAgB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,WAAW,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,eAAe,CAAC,QAAgB,EAAE,GAAW;QACzC,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAES,QAAQ,CAAC,KAAa,EAAE,QAAiB;QAC/C,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;YAC1B,+DAA+D;YAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;SAC7C;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAsB,CAAC;QAC5D,IAAI,IAAA,kBAAS,EAAC,QAAQ,CAAC,EAAE;YACrB,OAAO,IAAI,kCAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;SAC9C;QAED,KAAK,MAAM,eAAe,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACjD,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,eAAe,CAAC,SAAS,EAAE;gBAC3E,+DAA+D;gBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;aACxD;SACJ;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAvDD,8BAuDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-extended-component.d.ts","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-extended-component.d.ts","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAQ,MAAM,uBAAuB,CAAC;AAE7D,eAAO,MAAM,oBAAoB,sFAGrB,wBAAwB,qCAW/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-extended-component.js","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AACxE,4CAAyC;AAKlC,MAAM,oBAAoB,GAAG,CAChC,SAAY,EACZ,eAA6B,EAC7B,SAAmC,IAAA,iDAAsB,GAAE,EAC3B,EAAE;AAClC,mDAAmD;AACnD,KAAM,SAAQ,qBAAY;IACtB;QACI,KAAK,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"get-extended-component.js","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AACxE,4CAAyC;AAKlC,MAAM,oBAAoB,GAAG,CAChC,SAAY,EACZ,eAA6B,EAC7B,SAAmC,IAAA,iDAAsB,GAAE,EAC3B,EAAE;AAClC,mDAAmD;AACnD,KAAM,SAAQ,qBAAY;IACtB;QACI,KAAK,CAAC,MAAM,EAAE,SAA+B,CAAC,CAAC;QAE/C,IAAI,eAAe,KAAK,qBAAS,EAAE;YAC/B,IAAI,CAAC,kBAAkB,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;SAClD;IACL,CAAC;CACJ,CAAC;AAdO,QAAA,oBAAoB,wBAc3B"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
/// <reference types="webdriverio/async" />
|
|
2
2
|
import { Component } from '../component/component';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentConfigInterface, ComponentInputArg } from '../type';
|
|
4
|
+
import type { Enum } from '@rnw-community/shared';
|
|
4
5
|
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
5
6
|
export declare class RootedComponent<T = any> extends Component<T> {
|
|
6
|
-
selectors: T
|
|
7
|
+
selectors: Enum<T>;
|
|
7
8
|
protected readonly parentElInput: ComponentInputArg;
|
|
8
|
-
constructor(config: ComponentConfigInterface, selectors: T
|
|
9
|
+
constructor(config: ComponentConfigInterface, selectors: Enum<T>, selectorOrElement?: ComponentInputArg | undefined);
|
|
9
10
|
get RootEl(): ChainablePromiseElement<WebdriverIO.Element>;
|
|
10
|
-
waitForDisplayed(...args: WaitForDisplayedArgs): Promise<void>;
|
|
11
|
-
waitForEnabled(...args: WaitForEnabledArgs): Promise<void>;
|
|
12
|
-
waitForExist(...args: WaitForExistArgs): Promise<void>;
|
|
13
|
-
isDisplayed(): Promise<boolean>;
|
|
14
|
-
isExisting(): Promise<boolean>;
|
|
15
|
-
click(...args: ClickArgs): Promise<void>;
|
|
16
11
|
getChildEl(selector: string): ChainablePromiseElement<WebdriverIO.Element>;
|
|
17
12
|
getChildEls(selector: string): ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
18
13
|
getChildElByIdx(selector: string, idx: number): ChainablePromiseElement<WebdriverIO.Element>;
|
|
@@ -1 +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;AAGnD,OAAO,KAAK,
|
|
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;AAGnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAIlF,qBAAa,eAAe,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAKlC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAJtC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;gBAGhD,MAAM,EAAE,wBAAwB,EAChB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAClC,iBAAiB,GAAE,iBAAiB,GAAG,SAA2C;IA8BtF,IAAI,MAAM,IAAI,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAQzD;IAEQ,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;IAI9E,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;CAGxG"}
|
|
@@ -5,6 +5,7 @@ const shared_1 = require("@rnw-community/shared");
|
|
|
5
5
|
const util_1 = require("../../util");
|
|
6
6
|
const component_1 = require("../component/component");
|
|
7
7
|
const util_2 = require("../util");
|
|
8
|
+
// TODO: All Root should have all methods from wdio element, can we do this through the proxy?
|
|
8
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
10
|
class RootedComponent extends component_1.Component {
|
|
10
11
|
constructor(config, selectors, selectorOrElement = (0, util_2.findEnumRootSelector)(selectors)) {
|
|
@@ -14,6 +15,21 @@ class RootedComponent extends component_1.Component {
|
|
|
14
15
|
super(config, selectors);
|
|
15
16
|
this.selectors = selectors;
|
|
16
17
|
this.parentElInput = selectorOrElement;
|
|
18
|
+
// eslint-disable-next-line no-constructor-return
|
|
19
|
+
return new Proxy(this, {
|
|
20
|
+
get(client, field, receiver) {
|
|
21
|
+
const returnValue = client.proxyGet(field, receiver);
|
|
22
|
+
if (returnValue !== undefined) {
|
|
23
|
+
return returnValue;
|
|
24
|
+
}
|
|
25
|
+
const rootEl = client.RootEl;
|
|
26
|
+
if ((0, shared_1.isDefined)(rootEl) && Reflect.has(rootEl, field)) {
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
28
|
+
return Reflect.get(rootEl, field, receiver);
|
|
29
|
+
}
|
|
30
|
+
throw new Error(`Method/Property "${field}" is not supported by RootedComponent`);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
17
33
|
}
|
|
18
34
|
get RootEl() {
|
|
19
35
|
if ((0, shared_1.isNotEmptyString)(this.parentElInput)) {
|
|
@@ -24,24 +40,6 @@ class RootedComponent extends component_1.Component {
|
|
|
24
40
|
}
|
|
25
41
|
return (0, util_1.wdioElementChainByRef)(this.parentElInput);
|
|
26
42
|
}
|
|
27
|
-
async waitForDisplayed(...args) {
|
|
28
|
-
await (await this.RootEl).waitForDisplayed(...args);
|
|
29
|
-
}
|
|
30
|
-
async waitForEnabled(...args) {
|
|
31
|
-
await (await this.RootEl).waitForEnabled(...args);
|
|
32
|
-
}
|
|
33
|
-
async waitForExist(...args) {
|
|
34
|
-
await (await this.RootEl).waitForExist(...args);
|
|
35
|
-
}
|
|
36
|
-
async isDisplayed() {
|
|
37
|
-
return await (await this.RootEl).isDisplayed();
|
|
38
|
-
}
|
|
39
|
-
async isExisting() {
|
|
40
|
-
return await (await this.RootEl).isExisting();
|
|
41
|
-
}
|
|
42
|
-
async click(...args) {
|
|
43
|
-
await (await this.RootEl).click(...args);
|
|
44
|
-
}
|
|
45
43
|
getChildEl(selector) {
|
|
46
44
|
return this.elSelectorFn(selector, this.RootEl);
|
|
47
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooted-component.js","sourceRoot":"","sources":["../../../../src/component/rooted-component/rooted-component.ts"],"names":[],"mappings":";;;AAAA,kDAAoE;AAEpE,qCAAmD;AACnD,sDAAmD;AACnD,kCAA+C;
|
|
1
|
+
{"version":3,"file":"rooted-component.js","sourceRoot":"","sources":["../../../../src/component/rooted-component/rooted-component.ts"],"names":[],"mappings":";;;AAAA,kDAAoE;AAEpE,qCAAmD;AACnD,sDAAmD;AACnD,kCAA+C;AAM/C,8FAA8F;AAC9F,8DAA8D;AAC9D,MAAa,eAAyB,SAAQ,qBAAY;IAGtD,YACI,MAAgC,EAChB,SAAkB,EAClC,oBAAmD,IAAA,2BAAoB,EAAC,SAAS,CAAC;QAElF,IAAI,CAAC,IAAA,kBAAS,EAAC,iBAAiB,CAAC,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;SACvG;QAED,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAPT,cAAS,GAAT,SAAS,CAAS;QASlC,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;QAEvC,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAa,EAAE,QAAQ;gBAC/B,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAErD,IAAI,WAAW,KAAK,SAAS,EAAE;oBAC3B,OAAO,WAAW,CAAC;iBACtB;gBAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;gBAC7B,IAAI,IAAA,kBAAS,EAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;oBACjD,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAC/C;gBAED,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,uCAAuC,CAAC,CAAC;YACtF,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED,IAAI,MAAM;QACN,IAAI,IAAA,yBAAgB,EAAC,IAAI,CAAC,aAAa,CAAC,EAAE;YACtC,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SAChD;aAAM,IAAI,MAAM,IAAI,IAAI,CAAC,aAAa,EAAE;YACrC,OAAO,IAAI,CAAC,aAAa,CAAC;SAC7B;QAED,OAAO,IAAA,4BAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC;IAEQ,UAAU,CAAC,QAAgB;QAChC,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAEQ,WAAW,CAAC,QAAgB;QACjC,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAEQ,eAAe,CAAC,QAAgB,EAAE,GAAW;QAClD,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;CACJ;AAzDD,0CAyDC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="webdriverio/async" />
|
|
2
|
+
import type { Component } from '../component/component';
|
|
3
|
+
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
4
|
+
/**
|
|
5
|
+
* WDIO element wrapper witch additional methods supporting chaining.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SelectorElement {
|
|
8
|
+
private readonly component;
|
|
9
|
+
private readonly enumSelector;
|
|
10
|
+
constructor(component: Component, enumSelector: string);
|
|
11
|
+
/**
|
|
12
|
+
* Get Promise that will fetch and return WDIO element
|
|
13
|
+
*/
|
|
14
|
+
el(): ChainablePromiseElement<WebdriverIO.Element>;
|
|
15
|
+
/**
|
|
16
|
+
* Get Promise that will fetch and return WDIO elements array
|
|
17
|
+
*/
|
|
18
|
+
els(): ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
19
|
+
/**
|
|
20
|
+
* Get Promise that will fetch and return WDIO elements array item by index
|
|
21
|
+
*/
|
|
22
|
+
byIdx(idx: number): ChainablePromiseElement<WebdriverIO.Element>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=selector-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-element.d.ts","sourceRoot":"","sources":["../../../../src/component/selector-element/selector-element.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAElF;;GAEG;AACH,qBAAa,eAAe;IACZ,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAa,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAnD,SAAS,EAAE,SAAS,EAAmB,YAAY,EAAE,MAAM;IAoBxF;;OAEG;IACH,EAAE,IAAI,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAIlD;;OAEG;IACH,GAAG,IAAI,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;IAItD;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;CAGnE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SelectorElement = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* WDIO element wrapper witch additional methods supporting chaining.
|
|
6
|
+
*/
|
|
7
|
+
class SelectorElement {
|
|
8
|
+
constructor(component, enumSelector) {
|
|
9
|
+
this.component = component;
|
|
10
|
+
this.enumSelector = enumSelector;
|
|
11
|
+
// eslint-disable-next-line no-constructor-return
|
|
12
|
+
return new Proxy(this, {
|
|
13
|
+
get(client, field, receiver) {
|
|
14
|
+
if (Reflect.has(client, field)) {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
16
|
+
return Reflect.get(client, field, receiver);
|
|
17
|
+
}
|
|
18
|
+
const element = component.getChildEl(enumSelector);
|
|
19
|
+
if (Reflect.has(element, field)) {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
21
|
+
return Reflect.get(element, field, receiver);
|
|
22
|
+
}
|
|
23
|
+
throw new Error(`Method/Property "${field}" is not supported by SelectorElement(${enumSelector})`);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get Promise that will fetch and return WDIO element
|
|
29
|
+
*/
|
|
30
|
+
el() {
|
|
31
|
+
return this.component.getChildEl(this.enumSelector);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get Promise that will fetch and return WDIO elements array
|
|
35
|
+
*/
|
|
36
|
+
els() {
|
|
37
|
+
return this.component.getChildEls(this.enumSelector);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get Promise that will fetch and return WDIO elements array item by index
|
|
41
|
+
*/
|
|
42
|
+
byIdx(idx) {
|
|
43
|
+
return this.component.getChildElByIdx(this.enumSelector, idx);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.SelectorElement = SelectorElement;
|
|
47
|
+
//# sourceMappingURL=selector-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-element.js","sourceRoot":"","sources":["../../../../src/component/selector-element/selector-element.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,eAAe;IACxB,YAA6B,SAAoB,EAAmB,YAAoB;QAA3D,cAAS,GAAT,SAAS,CAAW;QAAmB,iBAAY,GAAZ,YAAY,CAAQ;QACpF,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAa,EAAE,QAAQ;gBAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;oBAC5B,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAC/C;gBAED,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;gBACnD,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;oBAC7B,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAChD;gBAED,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,yCAAyC,YAAY,GAAG,CAAC,CAAC;YACvG,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,EAAE;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,GAAG;QACC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC;CACJ;AAzCD,0CAyCC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Component } from '../component/component';
|
|
2
|
-
import type {
|
|
3
|
-
export declare type ComponentWithSelectors<T> = Component<T> & Record<keyof T,
|
|
2
|
+
import type { SelectorElement } from '../selector-element/selector-element';
|
|
3
|
+
export declare type ComponentWithSelectors<T> = Component<T> & Record<keyof T, SelectorElement & WebdriverIO.Element>;
|
|
4
4
|
//# sourceMappingURL=component-with-selectors.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,oBAAY,sBAAsB,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export type { ComponentWithSelectors } from './component-with-selectors.type';
|
|
2
2
|
export type { RootedComponentWithSelectors } from './rooted-component-with-selectors.type';
|
|
3
|
-
export type { WaitForDisplayedArgs, WaitForEnabledArgs, WaitForExistArgs, SetValueArgs, ClickArgs } from './wdio-types.type';
|
|
4
|
-
export type { SelectorObject } from './selector-object.type';
|
|
5
3
|
export type { ComponentInputArg } from './component-input-arg.type';
|
|
6
4
|
export type { ComponentWithSelectorsCtor } from './component-with-selectors-ctor.type';
|
|
7
5
|
export type { RootedComponentWithSelectorsCtor } from './rooted-component-with-selectors-ctor.type';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/type/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,YAAY,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC3F,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/type/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,YAAY,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC3F,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AACvF,YAAY,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AACpG,YAAY,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RootedComponent } from '../rooted-component/rooted-component';
|
|
2
|
-
import type {
|
|
3
|
-
export declare type RootedComponentWithSelectors<T> = Omit<Record<keyof T,
|
|
2
|
+
import type { SelectorElement } from '../selector-element/selector-element';
|
|
3
|
+
export declare type RootedComponentWithSelectors<T> = Omit<Record<keyof T, SelectorElement & WebdriverIO.Element>, 'Root'> & RootedComponent<T>;
|
|
4
4
|
//# sourceMappingURL=rooted-component-with-selectors.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooted-component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/rooted-component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"rooted-component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/rooted-component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,oBAAY,4BAA4B,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,GAC9G,eAAe,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
/// <reference types="webdriverio/async" />
|
|
2
2
|
import type { ElSelectorFn, ElsIndexSelectorFn, ElsSelectorFn } from '../../type';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentConfigInterface } from '../type';
|
|
4
|
+
import type { Enum } from '@rnw-community/shared';
|
|
4
5
|
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
5
|
-
import type { Location } from 'webdriverio/build/commands/element/getLocation';
|
|
6
|
-
import type { Size } from 'webdriverio/build/commands/element/getSize';
|
|
7
6
|
export declare class Component<T = any> {
|
|
8
|
-
selectors: T
|
|
7
|
+
selectors: Enum<T>;
|
|
9
8
|
protected elSelectorFn: ElSelectorFn;
|
|
10
9
|
protected elsSelectorFn: ElsSelectorFn;
|
|
11
10
|
protected elsIndexSelectorFn: ElsIndexSelectorFn;
|
|
12
11
|
protected parentComponents: Component[];
|
|
13
|
-
constructor(config: ComponentConfigInterface, selectors: T);
|
|
12
|
+
constructor(config: ComponentConfigInterface, selectors: Enum<T>);
|
|
14
13
|
addParentComponent(component: Component): void;
|
|
15
|
-
clickChildEl(selector: string, ...args: ClickArgs): Promise<void>;
|
|
16
|
-
clickByIdxChildEl(selector: string, idx: number, ...args: ClickArgs): Promise<void>;
|
|
17
|
-
setValueChildEl(selector: string, ...args: SetValueArgs): Promise<void>;
|
|
18
|
-
isDisplayedChildEl(selector: string): Promise<boolean>;
|
|
19
|
-
isExistingChildEl(selector: string): Promise<boolean>;
|
|
20
|
-
getTextChildEl(selector: string): Promise<string>;
|
|
21
|
-
waitForExistChildEl(selector: string, ...args: WaitForExistArgs): Promise<void>;
|
|
22
|
-
waitForDisplayedChildEl(selector: string, ...args: WaitForDisplayedArgs): Promise<void>;
|
|
23
|
-
waitForEnabledChildEl(selector: string, ...args: WaitForEnabledArgs): Promise<void>;
|
|
24
|
-
getLocationChildEl(selector: string): Promise<Location>;
|
|
25
|
-
getSizeChildEl(selector: string): Promise<Size>;
|
|
26
14
|
getChildEl(selector: string): ChainablePromiseElement<WebdriverIO.Element>;
|
|
27
15
|
getChildEls(selector: string): ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
28
16
|
getChildElByIdx(selector: string, idx: number): ChainablePromiseElement<WebdriverIO.Element>;
|
|
17
|
+
protected proxyGet(field: string, receiver: unknown): unknown;
|
|
29
18
|
}
|
|
30
19
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAMlF,qBAAa,SAAS,CAAC,CAAC,GAAG,GAAG;IAM2B,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IALvE,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACrC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IACjD,SAAS,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAM;gBAEjC,MAAM,EAAE,wBAAwB,EAAS,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAavE,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAI9C,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;IAI9E,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI5F,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO;CAoBhE"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { isDefined } from '@rnw-community/shared';
|
|
2
|
+
import { SelectorElement } from '../selector-element/selector-element';
|
|
3
|
+
/*
|
|
4
|
+
* TODO: Fix getLocation|getSize usage to handle both signatures through variable args array
|
|
5
|
+
*/
|
|
2
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
7
|
export class Component {
|
|
4
8
|
selectors;
|
|
@@ -14,83 +18,13 @@ export class Component {
|
|
|
14
18
|
// eslint-disable-next-line no-constructor-return
|
|
15
19
|
return new Proxy(this, {
|
|
16
20
|
get(client, field, receiver) {
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
19
|
-
return Reflect.get(client, field, receiver);
|
|
20
|
-
}
|
|
21
|
-
// @ts-expect-error TODO: Can we improve this types? We need this to be T for IDE intellisense support
|
|
22
|
-
const selectorValue = client.selectors[field];
|
|
23
|
-
if (!isDefined(selectorValue)) {
|
|
24
|
-
for (const parentComponent of client.parentComponents) {
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
26
|
-
const parentComponentValue = parentComponent.selectors[field];
|
|
27
|
-
if (field in parentComponent) {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
29
|
-
return Reflect.get(parentComponent, field, receiver);
|
|
30
|
-
}
|
|
31
|
-
else if (isDefined(parentComponentValue)) {
|
|
32
|
-
// @ts-expect-error TODO: Improve typings and eslint ignores
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
34
|
-
return parentComponent[field];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
el: () => client.getChildEl(selectorValue),
|
|
41
|
-
els: () => client.getChildEls(selectorValue),
|
|
42
|
-
byIdx: (idx) => client.getChildElByIdx(selectorValue, idx),
|
|
43
|
-
waitForDisplayed: (...args) => client.waitForDisplayedChildEl(selectorValue, ...args),
|
|
44
|
-
waitForExist: (...args) => client.waitForExistChildEl(selectorValue, ...args),
|
|
45
|
-
waitForEnabled: (...args) => client.waitForEnabledChildEl(selectorValue, ...args),
|
|
46
|
-
setValue: (...args) => client.setValueChildEl(selectorValue, ...args),
|
|
47
|
-
click: (...args) => client.clickChildEl(selectorValue, ...args),
|
|
48
|
-
clickByIdx: (idx, ...args) => client.clickByIdxChildEl(selectorValue, idx, ...args),
|
|
49
|
-
getText: () => client.getTextChildEl(selectorValue),
|
|
50
|
-
isDisplayed: () => client.isDisplayedChildEl(selectorValue),
|
|
51
|
-
isExisting: () => client.isExistingChildEl(selectorValue),
|
|
52
|
-
getLocation: () => client.getLocationChildEl(selectorValue),
|
|
53
|
-
getSize: () => client.getSizeChildEl(selectorValue),
|
|
54
|
-
};
|
|
21
|
+
return client.proxyGet(field, receiver);
|
|
55
22
|
},
|
|
56
23
|
});
|
|
57
24
|
}
|
|
58
25
|
addParentComponent(component) {
|
|
59
26
|
this.parentComponents.push(component);
|
|
60
27
|
}
|
|
61
|
-
async clickChildEl(selector, ...args) {
|
|
62
|
-
await (await this.getChildEl(selector)).click(...args);
|
|
63
|
-
}
|
|
64
|
-
async clickByIdxChildEl(selector, idx, ...args) {
|
|
65
|
-
await (await this.getChildElByIdx(selector, idx)).click(...args);
|
|
66
|
-
}
|
|
67
|
-
async setValueChildEl(selector, ...args) {
|
|
68
|
-
await (await this.getChildEl(selector)).setValue(...args);
|
|
69
|
-
}
|
|
70
|
-
async isDisplayedChildEl(selector) {
|
|
71
|
-
return await (await this.getChildEl(selector)).isDisplayed();
|
|
72
|
-
}
|
|
73
|
-
async isExistingChildEl(selector) {
|
|
74
|
-
return await (await this.getChildEl(selector)).isExisting();
|
|
75
|
-
}
|
|
76
|
-
async getTextChildEl(selector) {
|
|
77
|
-
return await (await this.getChildEl(selector)).getText();
|
|
78
|
-
}
|
|
79
|
-
async waitForExistChildEl(selector, ...args) {
|
|
80
|
-
await (await this.getChildEl(selector)).waitForExist(...args);
|
|
81
|
-
}
|
|
82
|
-
async waitForDisplayedChildEl(selector, ...args) {
|
|
83
|
-
await (await this.getChildEl(selector)).waitForDisplayed(...args);
|
|
84
|
-
}
|
|
85
|
-
async waitForEnabledChildEl(selector, ...args) {
|
|
86
|
-
await (await this.getChildEl(selector)).waitForEnabled(...args);
|
|
87
|
-
}
|
|
88
|
-
async getLocationChildEl(selector) {
|
|
89
|
-
return await (await this.getChildEl(selector)).getLocation();
|
|
90
|
-
}
|
|
91
|
-
async getSizeChildEl(selector) {
|
|
92
|
-
return await (await this.getChildEl(selector)).getSize();
|
|
93
|
-
}
|
|
94
28
|
getChildEl(selector) {
|
|
95
29
|
return this.elSelectorFn(selector);
|
|
96
30
|
}
|
|
@@ -100,5 +34,22 @@ export class Component {
|
|
|
100
34
|
getChildElByIdx(selector, idx) {
|
|
101
35
|
return this.elsIndexSelectorFn(selector, idx);
|
|
102
36
|
}
|
|
37
|
+
proxyGet(field, receiver) {
|
|
38
|
+
if (Reflect.has(this, field)) {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
40
|
+
return Reflect.get(this, field, receiver);
|
|
41
|
+
}
|
|
42
|
+
const selector = this.selectors[field];
|
|
43
|
+
if (isDefined(selector)) {
|
|
44
|
+
return new SelectorElement(this, selector);
|
|
45
|
+
}
|
|
46
|
+
for (const parentComponent of this.parentComponents) {
|
|
47
|
+
if (Reflect.has(parentComponent, field) || field in parentComponent.selectors) {
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
49
|
+
return Reflect.get(parentComponent, field, receiver);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
103
54
|
}
|
|
104
55
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/component/component/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAOvE;;GAEG;AACH,8DAA8D;AAC9D,MAAM,OAAO,SAAS;IAMmC;IAL3C,YAAY,CAAe;IAC3B,aAAa,CAAgB;IAC7B,kBAAkB,CAAqB;IACvC,gBAAgB,GAAgB,EAAE,CAAC;IAE7C,YAAY,MAAgC,EAAS,SAAkB;QAAlB,cAAS,GAAT,SAAS,CAAS;QACnE,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QAEpD,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAa,EAAE,QAAQ;gBAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC5C,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED,kBAAkB,CAAC,SAAoB;QACnC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,QAAgB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,WAAW,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,eAAe,CAAC,QAAgB,EAAE,GAAW;QACzC,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAES,QAAQ,CAAC,KAAa,EAAE,QAAiB;QAC/C,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;YAC1B,+DAA+D;YAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;SAC7C;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAsB,CAAC;QAC5D,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE;YACrB,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;SAC9C;QAED,KAAK,MAAM,eAAe,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACjD,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,eAAe,CAAC,SAAS,EAAE;gBAC3E,+DAA+D;gBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;aACxD;SACJ;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-extended-component.d.ts","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-extended-component.d.ts","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAQ,MAAM,uBAAuB,CAAC;AAE7D,eAAO,MAAM,oBAAoB,sFAGrB,wBAAwB,qCAW/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-extended-component.js","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAChC,SAAY,EACZ,eAA6B,EAC7B,SAAmC,sBAAsB,EAAE,EAC3B,EAAE;AAClC,mDAAmD;AACnD,KAAM,SAAQ,SAAY;IACtB;QACI,KAAK,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"get-extended-component.js","sourceRoot":"","sources":["../../../../../src/component/component/get-exteded-component/get-extended-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAChC,SAAY,EACZ,eAA6B,EAC7B,SAAmC,sBAAsB,EAAE,EAC3B,EAAE;AAClC,mDAAmD;AACnD,KAAM,SAAQ,SAAY;IACtB;QACI,KAAK,CAAC,MAAM,EAAE,SAA+B,CAAC,CAAC;QAE/C,IAAI,eAAe,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,kBAAkB,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;SAClD;IACL,CAAC;CACJ,CAAC"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
/// <reference types="webdriverio/async" />
|
|
2
2
|
import { Component } from '../component/component';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentConfigInterface, ComponentInputArg } from '../type';
|
|
4
|
+
import type { Enum } from '@rnw-community/shared';
|
|
4
5
|
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
5
6
|
export declare class RootedComponent<T = any> extends Component<T> {
|
|
6
|
-
selectors: T
|
|
7
|
+
selectors: Enum<T>;
|
|
7
8
|
protected readonly parentElInput: ComponentInputArg;
|
|
8
|
-
constructor(config: ComponentConfigInterface, selectors: T
|
|
9
|
+
constructor(config: ComponentConfigInterface, selectors: Enum<T>, selectorOrElement?: ComponentInputArg | undefined);
|
|
9
10
|
get RootEl(): ChainablePromiseElement<WebdriverIO.Element>;
|
|
10
|
-
waitForDisplayed(...args: WaitForDisplayedArgs): Promise<void>;
|
|
11
|
-
waitForEnabled(...args: WaitForEnabledArgs): Promise<void>;
|
|
12
|
-
waitForExist(...args: WaitForExistArgs): Promise<void>;
|
|
13
|
-
isDisplayed(): Promise<boolean>;
|
|
14
|
-
isExisting(): Promise<boolean>;
|
|
15
|
-
click(...args: ClickArgs): Promise<void>;
|
|
16
11
|
getChildEl(selector: string): ChainablePromiseElement<WebdriverIO.Element>;
|
|
17
12
|
getChildEls(selector: string): ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
18
13
|
getChildElByIdx(selector: string, idx: number): ChainablePromiseElement<WebdriverIO.Element>;
|
|
@@ -1 +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;AAGnD,OAAO,KAAK,
|
|
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;AAGnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAIlF,qBAAa,eAAe,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAKlC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAJtC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC;gBAGhD,MAAM,EAAE,wBAAwB,EAChB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAClC,iBAAiB,GAAE,iBAAiB,GAAG,SAA2C;IA8BtF,IAAI,MAAM,IAAI,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAQzD;IAEQ,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAI1E,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;IAI9E,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;CAGxG"}
|
|
@@ -2,6 +2,7 @@ import { isDefined, isNotEmptyString } from '@rnw-community/shared';
|
|
|
2
2
|
import { wdioElementChainByRef } from '../../util';
|
|
3
3
|
import { Component } from '../component/component';
|
|
4
4
|
import { findEnumRootSelector } from '../util';
|
|
5
|
+
// TODO: All Root should have all methods from wdio element, can we do this through the proxy?
|
|
5
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
7
|
export class RootedComponent extends Component {
|
|
7
8
|
selectors;
|
|
@@ -13,6 +14,21 @@ export class RootedComponent extends Component {
|
|
|
13
14
|
super(config, selectors);
|
|
14
15
|
this.selectors = selectors;
|
|
15
16
|
this.parentElInput = selectorOrElement;
|
|
17
|
+
// eslint-disable-next-line no-constructor-return
|
|
18
|
+
return new Proxy(this, {
|
|
19
|
+
get(client, field, receiver) {
|
|
20
|
+
const returnValue = client.proxyGet(field, receiver);
|
|
21
|
+
if (returnValue !== undefined) {
|
|
22
|
+
return returnValue;
|
|
23
|
+
}
|
|
24
|
+
const rootEl = client.RootEl;
|
|
25
|
+
if (isDefined(rootEl) && Reflect.has(rootEl, field)) {
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
27
|
+
return Reflect.get(rootEl, field, receiver);
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Method/Property "${field}" is not supported by RootedComponent`);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
16
32
|
}
|
|
17
33
|
get RootEl() {
|
|
18
34
|
if (isNotEmptyString(this.parentElInput)) {
|
|
@@ -23,24 +39,6 @@ export class RootedComponent extends Component {
|
|
|
23
39
|
}
|
|
24
40
|
return wdioElementChainByRef(this.parentElInput);
|
|
25
41
|
}
|
|
26
|
-
async waitForDisplayed(...args) {
|
|
27
|
-
await (await this.RootEl).waitForDisplayed(...args);
|
|
28
|
-
}
|
|
29
|
-
async waitForEnabled(...args) {
|
|
30
|
-
await (await this.RootEl).waitForEnabled(...args);
|
|
31
|
-
}
|
|
32
|
-
async waitForExist(...args) {
|
|
33
|
-
await (await this.RootEl).waitForExist(...args);
|
|
34
|
-
}
|
|
35
|
-
async isDisplayed() {
|
|
36
|
-
return await (await this.RootEl).isDisplayed();
|
|
37
|
-
}
|
|
38
|
-
async isExisting() {
|
|
39
|
-
return await (await this.RootEl).isExisting();
|
|
40
|
-
}
|
|
41
|
-
async click(...args) {
|
|
42
|
-
await (await this.RootEl).click(...args);
|
|
43
|
-
}
|
|
44
42
|
getChildEl(selector) {
|
|
45
43
|
return this.elSelectorFn(selector, this.RootEl);
|
|
46
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooted-component.js","sourceRoot":"","sources":["../../../../src/component/rooted-component/rooted-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"rooted-component.js","sourceRoot":"","sources":["../../../../src/component/rooted-component/rooted-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAM/C,8FAA8F;AAC9F,8DAA8D;AAC9D,MAAM,OAAO,eAAyB,SAAQ,SAAY;IAKlC;IAJD,aAAa,CAAoB;IAEpD,YACI,MAAgC,EAChB,SAAkB,EAClC,oBAAmD,oBAAoB,CAAC,SAAS,CAAC;QAElF,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;SACvG;QAED,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAPT,cAAS,GAAT,SAAS,CAAS;QASlC,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC;QAEvC,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAa,EAAE,QAAQ;gBAC/B,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAErD,IAAI,WAAW,KAAK,SAAS,EAAE;oBAC3B,OAAO,WAAW,CAAC;iBACtB;gBAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;gBAC7B,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;oBACjD,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAC/C;gBAED,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,uCAAuC,CAAC,CAAC;YACtF,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED,IAAI,MAAM;QACN,IAAI,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;YACtC,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SAChD;aAAM,IAAI,MAAM,IAAI,IAAI,CAAC,aAAa,EAAE;YACrC,OAAO,IAAI,CAAC,aAAa,CAAC;SAC7B;QAED,OAAO,qBAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC;IAEQ,UAAU,CAAC,QAAgB;QAChC,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAEQ,WAAW,CAAC,QAAgB;QACjC,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAEQ,eAAe,CAAC,QAAgB,EAAE,GAAW;QAClD,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;CACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="webdriverio/async" />
|
|
2
|
+
import type { Component } from '../component/component';
|
|
3
|
+
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
4
|
+
/**
|
|
5
|
+
* WDIO element wrapper witch additional methods supporting chaining.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SelectorElement {
|
|
8
|
+
private readonly component;
|
|
9
|
+
private readonly enumSelector;
|
|
10
|
+
constructor(component: Component, enumSelector: string);
|
|
11
|
+
/**
|
|
12
|
+
* Get Promise that will fetch and return WDIO element
|
|
13
|
+
*/
|
|
14
|
+
el(): ChainablePromiseElement<WebdriverIO.Element>;
|
|
15
|
+
/**
|
|
16
|
+
* Get Promise that will fetch and return WDIO elements array
|
|
17
|
+
*/
|
|
18
|
+
els(): ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
19
|
+
/**
|
|
20
|
+
* Get Promise that will fetch and return WDIO elements array item by index
|
|
21
|
+
*/
|
|
22
|
+
byIdx(idx: number): ChainablePromiseElement<WebdriverIO.Element>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=selector-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-element.d.ts","sourceRoot":"","sources":["../../../../src/component/selector-element/selector-element.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAElF;;GAEG;AACH,qBAAa,eAAe;IACZ,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAa,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAnD,SAAS,EAAE,SAAS,EAAmB,YAAY,EAAE,MAAM;IAoBxF;;OAEG;IACH,EAAE,IAAI,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;IAIlD;;OAEG;IACH,GAAG,IAAI,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC;IAItD;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC;CAGnE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WDIO element wrapper witch additional methods supporting chaining.
|
|
3
|
+
*/
|
|
4
|
+
export class SelectorElement {
|
|
5
|
+
component;
|
|
6
|
+
enumSelector;
|
|
7
|
+
constructor(component, enumSelector) {
|
|
8
|
+
this.component = component;
|
|
9
|
+
this.enumSelector = enumSelector;
|
|
10
|
+
// eslint-disable-next-line no-constructor-return
|
|
11
|
+
return new Proxy(this, {
|
|
12
|
+
get(client, field, receiver) {
|
|
13
|
+
if (Reflect.has(client, field)) {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
15
|
+
return Reflect.get(client, field, receiver);
|
|
16
|
+
}
|
|
17
|
+
const element = component.getChildEl(enumSelector);
|
|
18
|
+
if (Reflect.has(element, field)) {
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
20
|
+
return Reflect.get(element, field, receiver);
|
|
21
|
+
}
|
|
22
|
+
throw new Error(`Method/Property "${field}" is not supported by SelectorElement(${enumSelector})`);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get Promise that will fetch and return WDIO element
|
|
28
|
+
*/
|
|
29
|
+
el() {
|
|
30
|
+
return this.component.getChildEl(this.enumSelector);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get Promise that will fetch and return WDIO elements array
|
|
34
|
+
*/
|
|
35
|
+
els() {
|
|
36
|
+
return this.component.getChildEls(this.enumSelector);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get Promise that will fetch and return WDIO elements array item by index
|
|
40
|
+
*/
|
|
41
|
+
byIdx(idx) {
|
|
42
|
+
return this.component.getChildElByIdx(this.enumSelector, idx);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=selector-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-element.js","sourceRoot":"","sources":["../../../../src/component/selector-element/selector-element.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,eAAe;IACK;IAAuC;IAApE,YAA6B,SAAoB,EAAmB,YAAoB;QAA3D,cAAS,GAAT,SAAS,CAAW;QAAmB,iBAAY,GAAZ,YAAY,CAAQ;QACpF,iDAAiD;QACjD,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACnB,GAAG,CAAC,MAAM,EAAE,KAAa,EAAE,QAAQ;gBAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;oBAC5B,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAC/C;gBAED,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;gBACnD,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;oBAC7B,+DAA+D;oBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;iBAChD;gBAED,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,yCAAyC,YAAY,GAAG,CAAC,CAAC;YACvG,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,EAAE;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,GAAG;QACC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Component } from '../component/component';
|
|
2
|
-
import type {
|
|
3
|
-
export declare type ComponentWithSelectors<T> = Component<T> & Record<keyof T,
|
|
2
|
+
import type { SelectorElement } from '../selector-element/selector-element';
|
|
3
|
+
export declare type ComponentWithSelectors<T> = Component<T> & Record<keyof T, SelectorElement & WebdriverIO.Element>;
|
|
4
4
|
//# sourceMappingURL=component-with-selectors.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,oBAAY,sBAAsB,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export type { ComponentWithSelectors } from './component-with-selectors.type';
|
|
2
2
|
export type { RootedComponentWithSelectors } from './rooted-component-with-selectors.type';
|
|
3
|
-
export type { WaitForDisplayedArgs, WaitForEnabledArgs, WaitForExistArgs, SetValueArgs, ClickArgs } from './wdio-types.type';
|
|
4
|
-
export type { SelectorObject } from './selector-object.type';
|
|
5
3
|
export type { ComponentInputArg } from './component-input-arg.type';
|
|
6
4
|
export type { ComponentWithSelectorsCtor } from './component-with-selectors-ctor.type';
|
|
7
5
|
export type { RootedComponentWithSelectorsCtor } from './rooted-component-with-selectors-ctor.type';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/type/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,YAAY,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC3F,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/type/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,YAAY,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC3F,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AACvF,YAAY,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AACpG,YAAY,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RootedComponent } from '../rooted-component/rooted-component';
|
|
2
|
-
import type {
|
|
3
|
-
export declare type RootedComponentWithSelectors<T> = Omit<Record<keyof T,
|
|
2
|
+
import type { SelectorElement } from '../selector-element/selector-element';
|
|
3
|
+
export declare type RootedComponentWithSelectors<T> = Omit<Record<keyof T, SelectorElement & WebdriverIO.Element>, 'Root'> & RootedComponent<T>;
|
|
4
4
|
//# sourceMappingURL=rooted-component-with-selectors.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooted-component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/rooted-component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"rooted-component-with-selectors.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/rooted-component-with-selectors.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,oBAAY,4BAA4B,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,GAC9G,eAAe,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnw-community/wdio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "WDIO commands, page objects and utils",
|
|
6
6
|
"keywords": [
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=14.0.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "6ec83bd367d839485bf4839c5379193baddb402a",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rnw-community/shared": "^0.
|
|
49
|
+
"@rnw-community/shared": "^0.44.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@wdio/types": "^7.20.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"by-index.command.d.ts","sourceRoot":"","sources":["../../../../src/command/by-index-command/by-index.command.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,eAAO,MAAM,SAAS,EAAE,kBAO8B,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.byIndex$$ = void 0;
|
|
4
|
-
const util_1 = require("../../util");
|
|
5
|
-
const byIndex$$ = (selector, index, context = browser) => context.$$(selector).then(elements => {
|
|
6
|
-
if (index >= elements.length || index < 0) {
|
|
7
|
-
throw new Error(`Cannot get item by $$ "${selector}" with index "${index}"`);
|
|
8
|
-
}
|
|
9
|
-
return (0, util_1.wdioElementChainByRef)(elements[index]);
|
|
10
|
-
});
|
|
11
|
-
exports.byIndex$$ = byIndex$$;
|
|
12
|
-
//# sourceMappingURL=by-index.command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"by-index.command.js","sourceRoot":"","sources":["../../../../src/command/by-index-command/by-index.command.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AAK5C,MAAM,SAAS,GAAuB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,EAAE,CAChF,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;IACjC,IAAI,KAAK,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,GAAG,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,iBAAiB,KAAK,GAAG,CAAC,CAAC;KAChF;IAED,OAAO,IAAA,4BAAqB,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAClD,CAAC,CAAiD,CAAC;AAP1C,QAAA,SAAS,aAOiC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="webdriverio/async" />
|
|
2
|
-
import type { SetValueArgs, WaitForDisplayedArgs, WaitForEnabledArgs, WaitForExistArgs } from './wdio-types.type';
|
|
3
|
-
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
4
|
-
import type { Location } from 'webdriverio/build/commands/element/getLocation';
|
|
5
|
-
import type { Size } from 'webdriverio/build/commands/element/getSize';
|
|
6
|
-
export interface SelectorObject {
|
|
7
|
-
byIdx: (idx: number) => ChainablePromiseElement<WebdriverIO.Element>;
|
|
8
|
-
click: () => Promise<void>;
|
|
9
|
-
clickByIdx: (idx: number) => Promise<void>;
|
|
10
|
-
el: () => ChainablePromiseElement<WebdriverIO.Element>;
|
|
11
|
-
els: () => ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
12
|
-
getLocation: () => Promise<Location>;
|
|
13
|
-
getSize: () => Promise<Size>;
|
|
14
|
-
getText: () => Promise<string>;
|
|
15
|
-
isDisplayed: () => Promise<boolean>;
|
|
16
|
-
isExisting: () => Promise<boolean>;
|
|
17
|
-
setValue: (...args: SetValueArgs) => Promise<void>;
|
|
18
|
-
waitForDisplayed: (...args: WaitForDisplayedArgs) => Promise<void>;
|
|
19
|
-
waitForEnabled: (...args: WaitForEnabledArgs) => Promise<void>;
|
|
20
|
-
waitForExist: (...args: WaitForExistArgs) => Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=selector-object.type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selector-object.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/selector-object.type.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClH,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAGvE,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,EAAE,EAAE,MAAM,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACvD,GAAG,EAAE,MAAM,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC3D,WAAW,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,gBAAgB,EAAE,CAAC,GAAG,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selector-object.type.js","sourceRoot":"","sources":["../../../../src/component/type/selector-object.type.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare type WaitForDisplayedArgs = Parameters<WebdriverIO.Element['waitForDisplayed']>;
|
|
2
|
-
export declare type WaitForEnabledArgs = Parameters<WebdriverIO.Element['waitForEnabled']>;
|
|
3
|
-
export declare type WaitForExistArgs = Parameters<WebdriverIO.Element['waitForExist']>;
|
|
4
|
-
export declare type SetValueArgs = Parameters<WebdriverIO.Element['setValue']>;
|
|
5
|
-
export declare type ClickArgs = Parameters<WebdriverIO.Element['click']>;
|
|
6
|
-
//# sourceMappingURL=wdio-types.type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wdio-types.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/wdio-types.type.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACvF,oBAAY,kBAAkB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACnF,oBAAY,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;AAC/E,oBAAY,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AACvE,oBAAY,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wdio-types.type.js","sourceRoot":"","sources":["../../../../src/component/type/wdio-types.type.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"by-index.command.d.ts","sourceRoot":"","sources":["../../../../src/command/by-index-command/by-index.command.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,eAAO,MAAM,SAAS,EAAE,kBAO8B,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { wdioElementChainByRef } from '../../util';
|
|
2
|
-
export const byIndex$$ = (selector, index, context = browser) => context.$$(selector).then(elements => {
|
|
3
|
-
if (index >= elements.length || index < 0) {
|
|
4
|
-
throw new Error(`Cannot get item by $$ "${selector}" with index "${index}"`);
|
|
5
|
-
}
|
|
6
|
-
return wdioElementChainByRef(elements[index]);
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=by-index.command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"by-index.command.js","sourceRoot":"","sources":["../../../../src/command/by-index-command/by-index.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAKnD,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,EAAE,EAAE,CAChF,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;IACjC,IAAI,KAAK,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,GAAG,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,iBAAiB,KAAK,GAAG,CAAC,CAAC;KAChF;IAED,OAAO,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAClD,CAAC,CAAiD,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="webdriverio/async" />
|
|
2
|
-
import type { SetValueArgs, WaitForDisplayedArgs, WaitForEnabledArgs, WaitForExistArgs } from './wdio-types.type';
|
|
3
|
-
import type { ChainablePromiseArray, ChainablePromiseElement } from 'webdriverio';
|
|
4
|
-
import type { Location } from 'webdriverio/build/commands/element/getLocation';
|
|
5
|
-
import type { Size } from 'webdriverio/build/commands/element/getSize';
|
|
6
|
-
export interface SelectorObject {
|
|
7
|
-
byIdx: (idx: number) => ChainablePromiseElement<WebdriverIO.Element>;
|
|
8
|
-
click: () => Promise<void>;
|
|
9
|
-
clickByIdx: (idx: number) => Promise<void>;
|
|
10
|
-
el: () => ChainablePromiseElement<WebdriverIO.Element>;
|
|
11
|
-
els: () => ChainablePromiseArray<WebdriverIO.ElementArray>;
|
|
12
|
-
getLocation: () => Promise<Location>;
|
|
13
|
-
getSize: () => Promise<Size>;
|
|
14
|
-
getText: () => Promise<string>;
|
|
15
|
-
isDisplayed: () => Promise<boolean>;
|
|
16
|
-
isExisting: () => Promise<boolean>;
|
|
17
|
-
setValue: (...args: SetValueArgs) => Promise<void>;
|
|
18
|
-
waitForDisplayed: (...args: WaitForDisplayedArgs) => Promise<void>;
|
|
19
|
-
waitForEnabled: (...args: WaitForEnabledArgs) => Promise<void>;
|
|
20
|
-
waitForExist: (...args: WaitForExistArgs) => Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=selector-object.type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selector-object.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/selector-object.type.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClH,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAGvE,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,EAAE,EAAE,MAAM,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACvD,GAAG,EAAE,MAAM,qBAAqB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC3D,WAAW,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,gBAAgB,EAAE,CAAC,GAAG,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selector-object.type.js","sourceRoot":"","sources":["../../../../src/component/type/selector-object.type.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare type WaitForDisplayedArgs = Parameters<WebdriverIO.Element['waitForDisplayed']>;
|
|
2
|
-
export declare type WaitForEnabledArgs = Parameters<WebdriverIO.Element['waitForEnabled']>;
|
|
3
|
-
export declare type WaitForExistArgs = Parameters<WebdriverIO.Element['waitForExist']>;
|
|
4
|
-
export declare type SetValueArgs = Parameters<WebdriverIO.Element['setValue']>;
|
|
5
|
-
export declare type ClickArgs = Parameters<WebdriverIO.Element['click']>;
|
|
6
|
-
//# sourceMappingURL=wdio-types.type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wdio-types.type.d.ts","sourceRoot":"","sources":["../../../../src/component/type/wdio-types.type.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACvF,oBAAY,kBAAkB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACnF,oBAAY,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;AAC/E,oBAAY,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AACvE,oBAAY,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wdio-types.type.js","sourceRoot":"","sources":["../../../../src/component/type/wdio-types.type.ts"],"names":[],"mappings":""}
|