@rnw-community/wdio 0.28.0 → 0.31.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.
Files changed (59) hide show
  1. package/dist/add-wdio-commands.js +9 -66
  2. package/dist/add-wdio-commands.js.map +1 -1
  3. package/dist/capability/is-android.capability.js +1 -1
  4. package/dist/capability/is-android.capability.js.map +1 -1
  5. package/dist/capability/is-browser.capability.js +1 -3
  6. package/dist/capability/is-browser.capability.js.map +1 -1
  7. package/dist/capability/is-ios.capability.js +3 -3
  8. package/dist/capability/is-ios.capability.js.map +1 -1
  9. package/dist/command/clear-input.command.js +7 -62
  10. package/dist/command/clear-input.command.js.map +1 -1
  11. package/dist/command/mobile/open-deep-link.command.js +21 -90
  12. package/dist/command/mobile/open-deep-link.command.js.map +1 -1
  13. package/dist/command/mobile/relative-click.command.js +7 -55
  14. package/dist/command/mobile/relative-click.command.js.map +1 -1
  15. package/dist/command/slow-input.command.js +12 -95
  16. package/dist/command/slow-input.command.js.map +1 -1
  17. package/dist/command/swipe.command.js +40 -113
  18. package/dist/command/swipe.command.js.map +1 -1
  19. package/dist/command/test-id-index.command.js +7 -53
  20. package/dist/command/test-id-index.command.js.map +1 -1
  21. package/dist/command/test-id.command.js +2 -46
  22. package/dist/command/test-id.command.js.map +1 -1
  23. package/dist/command/test-ids.command.js +2 -46
  24. package/dist/command/test-ids.command.js.map +1 -1
  25. package/dist/component/component/component.js +44 -234
  26. package/dist/component/component/component.js.map +1 -1
  27. package/dist/component/create-component/create-component.js +2 -4
  28. package/dist/component/create-component/create-component.js.map +1 -1
  29. package/dist/component/create-rooted-component/create-rooted-component.js +2 -2
  30. package/dist/component/create-rooted-component/create-rooted-component.js.map +1 -1
  31. package/dist/component/get-component/get-component.js +18 -36
  32. package/dist/component/get-component/get-component.js.map +1 -1
  33. package/dist/component/get-rooted-component/get-rooted-component.js +22 -41
  34. package/dist/component/get-rooted-component/get-rooted-component.js.map +1 -1
  35. package/dist/component/rooted-component/rooted-component.js +42 -212
  36. package/dist/component/rooted-component/rooted-component.js.map +1 -1
  37. package/dist/component/util/find-enum-root-selector.util.js +4 -4
  38. package/dist/component/util/find-enum-root-selector.util.js.map +1 -1
  39. package/dist/component/util/proxy-call.util.js +17 -62
  40. package/dist/component/util/proxy-call.util.js.map +1 -1
  41. package/dist/selector/android-testid.selector.js +1 -1
  42. package/dist/selector/android-testid.selector.js.map +1 -1
  43. package/dist/selector/ios-testid.selector.js +1 -1
  44. package/dist/selector/ios-testid.selector.js.map +1 -1
  45. package/dist/selector/mobile-testid.selector.js +4 -6
  46. package/dist/selector/mobile-testid.selector.js.map +1 -1
  47. package/dist/selector/test-id.selector.js +4 -6
  48. package/dist/selector/test-id.selector.js.map +1 -1
  49. package/dist/selector/web-testid.selector.js +2 -2
  50. package/dist/selector/web-testid.selector.js.map +1 -1
  51. package/dist/util/get-platform.util.js +1 -1
  52. package/dist/util/get-platform.util.js.map +1 -1
  53. package/dist/util/get-test-id/get-test-id.js +5 -8
  54. package/dist/util/get-test-id/get-test-id.js.map +1 -1
  55. package/dist/util/set-prop-test-id/set-prop-test-id.js +3 -18
  56. package/dist/util/set-prop-test-id/set-prop-test-id.js.map +1 -1
  57. package/dist/util/set-test-id/set-test-id.js +7 -12
  58. package/dist/util/set-test-id/set-test-id.js.map +1 -1
  59. package/package.json +2 -2
