@rnw-community/wdio 0.14.2 → 0.15.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/add-wdio-commands.d.ts +2 -1
- package/dist/add-wdio-commands.d.ts.map +1 -1
- package/dist/add-wdio-commands.js +12 -12
- package/dist/add-wdio-commands.js.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 +55 -0
- package/dist/util/get-visible-component.util.js.map +1 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-wdio-commands.d.ts","sourceRoot":"","sources":["../src/add-wdio-commands.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"add-wdio-commands.d.ts","sourceRoot":"","sources":["../src/add-wdio-commands.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAElD,eAAO,MAAM,eAAe,YAAa,mBAAmB,KAAG,IAiC9D,CAAC"}
|
|
@@ -39,14 +39,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.addWdioCommands = void 0;
|
|
40
40
|
var command_1 = require("./command");
|
|
41
41
|
var swipe_command_1 = require("./command/swipe.command");
|
|
42
|
-
var addWdioCommands = function () {
|
|
42
|
+
var addWdioCommands = function (context) {
|
|
43
43
|
// HINT: Browser commands
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
context.addCommand('testID$', command_1.testID$, false);
|
|
45
|
+
context.addCommand('testID$$', command_1.testID$$, false);
|
|
46
|
+
context.addCommand('testID$$Index', command_1.testID$$Index, false);
|
|
47
|
+
context.addCommand('openDeepLink', command_1.openDeepLinkCommand, false);
|
|
48
48
|
// HINT: Element commands
|
|
49
|
-
|
|
49
|
+
context.addCommand('testID$', function TestID$(testID) {
|
|
50
50
|
return __awaiter(this, void 0, void 0, function () {
|
|
51
51
|
return __generator(this, function (_a) {
|
|
52
52
|
switch (_a.label) {
|
|
@@ -56,7 +56,7 @@ var addWdioCommands = function () {
|
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
}, true);
|
|
59
|
-
|
|
59
|
+
context.addCommand('testID$$', function TestID$$(testID) {
|
|
60
60
|
return __awaiter(this, void 0, void 0, function () {
|
|
61
61
|
return __generator(this, function (_a) {
|
|
62
62
|
switch (_a.label) {
|
|
@@ -66,7 +66,7 @@ var addWdioCommands = function () {
|
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
}, true);
|
|
69
|
-
|
|
69
|
+
context.addCommand('testID$$Index', function TestID$$Index(testID, idx) {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
71
|
return __generator(this, function (_a) {
|
|
72
72
|
switch (_a.label) {
|
|
@@ -76,10 +76,10 @@ var addWdioCommands = function () {
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
}, true);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
context.addCommand('slowInput', command_1.slowInputCommand, true);
|
|
80
|
+
context.addCommand('clearInput', command_1.clearInputCommand, true);
|
|
81
|
+
context.addCommand('relativeClick', command_1.relativeClickCommand, true);
|
|
82
|
+
context.addCommand('swipe', swipe_command_1.swipeCommand, true);
|
|
83
83
|
};
|
|
84
84
|
exports.addWdioCommands = addWdioCommands;
|
|
85
85
|
//# sourceMappingURL=add-wdio-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-wdio-commands.js","sourceRoot":"","sources":["../src/add-wdio-commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC;IACxD,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,2BAAiB,EAAE,IAAI,CAAC,CAAC;IAC1D,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,8BAAoB,EAAE,IAAI,CAAC,CAAC;IAChE,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,4BAAY,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAjCW,QAAA,eAAe,mBAiC1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="webdriverio/async" />
|
|
2
|
+
import { VisibleComponent } from '../component';
|
|
3
|
+
declare type SelectorMethods<T extends string, S extends string> = T extends `${infer Prefix}.${infer Selector}` ? Selector extends `Root` ? never : `${Selector}${S}` : never;
|
|
4
|
+
declare type VisibleComponentWithSelectors<T extends string> = VisibleComponent & {
|
|
5
|
+
[TKey in SelectorMethods<T, 'El'>]: Promise<WebdriverIO.Element>;
|
|
6
|
+
} & {
|
|
7
|
+
[TKey in SelectorMethods<T, 'Els'>]: Promise<WebdriverIO.ElementArray>;
|
|
8
|
+
};
|
|
9
|
+
declare type VisibleComponentWithSelectorsCtor<T extends string> = new (selectorOrElement: WebdriverIO.Element | string) => VisibleComponentWithSelectors<T>;
|
|
10
|
+
export declare const getVisibleComponent: <T extends string, E = unknown>(selectors: E) => VisibleComponentWithSelectorsCtor<T>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=get-visible-component.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-visible-component.util.d.ts","sourceRoot":"","sources":["../../src/util/get-visible-component.util.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,aAAK,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,MAAM,IAAI,MAAM,QAAQ,EAAE,GAClG,QAAQ,SAAS,MAAM,GACnB,KAAK,GACL,GAAG,QAAQ,GAAG,CAAC,EAAE,GACrB,KAAK,CAAC;AAEZ,aAAK,6BAA6B,CAAC,CAAC,SAAS,MAAM,IAAI,gBAAgB,GAAG;KACrE,IAAI,IAAI,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;CACnE,GAAG;KAAG,IAAI,IAAI,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC;CAAE,CAAC;AAE/E,aAAK,iCAAiC,CAAC,CAAC,SAAS,MAAM,IAAI,KACvD,iBAAiB,EAAE,WAAW,CAAC,OAAO,GAAG,MAAM,KAC9C,6BAA6B,CAAC,CAAC,CAAC,CAAC;AAEtC,eAAO,MAAM,mBAAmB,uFAiC3B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.getVisibleComponent = void 0;
|
|
19
|
+
var component_1 = require("../component");
|
|
20
|
+
var getVisibleComponent = 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(selectorOrElement) {
|
|
25
|
+
var _this = _super.call(this, selectorOrElement) || this;
|
|
26
|
+
_this.selectorKeys = Object.keys(selectors);
|
|
27
|
+
// eslint-disable-next-line no-constructor-return
|
|
28
|
+
return new Proxy(_this, {
|
|
29
|
+
// @ts-expect-error field is required to be string or a symbol, we need it to be keyof TController for proper typings inside
|
|
30
|
+
get: function (proxyClient, field, receiver) {
|
|
31
|
+
if (field in proxyClient) {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
33
|
+
return Reflect.get(proxyClient, field, receiver);
|
|
34
|
+
}
|
|
35
|
+
if (field in proxyClient.selectorKeys) {
|
|
36
|
+
if (field.includes('Els')) {
|
|
37
|
+
// @ts-expect-error We need to fix types of the enum
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
39
|
+
return proxyClient.getChildEls(selectors[field]);
|
|
40
|
+
}
|
|
41
|
+
else if (field.includes('El')) {
|
|
42
|
+
// @ts-expect-error We need to fix types of the enum
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
44
|
+
return proxyClient.getChildEl(selectors[field]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return class_1;
|
|
52
|
+
}(component_1.VisibleComponent));
|
|
53
|
+
};
|
|
54
|
+
exports.getVisibleComponent = getVisibleComponent;
|
|
55
|
+
//# sourceMappingURL=get-visible-component.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-visible-component.util.js","sourceRoot":"","sources":["../../src/util/get-visible-component.util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0CAAgD;AAoBzC,IAAM,mBAAmB,GAAG,UAAgC,SAAY;IAC3E,mDAAmD;IACnD;QAAc,2BAAgB;QAG1B,iBAAY,iBAA+C;YAA3D,YACI,kBAAM,iBAAiB,CAAC,SA0B3B;YA7BgB,kBAAY,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAmB,CAAC;YAKrE,iDAAiD;YACjD,OAAO,IAAI,KAAK,CAAC,KAAI,EAAE;gBACnB,4HAA4H;gBAC5H,GAAG,EAAH,UAAI,WAAW,EAAE,KAAc,EAAE,QAAQ;oBACrC,IAAI,KAAK,IAAI,WAAW,EAAE;wBACtB,+DAA+D;wBAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;qBACpD;oBAED,IAAI,KAAK,IAAI,WAAW,CAAC,YAAY,EAAE;wBACnC,IAAK,KAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;4BACnC,oDAAoD;4BACpD,iEAAiE;4BACjE,OAAO,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;yBACpD;6BAAM,IAAK,KAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;4BACzC,oDAAoD;4BACpD,iEAAiE;4BACjE,OAAO,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;yBACnD;qBACJ;oBAED,OAAO,SAAS,CAAC;gBACrB,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;QACL,cAAC;IAAD,CAAC,AA/BD,CAAc,4BAAgB;AAA9B,CA+BC,CAAC;AAjCO,QAAA,mBAAmB,uBAiC1B"}
|
package/dist/util/index.d.ts
CHANGED
package/dist/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC"}
|
package/dist/util/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./set-test-id"), exports);
|
|
18
18
|
__exportStar(require("./get-test-id"), exports);
|
|
19
19
|
__exportStar(require("./set-prop-test-id"), exports);
|
|
20
|
+
__exportStar(require("./get-visible-component.util"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B;AAC9B,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,gDAA8B;AAC9B,qDAAmC;AACnC,+DAA6C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnw-community/wdio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "WDIO commands, page objects and utils",
|
|
6
6
|
"keywords": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=14.0.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "727a904cdb61921d8d0f2924a1bed133cde805b1",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@rnw-community/shared": "^0.8.0"
|
|
41
41
|
},
|