appium-xcuitest-driver 10.2.2 → 10.4.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/CHANGELOG.md +12 -0
- package/build/lib/commands/active-app-info.d.ts +9 -0
- package/build/lib/commands/active-app-info.d.ts.map +1 -0
- package/build/lib/commands/active-app-info.js +14 -0
- package/build/lib/commands/active-app-info.js.map +1 -0
- package/build/lib/commands/alert.d.ts +42 -45
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +66 -62
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +150 -153
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +300 -286
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/app-strings.d.ts +14 -17
- package/build/lib/commands/app-strings.d.ts.map +1 -1
- package/build/lib/commands/app-strings.js +23 -24
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +19 -22
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +56 -56
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/audit.d.ts +22 -17
- package/build/lib/commands/audit.d.ts.map +1 -1
- package/build/lib/commands/audit.js +17 -18
- package/build/lib/commands/audit.js.map +1 -1
- package/build/lib/commands/battery.d.ts +11 -14
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +36 -37
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/biometric.d.ts +30 -33
- package/build/lib/commands/biometric.d.ts.map +1 -1
- package/build/lib/commands/biometric.js +42 -41
- package/build/lib/commands/biometric.js.map +1 -1
- package/build/lib/commands/certificate.d.ts +48 -45
- package/build/lib/commands/certificate.d.ts.map +1 -1
- package/build/lib/commands/certificate.js +218 -205
- package/build/lib/commands/certificate.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +19 -22
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +30 -30
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/condition.d.ts +49 -26
- package/build/lib/commands/condition.d.ts.map +1 -1
- package/build/lib/commands/condition.js +87 -86
- package/build/lib/commands/condition.js.map +1 -1
- package/build/lib/commands/content-size.d.ts +26 -29
- package/build/lib/commands/content-size.d.ts.map +1 -1
- package/build/lib/commands/content-size.js +36 -36
- package/build/lib/commands/content-size.js.map +1 -1
- package/build/lib/commands/context.d.ts +161 -108
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +530 -517
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/deviceInfo.d.ts +9 -12
- package/build/lib/commands/deviceInfo.d.ts.map +1 -1
- package/build/lib/commands/deviceInfo.js +17 -18
- package/build/lib/commands/deviceInfo.js.map +1 -1
- package/build/lib/commands/element.d.ts +102 -105
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +337 -323
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +24 -19
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +63 -62
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-movement.d.ts +77 -80
- package/build/lib/commands/file-movement.d.ts.map +1 -1
- package/build/lib/commands/file-movement.js +130 -124
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/commands/find.d.ts +18 -21
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +158 -156
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +124 -116
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +248 -232
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +43 -46
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +10 -11
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/gesture.d.ts +273 -276
- package/build/lib/commands/gesture.d.ts.map +1 -1
- package/build/lib/commands/gesture.js +506 -492
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/commands/increase-contrast.d.ts +20 -23
- package/build/lib/commands/increase-contrast.d.ts.map +1 -1
- package/build/lib/commands/increase-contrast.js +30 -30
- package/build/lib/commands/increase-contrast.js.map +1 -1
- package/build/lib/commands/iohid.d.ts +1370 -1373
- package/build/lib/commands/iohid.d.ts.map +1 -1
- package/build/lib/commands/iohid.js +30 -31
- package/build/lib/commands/iohid.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +29 -32
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +53 -51
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/keychains.d.ts +9 -12
- package/build/lib/commands/keychains.d.ts.map +1 -1
- package/build/lib/commands/keychains.js +13 -14
- package/build/lib/commands/keychains.js.map +1 -1
- package/build/lib/commands/localization.d.ts +16 -19
- package/build/lib/commands/localization.d.ts.map +1 -1
- package/build/lib/commands/localization.js +25 -26
- package/build/lib/commands/localization.js.map +1 -1
- package/build/lib/commands/location.d.ts +36 -39
- package/build/lib/commands/location.d.ts.map +1 -1
- package/build/lib/commands/location.js +99 -98
- package/build/lib/commands/location.js.map +1 -1
- package/build/lib/commands/lock.d.ts +21 -24
- package/build/lib/commands/lock.d.ts.map +1 -1
- package/build/lib/commands/lock.js +39 -38
- package/build/lib/commands/lock.js.map +1 -1
- package/build/lib/commands/log.d.ts +43 -37
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +174 -171
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/memory.d.ts +9 -12
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +37 -39
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +30 -33
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +92 -92
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/notifications.d.ts +26 -29
- package/build/lib/commands/notifications.d.ts.map +1 -1
- package/build/lib/commands/notifications.js +53 -53
- package/build/lib/commands/notifications.js.map +1 -1
- package/build/lib/commands/pasteboard.d.ts +21 -24
- package/build/lib/commands/pasteboard.d.ts.map +1 -1
- package/build/lib/commands/pasteboard.js +37 -37
- package/build/lib/commands/pasteboard.js.map +1 -1
- package/build/lib/commands/pcap.d.ts +39 -26
- package/build/lib/commands/pcap.d.ts.map +1 -1
- package/build/lib/commands/pcap.js +81 -81
- package/build/lib/commands/pcap.js.map +1 -1
- package/build/lib/commands/performance.d.ts +63 -44
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +105 -105
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +33 -36
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +66 -65
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/proxy-helper.d.ts +12 -15
- package/build/lib/commands/proxy-helper.d.ts.map +1 -1
- package/build/lib/commands/proxy-helper.js +53 -54
- package/build/lib/commands/proxy-helper.js.map +1 -1
- package/build/lib/commands/record-audio.d.ts +49 -29
- package/build/lib/commands/record-audio.d.ts.map +1 -1
- package/build/lib/commands/record-audio.js +100 -104
- package/build/lib/commands/record-audio.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +54 -18
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +127 -129
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +14 -17
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +108 -107
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/simctl.d.ts +11 -14
- package/build/lib/commands/simctl.d.ts.map +1 -1
- package/build/lib/commands/simctl.js +23 -26
- package/build/lib/commands/simctl.js.map +1 -1
- package/build/lib/commands/source.d.ts +14 -17
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js +40 -43
- package/build/lib/commands/source.js.map +1 -1
- package/build/lib/commands/timeouts.d.ts +44 -33
- package/build/lib/commands/timeouts.d.ts.map +1 -1
- package/build/lib/commands/timeouts.js +65 -63
- package/build/lib/commands/timeouts.js.map +1 -1
- package/build/lib/commands/web.d.ts +247 -197
- package/build/lib/commands/web.d.ts.map +1 -1
- package/build/lib/commands/web.js +815 -786
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/commands/xctest-record-screen.d.ts +63 -66
- package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
- package/build/lib/commands/xctest-record-screen.js +103 -102
- package/build/lib/commands/xctest-record-screen.js.map +1 -1
- package/build/lib/commands/xctest.d.ts +55 -51
- package/build/lib/commands/xctest.d.ts.map +1 -1
- package/build/lib/commands/xctest.js +116 -117
- package/build/lib/commands/xctest.js.map +1 -1
- package/build/lib/driver.d.ts +278 -1597
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +320 -236
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +9 -0
- package/build/lib/execute-method-map.js.map +1 -1
- package/build/lib/real-device.d.ts +1 -1
- package/build/lib/real-device.d.ts.map +1 -1
- package/build/lib/real-device.js +2 -2
- package/build/lib/real-device.js.map +1 -1
- package/lib/commands/active-app-info.js +12 -0
- package/lib/commands/alert.js +68 -65
- package/lib/commands/app-management.js +308 -301
- package/lib/commands/app-strings.js +24 -26
- package/lib/commands/appearance.js +54 -56
- package/lib/commands/audit.js +18 -20
- package/lib/commands/battery.js +35 -37
- package/lib/commands/biometric.js +44 -46
- package/lib/commands/certificate.js +226 -215
- package/lib/commands/clipboard.js +30 -32
- package/lib/commands/condition.js +98 -100
- package/lib/commands/content-size.js +36 -38
- package/lib/commands/context.js +495 -490
- package/lib/commands/deviceInfo.js +19 -20
- package/lib/commands/element.js +367 -357
- package/lib/commands/execute.js +72 -72
- package/lib/commands/file-movement.js +132 -134
- package/lib/commands/find.js +160 -159
- package/lib/commands/general.js +238 -231
- package/lib/commands/geolocation.js +6 -14
- package/lib/commands/gesture.js +525 -515
- package/lib/commands/increase-contrast.js +30 -32
- package/lib/commands/iohid.js +32 -34
- package/lib/commands/keyboard.js +49 -51
- package/lib/commands/keychains.js +12 -14
- package/lib/commands/localization.js +24 -26
- package/lib/commands/location.js +102 -104
- package/lib/commands/lock.js +38 -38
- package/lib/commands/log.js +197 -198
- package/lib/commands/memory.js +40 -43
- package/lib/commands/navigation.js +96 -100
- package/lib/commands/notifications.js +57 -59
- package/lib/commands/pasteboard.js +37 -39
- package/lib/commands/pcap.js +84 -86
- package/lib/commands/performance.js +132 -133
- package/lib/commands/permissions.js +67 -69
- package/lib/commands/proxy-helper.js +60 -61
- package/lib/commands/record-audio.js +115 -120
- package/lib/commands/recordscreen.js +145 -149
- package/lib/commands/screenshots.js +116 -116
- package/lib/commands/simctl.js +25 -29
- package/lib/commands/source.js +42 -46
- package/lib/commands/timeouts.js +59 -63
- package/lib/commands/web.js +878 -858
- package/lib/commands/xctest-record-screen.js +103 -105
- package/lib/commands/xctest.js +134 -139
- package/lib/driver.js +288 -236
- package/lib/execute-method-map.ts +9 -0
- package/lib/real-device.js +2 -2
- package/npm-shrinkwrap.json +440 -76
- package/package.json +2 -1
- package/build/lib/commands/activeAppInfo.d.ts +0 -12
- package/build/lib/commands/activeAppInfo.d.ts.map +0 -1
- package/build/lib/commands/activeAppInfo.js +0 -15
- package/build/lib/commands/activeAppInfo.js.map +0 -1
- package/build/lib/commands/index.d.ts +0 -96
- package/build/lib/commands/index.d.ts.map +0 -1
- package/build/lib/commands/index.js +0 -100
- package/build/lib/commands/index.js.map +0 -1
- package/build/lib/real-device-clients/devicectl.d.ts +0 -204
- package/build/lib/real-device-clients/devicectl.d.ts.map +0 -1
- package/build/lib/real-device-clients/devicectl.js +0 -264
- package/build/lib/real-device-clients/devicectl.js.map +0 -1
- package/lib/commands/activeAppInfo.js +0 -14
- package/lib/commands/index.js +0 -95
- package/lib/real-device-clients/devicectl.js +0 -291
|
@@ -3,174 +3,176 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findElOrEls = findElOrEls;
|
|
7
|
+
exports.findNativeElementOrElements = findNativeElementOrElements;
|
|
8
|
+
exports.doNativeFind = doNativeFind;
|
|
9
|
+
exports.getFirstVisibleChild = getFirstVisibleChild;
|
|
6
10
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
11
|
const css_converter_1 = __importDefault(require("../css-converter"));
|
|
8
12
|
const driver_1 = require("appium/driver");
|
|
9
13
|
const support_1 = require("appium/support");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
strategy = WDA_CLASS_CHAIN_STRATEGY;
|
|
47
|
-
selector = css_converter_1.default.toIosClassChainSelector(selector);
|
|
14
|
+
/**
|
|
15
|
+
* @this {XCUITestDriver}
|
|
16
|
+
*/
|
|
17
|
+
async function findElOrEls(strategy, selector, mult, context) {
|
|
18
|
+
if (this.isWebview()) {
|
|
19
|
+
return await this.findWebElementOrElements(strategy, selector, mult, context);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return await this.findNativeElementOrElements(strategy, selector, mult, context);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @this {XCUITestDriver}
|
|
27
|
+
* @privateRemarks I'm not sure what these objects are; they aren't `Element`.
|
|
28
|
+
* @returns {Promise<any|any[]|undefined>}
|
|
29
|
+
*/
|
|
30
|
+
async function findNativeElementOrElements(strategy, selector, mult, context) {
|
|
31
|
+
const initSelector = selector;
|
|
32
|
+
let rewroteSelector = false;
|
|
33
|
+
if (strategy === '-ios predicate string') {
|
|
34
|
+
// WebDriverAgent uses 'predicate string'
|
|
35
|
+
strategy = 'predicate string';
|
|
36
|
+
}
|
|
37
|
+
else if (strategy === '-ios class chain') {
|
|
38
|
+
// WebDriverAgent uses 'class chain'
|
|
39
|
+
strategy = WDA_CLASS_CHAIN_STRATEGY;
|
|
40
|
+
}
|
|
41
|
+
else if (strategy === 'css selector') {
|
|
42
|
+
strategy = WDA_CLASS_CHAIN_STRATEGY;
|
|
43
|
+
selector = css_converter_1.default.toIosClassChainSelector(selector);
|
|
44
|
+
}
|
|
45
|
+
if (strategy === 'class name') {
|
|
46
|
+
// XCUITest classes have `XCUIElementType` prepended
|
|
47
|
+
// first check if there is the old `UIA` prefix
|
|
48
|
+
if (selector.startsWith('UIA')) {
|
|
49
|
+
selector = selector.substring(3);
|
|
48
50
|
}
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const keepView = [
|
|
54
|
-
'XCUIElementTypeScrollView',
|
|
55
|
-
'XCUIElementTypeCollectionView',
|
|
56
|
-
'XCUIElementTypeTextView',
|
|
57
|
-
'XCUIElementTypeWebView',
|
|
58
|
-
].includes(selector);
|
|
59
|
-
if (!keepView && selector.indexOf('View') === selector.length - 4) {
|
|
60
|
-
return selector.substr(0, selector.length - 4);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
return selector;
|
|
64
|
-
}
|
|
51
|
+
// now check if we need to add `XCUIElementType`
|
|
52
|
+
if (!selector.startsWith('XCUIElementType')) {
|
|
53
|
+
selector = stripViewFromSelector(`XCUIElementType${selector}`);
|
|
54
|
+
rewroteSelector = true;
|
|
65
55
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
56
|
+
}
|
|
57
|
+
if (strategy === 'xpath' && MAGIC_FIRST_VIS_CHILD_SEL.test(selector)) {
|
|
58
|
+
return await this.getFirstVisibleChild(mult, context);
|
|
59
|
+
}
|
|
60
|
+
else if (strategy === 'xpath' && MAGIC_SCROLLABLE_SEL.test(selector)) {
|
|
61
|
+
[strategy, selector] = rewriteMagicScrollable(mult, this.log);
|
|
62
|
+
}
|
|
63
|
+
else if (strategy === 'xpath') {
|
|
64
|
+
// Replace UIA if it comes after a forward slash or is at the beginning of the string
|
|
65
|
+
selector = selector.replace(/(^|\/)(UIA)([^[/]+)/g, (str, g1, g2, g3) => {
|
|
66
|
+
rewroteSelector = true;
|
|
67
|
+
return g1 + stripViewFromSelector(`XCUIElementType${g3}`);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (rewroteSelector) {
|
|
71
|
+
this.log.info(`Rewrote incoming selector from '${initSelector}' to ` +
|
|
72
|
+
`'${selector}' to match XCUI type. You should consider ` +
|
|
73
|
+
`updating your tests to use the new selectors directly`);
|
|
74
|
+
}
|
|
75
|
+
return await this.doNativeFind(strategy, selector, mult, context);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @this {XCUITestDriver}
|
|
79
|
+
*/
|
|
80
|
+
async function doNativeFind(strategy, selector, mult, context) {
|
|
81
|
+
context = support_1.util.unwrapElement(context);
|
|
82
|
+
let endpoint = `/element${context ? `/${context}/element` : ''}${mult ? 's' : ''}`;
|
|
83
|
+
let body = {
|
|
84
|
+
using: strategy,
|
|
85
|
+
value: selector,
|
|
86
|
+
};
|
|
87
|
+
/** @type {import('./proxy-helper').AllowedHttpMethod} */
|
|
88
|
+
const method = 'POST';
|
|
89
|
+
// This is either an array is mult === true
|
|
90
|
+
// or an object if mult === false
|
|
91
|
+
/** @type {Element[]|undefined} */
|
|
92
|
+
let els;
|
|
93
|
+
try {
|
|
94
|
+
await this.implicitWaitForCondition(async () => {
|
|
95
|
+
try {
|
|
96
|
+
els = /** @type {Element[]|undefined} */ (await this.proxyCommand(endpoint, method, body));
|
|
76
97
|
}
|
|
77
|
-
|
|
78
|
-
if (strategy === 'xpath' && MAGIC_FIRST_VIS_CHILD_SEL.test(selector)) {
|
|
79
|
-
return await this.getFirstVisibleChild(mult, context);
|
|
80
|
-
}
|
|
81
|
-
else if (strategy === 'xpath' && MAGIC_SCROLLABLE_SEL.test(selector)) {
|
|
82
|
-
[strategy, selector] = rewriteMagicScrollable(mult, this.log);
|
|
83
|
-
}
|
|
84
|
-
else if (strategy === 'xpath') {
|
|
85
|
-
// Replace UIA if it comes after a forward slash or is at the beginning of the string
|
|
86
|
-
selector = selector.replace(/(^|\/)(UIA)([^[/]+)/g, (str, g1, g2, g3) => {
|
|
87
|
-
rewroteSelector = true;
|
|
88
|
-
return g1 + stripViewFromSelector(`XCUIElementType${g3}`);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
if (rewroteSelector) {
|
|
92
|
-
this.log.info(`Rewrote incoming selector from '${initSelector}' to ` +
|
|
93
|
-
`'${selector}' to match XCUI type. You should consider ` +
|
|
94
|
-
`updating your tests to use the new selectors directly`);
|
|
95
|
-
}
|
|
96
|
-
return await this.doNativeFind(strategy, selector, mult, context);
|
|
97
|
-
},
|
|
98
|
-
/**
|
|
99
|
-
* @this {XCUITestDriver}
|
|
100
|
-
*/
|
|
101
|
-
async doNativeFind(strategy, selector, mult, context) {
|
|
102
|
-
context = support_1.util.unwrapElement(context);
|
|
103
|
-
let endpoint = `/element${context ? `/${context}/element` : ''}${mult ? 's' : ''}`;
|
|
104
|
-
let body = {
|
|
105
|
-
using: strategy,
|
|
106
|
-
value: selector,
|
|
107
|
-
};
|
|
108
|
-
/** @type {import('./proxy-helper').AllowedHttpMethod} */
|
|
109
|
-
const method = 'POST';
|
|
110
|
-
// This is either an array is mult === true
|
|
111
|
-
// or an object if mult === false
|
|
112
|
-
/** @type {Element[]|undefined} */
|
|
113
|
-
let els;
|
|
114
|
-
try {
|
|
115
|
-
await this.implicitWaitForCondition(async () => {
|
|
116
|
-
try {
|
|
117
|
-
els = /** @type {Element[]|undefined} */ (await this.proxyCommand(endpoint, method, body));
|
|
118
|
-
}
|
|
119
|
-
catch {
|
|
120
|
-
els = [];
|
|
121
|
-
}
|
|
122
|
-
// we succeed if we get some elements
|
|
123
|
-
return !lodash_1.default.isEmpty(els);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
catch (err) {
|
|
127
|
-
if (err.message?.match(/Condition unmet/)) {
|
|
128
|
-
// condition was not met setting res to empty array
|
|
98
|
+
catch {
|
|
129
99
|
els = [];
|
|
130
100
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
101
|
+
// we succeed if we get some elements
|
|
102
|
+
return !lodash_1.default.isEmpty(els);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
if (err.message?.match(/Condition unmet/)) {
|
|
107
|
+
// condition was not met setting res to empty array
|
|
108
|
+
els = [];
|
|
137
109
|
}
|
|
138
|
-
|
|
139
|
-
throw
|
|
110
|
+
else {
|
|
111
|
+
throw err;
|
|
140
112
|
}
|
|
113
|
+
}
|
|
114
|
+
if (mult) {
|
|
141
115
|
return els;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
116
|
+
}
|
|
117
|
+
if (lodash_1.default.isEmpty(els)) {
|
|
118
|
+
throw new driver_1.errors.NoSuchElementError();
|
|
119
|
+
}
|
|
120
|
+
return els;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @this {XCUITestDriver}
|
|
124
|
+
*/
|
|
125
|
+
async function getFirstVisibleChild(mult, context) {
|
|
126
|
+
this.log.info(`Getting first visible child`);
|
|
127
|
+
if (mult) {
|
|
128
|
+
throw new Error('Cannot get multiple first visible children!');
|
|
129
|
+
}
|
|
130
|
+
if (!context) {
|
|
131
|
+
throw new Error('Cannot get first visible child without a context element');
|
|
132
|
+
}
|
|
133
|
+
let index = 1;
|
|
134
|
+
// loop through children via class-chain finds, until we run out of children
|
|
135
|
+
// or we find a visible one. This loop looks infinite but its not, because at
|
|
136
|
+
// some point the call to doNativeFind will throw with an Element Not Found
|
|
137
|
+
// error, when the index gets higher than the number of child elements. This
|
|
138
|
+
// is what we want because that error will halt the loop and make it all the
|
|
139
|
+
// way to the client.
|
|
140
|
+
while (true) {
|
|
141
|
+
const strategy = WDA_CLASS_CHAIN_STRATEGY;
|
|
142
|
+
const selector = `*[${index}]`;
|
|
143
|
+
const nthChild = await this.doNativeFind(strategy, selector, false, context);
|
|
144
|
+
const visible = await this.getAttribute('visible', nthChild);
|
|
145
|
+
if (visible === 'true') {
|
|
146
|
+
this.log.info(`Found first visible child at position ${index}`);
|
|
147
|
+
return nthChild;
|
|
148
|
+
}
|
|
149
|
+
index++;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// we override the xpath search for this first-visible-child selector, which
|
|
153
|
+
// looks like /*[@firstVisible="true"]
|
|
154
|
+
const MAGIC_FIRST_VIS_CHILD_SEL = /\/\*\[@firstVisible\s*=\s*('|")true\1\]/;
|
|
155
|
+
// we likewise override xpath search to provide a shortcut for finding all
|
|
156
|
+
// scrollable elements
|
|
157
|
+
const MAGIC_SCROLLABLE_SEL = /\/\/\*\[@scrollable\s*=\s*('|")true\1\]/;
|
|
158
|
+
const WDA_CLASS_CHAIN_STRATEGY = 'class chain';
|
|
159
|
+
// Check if the word 'View' is appended to selector and if it is, strip it out
|
|
160
|
+
function stripViewFromSelector(selector) {
|
|
161
|
+
// Don't strip it out if it's one of these 4 element types
|
|
162
|
+
// (see https://github.com/facebook/WebDriverAgent/blob/master/WebDriverAgentLib/Utilities/FBElementTypeTransformer.m for reference)
|
|
163
|
+
const keepView = [
|
|
164
|
+
'XCUIElementTypeScrollView',
|
|
165
|
+
'XCUIElementTypeCollectionView',
|
|
166
|
+
'XCUIElementTypeTextView',
|
|
167
|
+
'XCUIElementTypeWebView',
|
|
168
|
+
].includes(selector);
|
|
169
|
+
if (!keepView && selector.indexOf('View') === selector.length - 4) {
|
|
170
|
+
return selector.substr(0, selector.length - 4);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return selector;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
174
176
|
/**
|
|
175
177
|
*
|
|
176
178
|
* @param {boolean} mult
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.js"],"names":[],"mappings":";;;;;AAQA,kCAMC;AAOD,kEAgDC;AAKD,oCA4CC;AAKD,oDA0BC;AArJD,oDAAuB;AACvB,qEAA4C;AAC5C,0CAAq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BAA+B;QAC/B,yBAAyB;QACzB,wBAAwB;KACzB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAErB,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAC9C,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,CAAC;SAC9D,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,GAAG,CAAC;SAC3C,IAAI,CAAC,MAAM,CAAC,CAAC;IAChB,MAAM,QAAQ,GAAG,wBAAwB,CAAC;IAC1C,IAAI,QAAQ,GAAG,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,QAAQ,IAAI,KAAK,CAAC;IACpB,CAAC;IACD,GAAG,EAAE,IAAI,CACP,4DAA4D;QAC1D,yBAAyB,QAAQ,GAAG,CACvC,CAAC;IACF,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG"}
|
|
@@ -1,4 +1,127 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @this {XCUITestDriver}
|
|
3
|
+
*/
|
|
4
|
+
export function active(this: import("../driver").XCUITestDriver): Promise<any>;
|
|
5
|
+
/**
|
|
6
|
+
* Trigger a touch/fingerprint match or match failure
|
|
7
|
+
*
|
|
8
|
+
* @param {boolean} match - whether the match should be a success or failure
|
|
9
|
+
* @this {XCUITestDriver}
|
|
10
|
+
*/
|
|
11
|
+
export function touchId(this: import("../driver").XCUITestDriver, match?: boolean): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Toggle whether the device is enrolled in the touch ID program
|
|
14
|
+
*
|
|
15
|
+
* @param {boolean} isEnabled - whether to enable or disable the touch ID program
|
|
16
|
+
*
|
|
17
|
+
* @this {XCUITestDriver}
|
|
18
|
+
*/
|
|
19
|
+
export function toggleEnrollTouchId(this: import("../driver").XCUITestDriver, isEnabled?: boolean): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the window size
|
|
22
|
+
* @this {XCUITestDriver}
|
|
23
|
+
* @returns {Promise<import('@appium/types').Size>}
|
|
24
|
+
*/
|
|
25
|
+
export function getWindowSize(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Size>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves the actual device time.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
|
|
30
|
+
* @returns {Promise<string>} Formatted datetime string or the raw command output (if formatting fails)
|
|
31
|
+
* @this {XCUITestDriver}
|
|
32
|
+
*/
|
|
33
|
+
export function getDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves the current device time
|
|
36
|
+
*
|
|
37
|
+
* @param {string} format - See {@linkcode getDeviceTime.format}
|
|
38
|
+
* @returns {Promise<string>} Formatted datetime string or the raw command output if formatting fails
|
|
39
|
+
* @this {XCUITestDriver}
|
|
40
|
+
*/
|
|
41
|
+
export function mobileGetDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* For W3C
|
|
44
|
+
* @this {XCUITestDriver}
|
|
45
|
+
* @return {Promise<import('@appium/types').Rect>}
|
|
46
|
+
*/
|
|
47
|
+
export function getWindowRect(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Rect>;
|
|
48
|
+
/**
|
|
49
|
+
* @this {XCUITestDriver}
|
|
50
|
+
*/
|
|
51
|
+
export function removeApp(this: import("../driver").XCUITestDriver, bundleId: any): Promise<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* @this {XCUITestDriver}
|
|
54
|
+
*/
|
|
55
|
+
export function launchApp(this: import("../driver").XCUITestDriver): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* @this {XCUITestDriver}
|
|
58
|
+
*/
|
|
59
|
+
export function closeApp(this: import("../driver").XCUITestDriver): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* @this {XCUITestDriver}
|
|
62
|
+
* @param {string} url
|
|
63
|
+
* @returns {Promise<void>}
|
|
64
|
+
*/
|
|
65
|
+
export function setUrl(this: import("../driver").XCUITestDriver, url: string): Promise<void>;
|
|
66
|
+
export class setUrl {
|
|
67
|
+
/**
|
|
68
|
+
* @this {XCUITestDriver}
|
|
69
|
+
* @param {string} url
|
|
70
|
+
* @returns {Promise<void>}
|
|
71
|
+
*/
|
|
72
|
+
constructor(this: import("../driver").XCUITestDriver, url: string);
|
|
73
|
+
curWebFrames: any[] | undefined;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the viewport dimensions.
|
|
77
|
+
*
|
|
78
|
+
* The viewport is the device's screen size with status bar size subtracted if the latter is present/visible.
|
|
79
|
+
* @returns {Promise<import('./types').Viewport>}
|
|
80
|
+
* @this {XCUITestDriver}
|
|
81
|
+
*/
|
|
82
|
+
export function getViewportRect(this: import("../driver").XCUITestDriver): Promise<import("./types").Viewport>;
|
|
83
|
+
/**
|
|
84
|
+
* Get information about the screen.
|
|
85
|
+
*
|
|
86
|
+
* @privateRemarks memoized in constructor
|
|
87
|
+
* @this {XCUITestDriver}
|
|
88
|
+
* @returns {Promise<ScreenInfo>}
|
|
89
|
+
*/
|
|
90
|
+
export function getScreenInfo(this: import("../driver").XCUITestDriver): Promise<ScreenInfo>;
|
|
91
|
+
/**
|
|
92
|
+
* @this {XCUITestDriver}
|
|
93
|
+
*/
|
|
94
|
+
export function getStatusBarHeight(this: import("../driver").XCUITestDriver): Promise<number>;
|
|
95
|
+
/**
|
|
96
|
+
* memoized in constructor
|
|
97
|
+
* @this {XCUITestDriver}
|
|
98
|
+
*/
|
|
99
|
+
export function getDevicePixelRatio(this: import("../driver").XCUITestDriver): Promise<number>;
|
|
100
|
+
/**
|
|
101
|
+
* Emulates press action on the given physical device button.
|
|
102
|
+
*
|
|
103
|
+
* This executes different methods based on the platform:
|
|
104
|
+
*
|
|
105
|
+
* - iOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
|
|
106
|
+
* - tvOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627475-pressbutton) or [`pressButton:forDuration:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627476-pressbutton)
|
|
107
|
+
*
|
|
108
|
+
* Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
|
|
109
|
+
*
|
|
110
|
+
* @param {import('./types').ButtonName} name - The name of the button to be pressed.
|
|
111
|
+
* @param {number} [durationSeconds] - The duration of the button press in seconds (float).
|
|
112
|
+
* @this {XCUITestDriver}
|
|
113
|
+
*/
|
|
114
|
+
export function mobilePressButton(this: import("../driver").XCUITestDriver, name: import("./types").ButtonName, durationSeconds?: number): Promise<unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* Process a string as speech and send it to Siri.
|
|
117
|
+
*
|
|
118
|
+
* Presents the Siri UI, if it is not currently active, and accepts a string which is then processed as if it were recognized speech. See [the documentation of `activateWithVoiceRecognitionText`](https://developer.apple.com/documentation/xctest/xcuisiriservice/2852140-activatewithvoicerecognitiontext?language=objc) for more details.
|
|
119
|
+
|
|
120
|
+
* @param {string} text - Text to be sent to Siri
|
|
121
|
+
* @returns {Promise<void>}
|
|
122
|
+
* @this {XCUITestDriver}
|
|
123
|
+
*/
|
|
124
|
+
export function mobileSiriCommand(this: import("../driver").XCUITestDriver, text: string): Promise<void>;
|
|
2
125
|
export type PressButtonOptions = {
|
|
3
126
|
/**
|
|
4
127
|
* - The name of the button to be pressed.
|
|
@@ -11,119 +134,4 @@ export type PressButtonOptions = {
|
|
|
11
134
|
};
|
|
12
135
|
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
13
136
|
export type ScreenInfo = import("./types").ScreenInfo;
|
|
14
|
-
declare namespace commands {
|
|
15
|
-
/**
|
|
16
|
-
* @this {XCUITestDriver}
|
|
17
|
-
*/
|
|
18
|
-
function active(this: import("../driver").XCUITestDriver): Promise<any>;
|
|
19
|
-
/**
|
|
20
|
-
* Trigger a touch/fingerprint match or match failure
|
|
21
|
-
*
|
|
22
|
-
* @param {boolean} match - whether the match should be a success or failure
|
|
23
|
-
* @this {XCUITestDriver}
|
|
24
|
-
*/
|
|
25
|
-
function touchId(this: import("../driver").XCUITestDriver, match?: boolean): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Toggle whether the device is enrolled in the touch ID program
|
|
28
|
-
*
|
|
29
|
-
* @param {boolean} isEnabled - whether to enable or disable the touch ID program
|
|
30
|
-
*
|
|
31
|
-
* @this {XCUITestDriver}
|
|
32
|
-
*/
|
|
33
|
-
function toggleEnrollTouchId(this: import("../driver").XCUITestDriver, isEnabled?: boolean): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Get the window size
|
|
36
|
-
* @this {XCUITestDriver}
|
|
37
|
-
* @returns {Promise<import('@appium/types').Size>}
|
|
38
|
-
*/
|
|
39
|
-
function getWindowSize(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Size>;
|
|
40
|
-
/**
|
|
41
|
-
* Retrieves the actual device time.
|
|
42
|
-
*
|
|
43
|
-
* @param {string} format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
|
|
44
|
-
* @returns {Promise<string>} Formatted datetime string or the raw command output (if formatting fails)
|
|
45
|
-
* @this {XCUITestDriver}
|
|
46
|
-
*/
|
|
47
|
-
function getDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
|
|
48
|
-
/**
|
|
49
|
-
* Retrieves the current device time
|
|
50
|
-
*
|
|
51
|
-
* @param {string} format - See {@linkcode getDeviceTime.format}
|
|
52
|
-
* @returns {Promise<string>} Formatted datetime string or the raw command output if formatting fails
|
|
53
|
-
* @this {XCUITestDriver}
|
|
54
|
-
*/
|
|
55
|
-
function mobileGetDeviceTime(this: import("../driver").XCUITestDriver, format?: string): Promise<string>;
|
|
56
|
-
/**
|
|
57
|
-
* For W3C
|
|
58
|
-
* @this {XCUITestDriver}
|
|
59
|
-
* @return {Promise<import('@appium/types').Rect>}
|
|
60
|
-
*/
|
|
61
|
-
function getWindowRect(this: import("../driver").XCUITestDriver): Promise<import("@appium/types").Rect>;
|
|
62
|
-
/**
|
|
63
|
-
* @this {XCUITestDriver}
|
|
64
|
-
*/
|
|
65
|
-
function removeApp(this: import("../driver").XCUITestDriver, bundleId: any): Promise<boolean>;
|
|
66
|
-
/**
|
|
67
|
-
* @this {XCUITestDriver}
|
|
68
|
-
*/
|
|
69
|
-
function launchApp(this: import("../driver").XCUITestDriver): Promise<never>;
|
|
70
|
-
/**
|
|
71
|
-
* @this {XCUITestDriver}
|
|
72
|
-
*/
|
|
73
|
-
function closeApp(this: import("../driver").XCUITestDriver): Promise<never>;
|
|
74
|
-
/**
|
|
75
|
-
* @this {XCUITestDriver}
|
|
76
|
-
*/
|
|
77
|
-
function setUrl(this: import("../driver").XCUITestDriver, url: any): Promise<void>;
|
|
78
|
-
/**
|
|
79
|
-
* Retrieves the viewport dimensions.
|
|
80
|
-
*
|
|
81
|
-
* The viewport is the device's screen size with status bar size subtracted if the latter is present/visible.
|
|
82
|
-
* @returns {Promise<import('./types').Viewport>}
|
|
83
|
-
* @this {XCUITestDriver}
|
|
84
|
-
*/
|
|
85
|
-
function getViewportRect(this: import("../driver").XCUITestDriver): Promise<import("./types").Viewport>;
|
|
86
|
-
/**
|
|
87
|
-
* Get information about the screen.
|
|
88
|
-
*
|
|
89
|
-
* @privateRemarks memoized in constructor
|
|
90
|
-
* @this {XCUITestDriver}
|
|
91
|
-
* @returns {Promise<ScreenInfo>}
|
|
92
|
-
*/
|
|
93
|
-
function getScreenInfo(this: import("../driver").XCUITestDriver): Promise<ScreenInfo>;
|
|
94
|
-
/**
|
|
95
|
-
* @this {XCUITestDriver}
|
|
96
|
-
*/
|
|
97
|
-
function getStatusBarHeight(this: import("../driver").XCUITestDriver): Promise<number>;
|
|
98
|
-
/**
|
|
99
|
-
* memoized in constructor
|
|
100
|
-
* @this {XCUITestDriver}
|
|
101
|
-
*/
|
|
102
|
-
function getDevicePixelRatio(this: import("../driver").XCUITestDriver): Promise<number>;
|
|
103
|
-
/**
|
|
104
|
-
* Emulates press action on the given physical device button.
|
|
105
|
-
*
|
|
106
|
-
* This executes different methods based on the platform:
|
|
107
|
-
*
|
|
108
|
-
* - iOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
|
|
109
|
-
* - tvOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627475-pressbutton) or [`pressButton:forDuration:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627476-pressbutton)
|
|
110
|
-
*
|
|
111
|
-
* Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
|
|
112
|
-
*
|
|
113
|
-
* @param {import('./types').ButtonName} name - The name of the button to be pressed.
|
|
114
|
-
* @param {number} [durationSeconds] - The duration of the button press in seconds (float).
|
|
115
|
-
* @this {XCUITestDriver}
|
|
116
|
-
*/
|
|
117
|
-
function mobilePressButton(this: import("../driver").XCUITestDriver, name: import("./types").ButtonName, durationSeconds?: number): Promise<unknown>;
|
|
118
|
-
/**
|
|
119
|
-
* Process a string as speech and send it to Siri.
|
|
120
|
-
*
|
|
121
|
-
* Presents the Siri UI, if it is not currently active, and accepts a string which is then processed as if it were recognized speech. See [the documentation of `activateWithVoiceRecognitionText`](https://developer.apple.com/documentation/xctest/xcuisiriservice/2852140-activatewithvoicerecognitiontext?language=objc) for more details.
|
|
122
|
-
|
|
123
|
-
* @param {string} text - Text to be sent to Siri
|
|
124
|
-
* @returns {Promise<void>}
|
|
125
|
-
* @this {XCUITestDriver}
|
|
126
|
-
*/
|
|
127
|
-
function mobileSiriCommand(this: import("../driver").XCUITestDriver, text: string): Promise<void>;
|
|
128
|
-
}
|
|
129
137
|
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../lib/commands/general.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../lib/commands/general.js"],"names":[],"mappings":"AAQA;;GAEG;AACH,+EAKC;AAED;;;;;GAKG;AACH,0EAHW,OAAO,iBAKjB;AACC;;;;;;GAMG;AACL,0FAJa,OAAO,iBAMnB;AAED;;;;GAIG;AACH,yEAFa,OAAO,CAAC,OAAO,eAAe,EAAE,IAAI,CAAC,CAKjD;AAED;;;;;;GAMG;AACH,iFAJW,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAyC3B;AAED;;;;;;GAMG;AACH,uFAJW,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAK3B;AAED;;;;GAIG;AACH,yEAFY,OAAO,CAAC,OAAO,eAAe,EAAE,IAAI,CAAC,CAgBhD;AAED;;GAEG;AACH,qGAEC;AAED;;GAEG;AACH,mFAKC;AAED;;GAEG;AACH,kFAKC;AAED;;;;GAIG;AACH,sEAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAkBzB;;IArBD;;;;OAIG;IACH,2DAHW,MAAM,EAmBhB;IAVG,gCAAsB;;AAY1B;;;;;;GAMG;AACH,2EAHa,OAAO,CAAC,OAAO,SAAS,EAAE,QAAQ,CAAC,CAiB/C;AAED;;;;;;GAMG;AACH,yEAFa,OAAO,CAAC,UAAU,CAAC,CAI/B;AAED;;GAEG;AACH,8FAGC;AAED;;;GAGG;AACH,+FAGC;AAED;;;;;;;;;;;;;GAaG;AACH,kFAJW,OAAO,SAAS,EAAE,UAAU,oBAC5B,MAAM,oBAWhB;AAED;;;;;;;;GAQG;AACH,kFAJW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAQzB;;;;;UAIa,MAAM;;;;;;6BAKP,OAAO,WAAW,EAAE,cAAc;yBAClC,OAAO,SAAS,EAAE,UAAU"}
|