@@ -1,80 +1,23 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.addWdioCommands = void 0;
40
- var command_1 = require("./command");
41
- var swipe_command_1 = require("./command/swipe.command");
42
- var addWdioCommands = function (context) {
4
+ const command_1 = require("./command");
5
+ const swipe_command_1 = require("./command/swipe.command");
6
+ const addWdioCommands = (context) => {
43
7
  // HINT: Browser commands
44
8
  context.addCommand('testID$', command_1.testID$, false);
45
9
  context.addCommand('testID$$', command_1.testID$$, false);
46
10
  context.addCommand('testID$$Index', command_1.testID$$Index, false);
47
11
  context.addCommand('openDeepLink', command_1.openDeepLinkCommand, false);
48
12
  // HINT: Element commands
49
- context.addCommand('testID$', function TestID$(testID) {
50
- return __awaiter(this, void 0, void 0, function () {
51
- return __generator(this, function (_a) {
52
- switch (_a.label) {
53
- case 0: return [4 /*yield*/, (0, command_1.testID$)(testID, this)];
54
- case 1: return [2 /*return*/, _a.sent()];
55
- }
56
- });
57
- });
13
+ context.addCommand('testID$', async function TestID$(testID) {
14
+ return await (0, command_1.testID$)(testID, this);
58
15
  }, true);
59
- context.addCommand('testID$$', function TestID$$(testID) {
60
- return __awaiter(this, void 0, void 0, function () {
61
- return __generator(this, function (_a) {
62
- switch (_a.label) {
63
- case 0: return [4 /*yield*/, (0, command_1.testID$$)(testID, this)];
64
- case 1: return [2 /*return*/, _a.sent()];
65
- }
66
- });
67
- });
16
+ context.addCommand('testID$$', async function TestID$$(testID) {
17
+ return await (0, command_1.testID$$)(testID, this);
68
18
  }, true);
69
- context.addCommand('testID$$Index', function TestID$$Index(testID, idx) {
70
- return __awaiter(this, void 0, void 0, function () {
71
- return __generator(this, function (_a) {
72
- switch (_a.label) {
73
- case 0: return [4 /*yield*/, (0, command_1.testID$$Index)(testID, idx, this)];
74
- case 1: return [2 /*return*/, _a.sent()];
75
- }
76
- });
77
- });
19
+ context.addCommand('testID$$Index', async function TestID$$Index(testID, idx) {
20
+ return await (0, command_1.testID$$Index)(testID, idx, this);
78
21
  }, true);
79
22
  context.addCommand('slowInput', command_1.slowInputCommand, true);
80
23
  context.addCommand('clearInput', command_1.clearInputCommand, true);
@@ -1 +1 @@
1
- {"version":3,"file":"add-wdio-commands.js","sourceRoot":"","sources":["../src/add-wdio-commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAQmB;AACnB,yDAAuD;AAIhD,IAAM,eAAe,GAAG,UAAC,OA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AC1D,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"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isAndroidCapability = void 0;
4
- var isAndroidCapability = function () { return browser.isAndroid; };
4
+ const isAndroidCapability = () => browser.isAndroid;
5
5
  exports.isAndroidCapability = isAndroidCapability;
6
6
  //# sourceMappingURL=is-android.capability.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-android.capability.js","sourceRoot":"","sources":["../../src/capability/is-android.capability.ts"],"names":[],"mappings":";;;AAAO,IAAM,mBAAmB,GAAG,cAAe,OAAA,OAAO,CAAC,SAAS,EAAjB,CAAiB,CAAC;AAAvD,QAAA,mBAAmB,uBAAoC"}
1
+ {"version":3,"file":"is-android.capability.js","sourceRoot":"","sources":["../../src/capability/is-android.capability.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,GAAY,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC;AAAvD,QAAA,mBAAmB,uBAAoC"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isBrowserCapability = void 0;
4
- var isBrowserCapability = function () {
5
- return 'browserName' in browser.capabilities && browser.capabilities.browserName !== '';
6
- };
4
+ const isBrowserCapability = () => 'browserName' in browser.capabilities && browser.capabilities.browserName !== '';
7
5
  exports.isBrowserCapability = isBrowserCapability;
8
6
  //# sourceMappingURL=is-browser.capability.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-browser.capability.js","sourceRoot":"","sources":["../../src/capability/is-browser.capability.ts"],"names":[],"mappings":";;;AAAO,IAAM,mBAAmB,GAAG;IAC/B,OAAA,aAAa,IAAI,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,WAAW,KAAK,EAAE;AAAhF,CAAgF,CAAC;AADxE,QAAA,mBAAmB,uBACqD"}
1
+ {"version":3,"file":"is-browser.capability.js","sourceRoot":"","sources":["../../src/capability/is-browser.capability.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,GAAY,EAAE,CAC7C,aAAa,IAAI,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,WAAW,KAAK,EAAE,CAAC;AADxE,QAAA,mBAAmB,uBACqD"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isIOSCapability = void 0;
4
- var is_android_capability_1 = require("./is-android.capability");
5
- var is_browser_capability_1 = require("./is-browser.capability");
6
- var isIOSCapability = function () { return !(0, is_browser_capability_1.isBrowserCapability)() && !(0, is_android_capability_1.isAndroidCapability)(); };
4
+ const is_android_capability_1 = require("./is-android.capability");
5
+ const is_browser_capability_1 = require("./is-browser.capability");
6
+ const isIOSCapability = () => !(0, is_browser_capability_1.isBrowserCapability)() && !(0, is_android_capability_1.isAndroidCapability)();
7
7
  exports.isIOSCapability = isIOSCapability;
8
8
  //# sourceMappingURL=is-ios.capability.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-ios.capability.js","sourceRoot":"","sources":["../../src/capability/is-ios.capability.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,iEAA8D;AAEvD,IAAM,eAAe,GAAG,cAAe,OAAA,CAAC,IAAA,2CAAmB,GAAE,IAAI,CAAC,IAAA,2CAAmB,GAAE,EAAhD,CAAgD,CAAC;AAAlF,QAAA,eAAe,mBAAmE"}
1
+ {"version":3,"file":"is-ios.capability.js","sourceRoot":"","sources":["../../src/capability/is-ios.capability.ts"],"names":[],"mappings":";;;AAAA,mEAA8D;AAC9D,mEAA8D;AAEvD,MAAM,eAAe,GAAG,GAAY,EAAE,CAAC,CAAC,IAAA,2CAAmB,GAAE,IAAI,CAAC,IAAA,2CAAmB,GAAE,CAAC;AAAlF,QAAA,eAAe,mBAAmE"}
@@ -1,68 +1,13 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.clearInputCommand = void 0;
40
- var clearInputCommand = function clearInputCommand() {
41
- return __awaiter(this, void 0, void 0, function () {
42
- var currentText;
43
- return __generator(this, function (_a) {
44
- switch (_a.label) {
45
- case 0:
46
- // HINT: Not working
47
- return [4 /*yield*/, this.clearValue()];
48
- case 1:
49
- // HINT: Not working
50
- _a.sent();
51
- // HINT: Not working
52
- return [4 /*yield*/, this.setValue('')];
53
- case 2:
54
- // HINT: Not working
55
- _a.sent();
56
- return [4 /*yield*/, this.getText()];
57
- case 3:
58
- currentText = _a.sent();
59
- return [4 /*yield*/, this.sendKeys(Array(currentText.length).fill('\ue017'))];
60
- case 4:
61
- _a.sent();
62
- return [2 /*return*/];
63
- }
64
- });
65
- });
4
+ const clearInputCommand = async function clearInputCommand() {
5
+ // HINT: Not working
6
+ await this.clearValue();
7
+ // HINT: Not working
8
+ await this.setValue('');
9
+ const currentText = await this.getText();
10
+ await this.sendKeys(Array(currentText.length).fill('\ue017'));
66
11
  };
67
12
  exports.clearInputCommand = clearInputCommand;
68
13
  //# sourceMappingURL=clear-input.command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clear-input.command.js","sourceRoot":"","sources":["../../src/command/clear-input.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,iBAAiB,GAAG,SAAe,iBAAiB;;;;;;gBAC7D,oBAAoB;gBACpB,qBAAM,IAAI,CAAC,UAAU,EAAE,EAAA;;oBADvB,oBAAoB;oBACpB,SAAuB,CAAC;oBACxB,oBAAoB;oBACpB,qBAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;oBADvB,oBAAoB;oBACpB,SAAuB,CAAC;oBAEJ,qBAAM,IAAI,CAAC,OAAO,EAAE,EAAA;;oBAAlC,WAAW,GAAG,SAAoB;oBAExC,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAa,CAAC,EAAA;;oBAAzE,SAAyE,CAAC;;;;;CAC7E,CAAC;AATW,QAAA,iBAAiB,qBAS5B"}
1
+ {"version":3,"file":"clear-input.command.js","sourceRoot":"","sources":["../../src/command/clear-input.command.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAAG,KAAK,UAAU,iBAAiB;IAC7D,oBAAoB;IACpB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IACxB,oBAAoB;IACpB,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAExB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IAEzC,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAa,CAAC,CAAC;AAC9E,CAAC,CAAC;AATW,QAAA,iBAAiB,qBAS5B"}
@@ -1,40 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.openDeepLinkCommand = void 0;
40
4
  /**
@@ -42,60 +6,27 @@ exports.openDeepLinkCommand = void 0;
42
6
  *
43
7
  * @param {string} url
44
8
  */
45
- var shared_1 = require("@rnw-community/shared");
46
- var capability_1 = require("../../capability");
47
- var getPackageNameFromCapabilities = function (context) {
48
- return 'appPackage' in context.capabilities ? "".concat(context.capabilities.appPackage) : '';
49
- };
50
- var openDeepLinkCommand = function (url, packageName) {
51
- if (packageName === void 0) { packageName = getPackageNameFromCapabilities(browser); }
52
- return __awaiter(void 0, void 0, void 0, function () {
53
- var addressBar, urlField;
54
- return __generator(this, function (_a) {
55
- switch (_a.label) {
56
- case 0:
57
- if (!(0, capability_1.isAndroidCapability)()) return [3 /*break*/, 2];
58
- if ((0, shared_1.isEmptyString)(packageName)) {
59
- throw new Error('Cannot open deep link - packageName should be defined');
60
- }
61
- return [4 /*yield*/, driver.execute('mobile:deepLink', { url: url, package: packageName })];
62
- case 1:
63
- _a.sent();
64
- return [3 /*break*/, 10];
65
- case 2:
66
- if (!(0, capability_1.isIOSCapability)()) return [3 /*break*/, 10];
67
- // TODO: Find better IOS implementation, improve speed
68
- return [4 /*yield*/, driver.execute('mobile: launchApp', { bundleId: 'com.apple.mobilesafari' })];
69
- case 3:
70
- // TODO: Find better IOS implementation, improve speed
71
- _a.sent();
72
- addressBar = $("//XCUIElementTypeOther[@name=\"CapsuleNavigationBar?isSelected=true\"]");
73
- return [4 /*yield*/, driver.isKeyboardShown()];
74
- case 4:
75
- if (!!(_a.sent())) return [3 /*break*/, 7];
76
- return [4 /*yield*/, addressBar.click()];
77
- case 5:
78
- _a.sent();
79
- return [4 /*yield*/, driver.waitUntil(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
80
- switch (_a.label) {
81
- case 0: return [4 /*yield*/, driver.isKeyboardShown()];
82
- case 1: return [2 /*return*/, _a.sent()];
83
- }
84
- }); }); })];
85
- case 6:
86
- _a.sent();
87
- _a.label = 7;
88
- case 7: return [4 /*yield*/, $("//XCUIElementTypeApplication[@name=\"Safari\"]/XCUIElementTypeWindow[3]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]")];
89
- case 8:
90
- urlField = _a.sent();
91
- return [4 /*yield*/, urlField.setValue("".concat(url, "\uE007"))];
92
- case 9:
93
- _a.sent();
94
- _a.label = 10;
95
- case 10: return [2 /*return*/];
96
- }
97
- });
98
- });
9
+ const shared_1 = require("@rnw-community/shared");
10
+ const capability_1 = require("../../capability");
11
+ const getPackageNameFromCapabilities = (context) => 'appPackage' in context.capabilities ? `${context.capabilities.appPackage}` : '';
12
+ const openDeepLinkCommand = async (url, packageName = getPackageNameFromCapabilities(browser)) => {
13
+ if ((0, capability_1.isAndroidCapability)()) {
14
+ if ((0, shared_1.isEmptyString)(packageName)) {
15
+ throw new Error('Cannot open deep link - packageName should be defined');
16
+ }
17
+ await driver.execute('mobile:deepLink', { url, package: packageName });
18
+ }
19
+ else if ((0, capability_1.isIOSCapability)()) {
20
+ // TODO: Find better IOS implementation, improve speed
21
+ await driver.execute('mobile: launchApp', { bundleId: 'com.apple.mobilesafari' });
22
+ const addressBar = $(`//XCUIElementTypeOther[@name="CapsuleNavigationBar?isSelected=true"]`);
23
+ if (!(await driver.isKeyboardShown())) {
24
+ await addressBar.click();
25
+ await driver.waitUntil(async () => await driver.isKeyboardShown());
26
+ }
27
+ const urlField = await $(`//XCUIElementTypeApplication[@name="Safari"]/XCUIElementTypeWindow[3]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[1]`);
28
+ await urlField.setValue(`${url}\uE007`);
29
+ }
99
30
  };
100
31
  exports.openDeepLinkCommand = openDeepLinkCommand;
101
32
  //# sourceMappingURL=open-deep-link.command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-deep-link.command.js","sourceRoot":"","sources":["../../../src/command/mobile/open-deep-link.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,gDAAsD;AAEtD,+CAAwE;AAExE,IAAM,8BAA8B,GAAG,UAAC,OAA4B;IAChE,OAAA,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,UAAG,OAAO,CAAC,YAAY,CAAC,UAAoB,CAAE,CAAC,CAAC,CAAC,EAAE;AAA1F,CAA0F,CAAC;AAExF,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B9B"}
@@ -1,61 +1,13 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.relativeClickCommand = void 0;
40
- var ONE_HUNDRED_PERCENT = 100;
41
- var relativeClickCommand = function relativeClickCommand(xPercent, yPercent) {
42
- return __awaiter(this, void 0, void 0, function () {
43
- var size;
44
- return __generator(this, function (_a) {
45
- switch (_a.label) {
46
- case 0: return [4 /*yield*/, this.getSize()];
47
- case 1:
48
- size = _a.sent();
49
- return [4 /*yield*/, this.touchAction({
50
- action: 'tap',
51
- x: (size.width * xPercent) / ONE_HUNDRED_PERCENT,
52
- y: (size.height * yPercent) / ONE_HUNDRED_PERCENT,
53
- })];
54
- case 2:
55
- _a.sent();
56
- return [2 /*return*/];
57
- }
58
- });
4
+ const ONE_HUNDRED_PERCENT = 100;
5
+ const relativeClickCommand = async function relativeClickCommand(xPercent, yPercent) {
6
+ const size = await this.getSize();
7
+ await this.touchAction({
8
+ action: 'tap',
9
+ x: (size.width * xPercent) / ONE_HUNDRED_PERCENT,
10
+ y: (size.height * yPercent) / ONE_HUNDRED_PERCENT,
59
11
  });
60
12
  };
61
13
  exports.relativeClickCommand = relativeClickCommand;
@@ -1 +1 @@
1
- {"version":3,"file":"relative-click.command.js","sourceRoot":"","sources":["../../../src/command/mobile/relative-click.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,mBAAmB,GAAG,GAAG,CAAC;AAEzB,IAAM,oBAAoB,GAAG,SAAe,oBAAoB,CAEnE,QAAgB,EAChB,QAAgB;;;;;wBAEH,qBAAM,IAAI,CAAC,OAAO,EAAE,EAAA;;oBAA3B,IAAI,GAAG,SAAoB;oBAEjC,qBAAM,IAAI,CAAC,WAAW,CAAC;4BACnB,MAAM,EAAE,KAAK;4BACb,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,mBAAmB;4BAChD,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,mBAAmB;yBACpD,CAAC,EAAA;;oBAJF,SAIE,CAAC;;;;;CACN,CAAC;AAZW,QAAA,oBAAoB,wBAY/B"}
1
+ {"version":3,"file":"relative-click.command.js","sourceRoot":"","sources":["../../../src/command/mobile/relative-click.command.ts"],"names":[],"mappings":";;;AAAA,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEzB,MAAM,oBAAoB,GAAG,KAAK,UAAU,oBAAoB,CAEnE,QAAgB,EAChB,QAAgB;IAEhB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IAElC,MAAM,IAAI,CAAC,WAAW,CAAC;QACnB,MAAM,EAAE,KAAK;QACb,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,mBAAmB;QAChD,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,mBAAmB;KACpD,CAAC,CAAC;AACP,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B"}
@@ -1,101 +1,18 @@
1
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
- var __asyncValues = (this && this.__asyncValues) || function (o) {
39
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
40
- var m = o[Symbol.asyncIterator], i;
41
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
42
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
43
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
44
- };
45
2
  Object.defineProperty(exports, "__esModule", { value: true });
46
3
  exports.slowInputCommand = void 0;
47
- var capability_1 = require("../capability");
48
- var DEFAULT_INPUT_DELAY = 300;
49
- var slowInputCommand = function slowInputCommand(value, delay) {
50
- var e_1, _a;
51
- if (delay === void 0) { delay = DEFAULT_INPUT_DELAY; }
52
- return __awaiter(this, void 0, void 0, function () {
53
- var _b, _c, char, e_1_1;
54
- return __generator(this, function (_d) {
55
- switch (_d.label) {
56
- case 0:
57
- if (!(0, capability_1.isAndroidCapability)()) return [3 /*break*/, 2];
58
- return [4 /*yield*/, this.setValue(value)];
59
- case 1:
60
- _d.sent();
61
- return [3 /*break*/, 15];
62
- case 2:
63
- _d.trys.push([2, 9, 10, 15]);
64
- _b = __asyncValues(value.split(''));
65
- _d.label = 3;
66
- case 3: return [4 /*yield*/, _b.next()];
67
- case 4:
68
- if (!(_c = _d.sent(), !_c.done)) return [3 /*break*/, 8];
69
- char = _c.value;
70
- return [4 /*yield*/, browser.pause(delay)];
71
- case 5:
72
- _d.sent();
73
- return [4 /*yield*/, this.addValue(char)];
74
- case 6:
75
- _d.sent();
76
- _d.label = 7;
77
- case 7: return [3 /*break*/, 3];
78
- case 8: return [3 /*break*/, 15];
79
- case 9:
80
- e_1_1 = _d.sent();
81
- e_1 = { error: e_1_1 };
82
- return [3 /*break*/, 15];
83
- case 10:
84
- _d.trys.push([10, , 13, 14]);
85
- if (!(_c && !_c.done && (_a = _b.return))) return [3 /*break*/, 12];
86
- return [4 /*yield*/, _a.call(_b)];
87
- case 11:
88
- _d.sent();
89
- _d.label = 12;
90
- case 12: return [3 /*break*/, 14];
91
- case 13:
92
- if (e_1) throw e_1.error;
93
- return [7 /*endfinally*/];
94
- case 14: return [7 /*endfinally*/];
95
- case 15: return [2 /*return*/];
96
- }
97
- });
98
- });
4
+ const capability_1 = require("../capability");
5
+ const DEFAULT_INPUT_DELAY = 300;
6
+ const slowInputCommand = async function slowInputCommand(value, delay = DEFAULT_INPUT_DELAY) {
7
+ if ((0, capability_1.isAndroidCapability)()) {
8
+ await this.setValue(value);
9
+ }
10
+ else {
11
+ for await (const char of value.split('')) {
12
+ await browser.pause(delay);
13
+ await this.addValue(char);
14
+ }
15
+ }
99
16
  };
100
17
  exports.slowInputCommand = slowInputCommand;
101
18
  //# sourceMappingURL=slow-input.command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slow-input.command.js","sourceRoot":"","sources":["../../src/command/slow-input.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAoD;AAEpD,IAAM,mBAAmB,GAAG,GAAG,CAAC;AAEzB,IAAM,gBAAgB,GAAG,SAAe,gBAAgB,CAE3D,KAAa,EACb,KAA2B;;IAA3B,sBAAA,EAAA,2BAA2B;;;;;;yBAEvB,IAAA,gCAAmB,GAAE,EAArB,wBAAqB;oBACrB,qBAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;oBAA1B,SAA0B,CAAC;;;;oBAEF,KAAA,cAAA,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;;;;;oBAAvB,IAAI,WAAA,CAAA;oBACjB,qBAAM,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAA;;oBAA1B,SAA0B,CAAC;oBAC3B,qBAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAA;;oBAAzB,SAAyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;CAGrC,CAAC;AAbW,QAAA,gBAAgB,oBAa3B"}
1
+ {"version":3,"file":"slow-input.command.js","sourceRoot":"","sources":["../../src/command/slow-input.command.ts"],"names":[],"mappings":";;;AAAA,8CAAoD;AAEpD,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEzB,MAAM,gBAAgB,GAAG,KAAK,UAAU,gBAAgB,CAE3D,KAAa,EACb,KAAK,GAAG,mBA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