@limrun/appium-xcuitest-driver 10.11.0-lim.3 → 10.14.6-lim.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +94 -0
- package/build/lib/commands/active-app-info.d.ts +4 -3
- package/build/lib/commands/active-app-info.d.ts.map +1 -1
- package/build/lib/commands/active-app-info.js +2 -3
- package/build/lib/commands/active-app-info.js.map +1 -1
- package/build/lib/commands/alert.d.ts +26 -31
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +20 -29
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +99 -76
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +83 -73
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/app-strings.d.ts +6 -7
- package/build/lib/commands/app-strings.d.ts.map +1 -1
- package/build/lib/commands/app-strings.js +3 -8
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/appearance.d.ts +7 -9
- package/build/lib/commands/appearance.d.ts.map +1 -1
- package/build/lib/commands/appearance.js +13 -19
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/audit.d.ts +5 -33
- package/build/lib/commands/audit.d.ts.map +1 -1
- package/build/lib/commands/audit.js +3 -16
- package/build/lib/commands/audit.js.map +1 -1
- package/build/lib/commands/battery.d.ts +4 -4
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +3 -7
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/biometric.d.ts +12 -14
- package/build/lib/commands/biometric.d.ts.map +1 -1
- package/build/lib/commands/biometric.js +10 -19
- package/build/lib/commands/biometric.js.map +1 -1
- package/build/lib/commands/certificate.d.ts +14 -19
- package/build/lib/commands/certificate.d.ts.map +1 -1
- package/build/lib/commands/certificate.js +24 -31
- package/build/lib/commands/certificate.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +9 -11
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +8 -13
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/condition.d.ts +9 -72
- package/build/lib/commands/condition.d.ts.map +1 -1
- package/build/lib/commands/condition.js +5 -66
- package/build/lib/commands/condition.js.map +1 -1
- package/build/lib/commands/content-size.d.ts +16 -19
- package/build/lib/commands/content-size.d.ts.map +1 -1
- package/build/lib/commands/content-size.js +14 -22
- package/build/lib/commands/content-size.js.map +1 -1
- package/build/lib/commands/context.d.ts +130 -161
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +123 -108
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/device-info.d.ts +13 -0
- package/build/lib/commands/device-info.d.ts.map +1 -0
- package/build/lib/commands/device-info.js +20 -0
- package/build/lib/commands/device-info.js.map +1 -0
- package/build/lib/commands/element.d.ts +83 -67
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +111 -134
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +10 -22
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +13 -29
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-movement.d.ts +31 -42
- package/build/lib/commands/file-movement.d.ts.map +1 -1
- package/build/lib/commands/file-movement.js +146 -205
- package/build/lib/commands/file-movement.js.map +1 -1
- package/build/lib/commands/find.d.ts +20 -12
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +27 -65
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +84 -80
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +67 -54
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/geolocation.d.ts +16 -36
- package/build/lib/commands/geolocation.d.ts.map +1 -1
- package/build/lib/commands/geolocation.js +8 -25
- package/build/lib/commands/geolocation.js.map +1 -1
- package/build/lib/commands/gesture.d.ts +103 -119
- package/build/lib/commands/gesture.d.ts.map +1 -1
- package/build/lib/commands/gesture.js +98 -138
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/commands/increase-contrast.d.ts +10 -13
- package/build/lib/commands/increase-contrast.d.ts.map +1 -1
- package/build/lib/commands/increase-contrast.js +8 -16
- package/build/lib/commands/increase-contrast.js.map +1 -1
- package/build/lib/commands/iohid.d.ts +6 -1359
- package/build/lib/commands/iohid.d.ts.map +1 -1
- package/build/lib/commands/iohid.js +5 -10
- package/build/lib/commands/iohid.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +16 -13
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +14 -18
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/keychains.d.ts +2 -2
- package/build/lib/commands/keychains.d.ts.map +1 -1
- package/build/lib/commands/keychains.js +1 -4
- package/build/lib/commands/keychains.js.map +1 -1
- package/build/lib/commands/localization.d.ts +7 -6
- package/build/lib/commands/localization.d.ts.map +1 -1
- package/build/lib/commands/localization.js +7 -8
- package/build/lib/commands/localization.js.map +1 -1
- package/build/lib/commands/location.d.ts +8 -11
- package/build/lib/commands/location.d.ts.map +1 -1
- package/build/lib/commands/location.js +7 -15
- package/build/lib/commands/location.js.map +1 -1
- package/build/lib/commands/lock.d.ts +6 -10
- package/build/lib/commands/lock.d.ts.map +1 -1
- package/build/lib/commands/lock.js +3 -10
- package/build/lib/commands/lock.js.map +1 -1
- package/build/lib/commands/log.d.ts +42 -44
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +32 -53
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/memory.d.ts +4 -5
- package/build/lib/commands/memory.d.ts.map +1 -1
- package/build/lib/commands/memory.js +3 -8
- package/build/lib/commands/memory.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +14 -26
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +22 -32
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/notifications.d.ts +10 -10
- package/build/lib/commands/notifications.d.ts.map +1 -1
- package/build/lib/commands/notifications.js +8 -12
- package/build/lib/commands/notifications.js.map +1 -1
- package/build/lib/commands/pasteboard.d.ts +9 -10
- package/build/lib/commands/pasteboard.d.ts.map +1 -1
- package/build/lib/commands/pasteboard.js +8 -13
- package/build/lib/commands/pasteboard.js.map +1 -1
- package/build/lib/commands/pcap.d.ts +18 -38
- package/build/lib/commands/pcap.d.ts.map +1 -1
- package/build/lib/commands/pcap.js +9 -14
- package/build/lib/commands/pcap.js.map +1 -1
- package/build/lib/commands/performance.d.ts +36 -55
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +93 -86
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +15 -17
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +12 -18
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/proxy-helper.d.ts +11 -11
- package/build/lib/commands/proxy-helper.d.ts.map +1 -1
- package/build/lib/commands/proxy-helper.js +15 -24
- package/build/lib/commands/proxy-helper.js.map +1 -1
- package/build/lib/commands/record-audio.d.ts +25 -52
- package/build/lib/commands/record-audio.d.ts.map +1 -1
- package/build/lib/commands/record-audio.js +17 -19
- package/build/lib/commands/record-audio.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +31 -62
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +29 -28
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +15 -9
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +16 -16
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/simctl.d.ts +16 -22
- package/build/lib/commands/simctl.d.ts.map +1 -1
- package/build/lib/commands/simctl.js +13 -17
- package/build/lib/commands/simctl.js.map +1 -1
- package/build/lib/commands/source.d.ts +10 -8
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js +11 -14
- package/build/lib/commands/source.js.map +1 -1
- package/build/lib/commands/timeouts.d.ts +25 -32
- package/build/lib/commands/timeouts.d.ts.map +1 -1
- package/build/lib/commands/timeouts.js +19 -15
- package/build/lib/commands/timeouts.js.map +1 -1
- package/build/lib/commands/types.d.ts +80 -0
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/commands/web.d.ts +199 -202
- package/build/lib/commands/web.d.ts.map +1 -1
- package/build/lib/commands/web.js +216 -175
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/commands/xctest-record-screen.d.ts +17 -47
- package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
- package/build/lib/commands/xctest-record-screen.js +28 -59
- package/build/lib/commands/xctest-record-screen.js.map +1 -1
- package/build/lib/commands/xctest.d.ts +37 -37
- package/build/lib/commands/xctest.d.ts.map +1 -1
- package/build/lib/commands/xctest.js +38 -50
- package/build/lib/commands/xctest.js.map +1 -1
- package/build/lib/desired-caps.js +1 -1
- package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -1
- package/build/lib/device/log/ios-simulator-log.js +2 -0
- package/build/lib/device/log/ios-simulator-log.js.map +1 -1
- package/build/lib/device/simulator-management.d.ts.map +1 -1
- package/build/lib/device/simulator-management.js +4 -5
- package/build/lib/device/simulator-management.js.map +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-simulator-log.d.ts +1 -1
- package/build/lib/device-log/ios-simulator-log.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts +0 -9
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js +1 -30
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/driver.d.ts +11 -3
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +36 -12
- 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 +0 -9
- package/build/lib/execute-method-map.js.map +1 -1
- package/build/lib/simulator-management.js +3 -3
- package/build/lib/simulator-management.js.map +1 -1
- package/lib/commands/active-app-info.ts +15 -0
- package/lib/commands/alert.ts +98 -0
- package/lib/commands/app-management.ts +414 -0
- package/lib/commands/{app-strings.js → app-strings.ts} +10 -9
- package/lib/commands/appearance.ts +70 -0
- package/lib/commands/audit.ts +25 -0
- package/lib/commands/{battery.js → battery.ts} +10 -12
- package/lib/commands/biometric.ts +52 -0
- package/lib/commands/{certificate.js → certificate.ts} +55 -50
- package/lib/commands/clipboard.ts +37 -0
- package/lib/commands/{condition.js → condition.ts} +21 -77
- package/lib/commands/content-size.ts +67 -0
- package/lib/commands/{context.js → context.ts} +174 -146
- package/lib/commands/device-info.ts +24 -0
- package/lib/commands/element.ts +419 -0
- package/lib/commands/{execute.js → execute.ts} +42 -38
- package/lib/commands/{file-movement.js → file-movement.ts} +212 -235
- package/lib/commands/find.ts +277 -0
- package/lib/commands/{general.js → general.ts} +102 -77
- package/lib/commands/geolocation.ts +55 -0
- package/lib/commands/{gesture.js → gesture.ts} +225 -183
- package/lib/commands/increase-contrast.ts +49 -0
- package/lib/commands/{iohid.js → iohid.ts} +15 -13
- package/lib/commands/keyboard.ts +70 -0
- package/lib/commands/keychains.ts +16 -0
- package/lib/commands/{localization.js → localization.ts} +22 -12
- package/lib/commands/{location.js → location.ts} +19 -22
- package/lib/commands/lock.ts +43 -0
- package/lib/commands/{log.js → log.ts} +68 -68
- package/lib/commands/{memory.js → memory.ts} +9 -9
- package/lib/commands/{navigation.js → navigation.ts} +42 -39
- package/lib/commands/{notifications.js → notifications.ts} +22 -14
- package/lib/commands/pasteboard.ts +44 -0
- package/lib/commands/{pcap.js → pcap.ts} +28 -28
- package/lib/commands/{performance.js → performance.ts} +133 -114
- package/lib/commands/permissions.ts +90 -0
- package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
- package/lib/commands/{record-audio.js → record-audio.ts} +35 -33
- package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
- package/lib/commands/{screenshots.js → screenshots.ts} +27 -21
- package/lib/commands/simctl.ts +82 -0
- package/lib/commands/{source.js → source.ts} +23 -20
- package/lib/commands/timeouts.ts +95 -0
- package/lib/commands/types.ts +86 -0
- package/lib/commands/{web.js → web.ts} +314 -264
- package/lib/commands/{xctest-record-screen.js → xctest-record-screen.ts} +54 -71
- package/lib/commands/{xctest.js → xctest.ts} +78 -71
- package/lib/desired-caps.ts +1 -1
- package/lib/device/log/ios-simulator-log.ts +2 -0
- package/lib/device/simulator-management.ts +3 -6
- package/lib/doctor/optional-checks.ts +0 -33
- package/lib/driver.ts +38 -13
- package/lib/execute-method-map.ts +0 -9
- package/package.json +6 -5
- package/lib/commands/active-app-info.js +0 -12
- package/lib/commands/alert.js +0 -88
- package/lib/commands/app-management.js +0 -346
- package/lib/commands/appearance.js +0 -71
- package/lib/commands/audit.js +0 -31
- package/lib/commands/biometric.js +0 -52
- package/lib/commands/clipboard.js +0 -35
- package/lib/commands/content-size.js +0 -68
- package/lib/commands/deviceInfo.js +0 -27
- package/lib/commands/element.js +0 -423
- package/lib/commands/find.js +0 -205
- package/lib/commands/geolocation.js +0 -56
- package/lib/commands/increase-contrast.js +0 -50
- package/lib/commands/keyboard.js +0 -62
- package/lib/commands/keychains.js +0 -17
- package/lib/commands/lock.js +0 -46
- package/lib/commands/pasteboard.js +0 -43
- package/lib/commands/permissions.js +0 -85
- package/lib/commands/simctl.js +0 -71
- package/lib/commands/timeouts.js +0 -68
|
@@ -11,31 +11,23 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
11
11
|
const css_converter_1 = require("../css-converter");
|
|
12
12
|
const driver_1 = require("appium/driver");
|
|
13
13
|
const support_1 = require("appium/support");
|
|
14
|
-
/**
|
|
15
|
-
* @this {XCUITestDriver}
|
|
16
|
-
*/
|
|
17
14
|
async function findElOrEls(strategy, selector, mult, context) {
|
|
18
15
|
if (this.isWebview()) {
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return await this.findNativeElementOrElements(strategy, selector, mult, context);
|
|
16
|
+
return mult
|
|
17
|
+
? await this.findWebElementOrElements(strategy, selector, true, context)
|
|
18
|
+
: await this.findWebElementOrElements(strategy, selector, false, context);
|
|
23
19
|
}
|
|
20
|
+
return mult
|
|
21
|
+
? await this.findNativeElementOrElements(strategy, selector, true, context)
|
|
22
|
+
: await this.findNativeElementOrElements(strategy, selector, false, context);
|
|
24
23
|
}
|
|
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
24
|
async function findNativeElementOrElements(strategy, selector, mult, context) {
|
|
31
25
|
const initSelector = selector;
|
|
32
26
|
let rewroteSelector = false;
|
|
33
27
|
if (strategy === '-ios predicate string') {
|
|
34
|
-
// WebDriverAgent uses 'predicate string'
|
|
35
28
|
strategy = 'predicate string';
|
|
36
29
|
}
|
|
37
30
|
else if (strategy === '-ios class chain') {
|
|
38
|
-
// WebDriverAgent uses 'class chain'
|
|
39
31
|
strategy = WDA_CLASS_CHAIN_STRATEGY;
|
|
40
32
|
}
|
|
41
33
|
else if (strategy === 'css selector') {
|
|
@@ -43,12 +35,9 @@ async function findNativeElementOrElements(strategy, selector, mult, context) {
|
|
|
43
35
|
selector = css_converter_1.CssConverter.toIosClassChainSelector(selector);
|
|
44
36
|
}
|
|
45
37
|
if (strategy === 'class name') {
|
|
46
|
-
// XCUITest classes have `XCUIElementType` prepended
|
|
47
|
-
// first check if there is the old `UIA` prefix
|
|
48
38
|
if (selector.startsWith('UIA')) {
|
|
49
39
|
selector = selector.substring(3);
|
|
50
40
|
}
|
|
51
|
-
// now check if we need to add `XCUIElementType`
|
|
52
41
|
if (!selector.startsWith('XCUIElementType')) {
|
|
53
42
|
selector = stripViewFromSelector(`XCUIElementType${selector}`);
|
|
54
43
|
rewroteSelector = true;
|
|
@@ -61,8 +50,7 @@ async function findNativeElementOrElements(strategy, selector, mult, context) {
|
|
|
61
50
|
[strategy, selector] = rewriteMagicScrollable(mult, this.log);
|
|
62
51
|
}
|
|
63
52
|
else if (strategy === 'xpath') {
|
|
64
|
-
|
|
65
|
-
selector = selector.replace(/(^|\/)(UIA)([^[/]+)/g, (str, g1, g2, g3) => {
|
|
53
|
+
selector = selector.replace(/(^|\/)(UIA)([^[/]+)/g, (str, g1, _g2, g3) => {
|
|
66
54
|
rewroteSelector = true;
|
|
67
55
|
return g1 + stripViewFromSelector(`XCUIElementType${g3}`);
|
|
68
56
|
});
|
|
@@ -72,39 +60,32 @@ async function findNativeElementOrElements(strategy, selector, mult, context) {
|
|
|
72
60
|
`'${selector}' to match XCUI type. You should consider ` +
|
|
73
61
|
`updating your tests to use the new selectors directly`);
|
|
74
62
|
}
|
|
75
|
-
return
|
|
63
|
+
return mult
|
|
64
|
+
? await this.doNativeFind(strategy, selector, true, context)
|
|
65
|
+
: await this.doNativeFind(strategy, selector, false, context);
|
|
76
66
|
}
|
|
77
|
-
/**
|
|
78
|
-
* @this {XCUITestDriver}
|
|
79
|
-
*/
|
|
80
67
|
async function doNativeFind(strategy, selector, mult, context) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
68
|
+
const ctx = support_1.util.unwrapElement(context ?? null);
|
|
69
|
+
const endpoint = `/element${ctx ? `/${ctx}/element` : ''}${mult ? 's' : ''}`;
|
|
70
|
+
const body = {
|
|
84
71
|
using: strategy,
|
|
85
72
|
value: selector,
|
|
86
73
|
};
|
|
87
|
-
/** @type {import('./proxy-helper').AllowedHttpMethod} */
|
|
88
74
|
const method = 'POST';
|
|
89
|
-
|
|
90
|
-
// or an object if mult === false
|
|
91
|
-
/** @type {Element[]|undefined} */
|
|
92
|
-
let els;
|
|
75
|
+
let els = [];
|
|
93
76
|
try {
|
|
94
77
|
await this.implicitWaitForCondition(async () => {
|
|
95
78
|
try {
|
|
96
|
-
els =
|
|
79
|
+
els = (await this.proxyCommand(endpoint, method, body));
|
|
97
80
|
}
|
|
98
81
|
catch {
|
|
99
82
|
els = [];
|
|
100
83
|
}
|
|
101
|
-
// we succeed if we get some elements
|
|
102
84
|
return !lodash_1.default.isEmpty(els);
|
|
103
85
|
});
|
|
104
86
|
}
|
|
105
87
|
catch (err) {
|
|
106
88
|
if (err.message?.match(/Condition unmet/)) {
|
|
107
|
-
// condition was not met setting res to empty array
|
|
108
89
|
els = [];
|
|
109
90
|
}
|
|
110
91
|
else {
|
|
@@ -112,15 +93,21 @@ async function doNativeFind(strategy, selector, mult, context) {
|
|
|
112
93
|
}
|
|
113
94
|
}
|
|
114
95
|
if (mult) {
|
|
115
|
-
return els;
|
|
96
|
+
return Array.isArray(els) ? els : [els];
|
|
116
97
|
}
|
|
117
|
-
if (
|
|
98
|
+
if (Array.isArray(els)) {
|
|
99
|
+
if (lodash_1.default.isEmpty(els)) {
|
|
100
|
+
throw new driver_1.errors.NoSuchElementError();
|
|
101
|
+
}
|
|
102
|
+
return els[0];
|
|
103
|
+
}
|
|
104
|
+
if (!els) {
|
|
118
105
|
throw new driver_1.errors.NoSuchElementError();
|
|
119
106
|
}
|
|
120
107
|
return els;
|
|
121
108
|
}
|
|
122
109
|
/**
|
|
123
|
-
*
|
|
110
|
+
* Finds the first visible child element inside a context.
|
|
124
111
|
*/
|
|
125
112
|
async function getFirstVisibleChild(mult, context) {
|
|
126
113
|
this.log.info(`Getting first visible child`);
|
|
@@ -131,16 +118,10 @@ async function getFirstVisibleChild(mult, context) {
|
|
|
131
118
|
throw new Error('Cannot get first visible child without a context element');
|
|
132
119
|
}
|
|
133
120
|
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
121
|
while (true) {
|
|
141
122
|
const strategy = WDA_CLASS_CHAIN_STRATEGY;
|
|
142
123
|
const selector = `*[${index}]`;
|
|
143
|
-
const nthChild = await this.doNativeFind(strategy, selector, false, context);
|
|
124
|
+
const nthChild = (await this.doNativeFind(strategy, selector, false, context));
|
|
144
125
|
const visible = await this.getAttribute('visible', nthChild);
|
|
145
126
|
if (visible === 'true') {
|
|
146
127
|
this.log.info(`Found first visible child at position ${index}`);
|
|
@@ -149,17 +130,10 @@ async function getFirstVisibleChild(mult, context) {
|
|
|
149
130
|
index++;
|
|
150
131
|
}
|
|
151
132
|
}
|
|
152
|
-
// we override the xpath search for this first-visible-child selector, which
|
|
153
|
-
// looks like /*[@firstVisible="true"]
|
|
154
133
|
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
134
|
const MAGIC_SCROLLABLE_SEL = /\/\/\*\[@scrollable\s*=\s*('|")true\1\]/;
|
|
158
135
|
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
136
|
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
137
|
const keepView = [
|
|
164
138
|
'XCUIElementTypeScrollView',
|
|
165
139
|
'XCUIElementTypeCollectionView',
|
|
@@ -167,18 +141,10 @@ function stripViewFromSelector(selector) {
|
|
|
167
141
|
'XCUIElementTypeWebView',
|
|
168
142
|
].includes(selector);
|
|
169
143
|
if (!keepView && selector.indexOf('View') === selector.length - 4) {
|
|
170
|
-
return selector.
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
return selector;
|
|
144
|
+
return selector.substring(0, selector.length - 4);
|
|
174
145
|
}
|
|
146
|
+
return selector;
|
|
175
147
|
}
|
|
176
|
-
/**
|
|
177
|
-
*
|
|
178
|
-
* @param {boolean} mult
|
|
179
|
-
* @param {import('@appium/types').AppiumLogger|null} log
|
|
180
|
-
* @returns {[string, string]}
|
|
181
|
-
*/
|
|
182
148
|
function rewriteMagicScrollable(mult, log = null) {
|
|
183
149
|
const pred = ['ScrollView', 'Table', 'CollectionView', 'WebView']
|
|
184
150
|
.map((t) => `type == "XCUIElementType${t}"`)
|
|
@@ -192,8 +158,4 @@ function rewriteMagicScrollable(mult, log = null) {
|
|
|
192
158
|
`format with selector '${selector}'`);
|
|
193
159
|
return [strategy, selector];
|
|
194
160
|
}
|
|
195
|
-
/**
|
|
196
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
197
|
-
* @typedef {import('@appium/types').Element} Element
|
|
198
|
-
*/
|
|
199
161
|
//# sourceMappingURL=find.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../lib/commands/find.ts"],"names":[],"mappings":";;;;;AAuCA,kCAeC;AA0BD,kEAkDC;AAmCD,oCA+CC;AAKD,oDAwBC;AAjPD,oDAAuB;AACvB,oDAA8C;AAC9C,0CAAqC;AACrC,4CAAoC;AAoC7B,KAAK,UAAU,WAAW,CAE/B,QAAgB,EAChB,QAAgB,EAChB,IAAa,EACb,OAAa;IAEb,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACrB,OAAO,IAAI;YACT,CAAC,CAAC,MAAM,IAAI,CAAC,wBAAwB,CA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,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,MAAM,QAAQ,GAAG;QACf,2BAA2B;QAC3B,+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,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAa,EAAE,MAA2B,IAAI;IAC5E,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"}
|
|
@@ -1,102 +1,121 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { Viewport, ScreenInfo, ButtonName } from './types';
|
|
3
|
+
import type { Size, Rect } from '@appium/types';
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
5
|
+
* Gets the currently active element.
|
|
6
|
+
*
|
|
7
|
+
* In web context, returns the active element from the DOM.
|
|
8
|
+
* In native context, returns the active element from the current view.
|
|
9
|
+
*
|
|
10
|
+
* @returns The active element
|
|
3
11
|
*/
|
|
4
|
-
export function active(this:
|
|
12
|
+
export declare function active(this: XCUITestDriver): Promise<any>;
|
|
5
13
|
/**
|
|
6
|
-
* Trigger a touch/fingerprint match or match failure
|
|
14
|
+
* Trigger a touch/fingerprint match or match failure.
|
|
7
15
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @this {XCUITestDriver}
|
|
16
|
+
* @param match - Whether the match should be a success or failure
|
|
10
17
|
*/
|
|
11
|
-
export function touchId(this:
|
|
18
|
+
export declare function touchId(this: XCUITestDriver, match?: boolean): Promise<void>;
|
|
12
19
|
/**
|
|
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
|
|
20
|
+
* Toggle whether the device is enrolled in the touch ID program.
|
|
16
21
|
*
|
|
17
|
-
* @
|
|
22
|
+
* @param isEnabled - Whether to enable or disable the touch ID program
|
|
18
23
|
*/
|
|
19
|
-
export function toggleEnrollTouchId(this:
|
|
24
|
+
export declare function toggleEnrollTouchId(this: XCUITestDriver, isEnabled?: boolean): Promise<void>;
|
|
20
25
|
/**
|
|
21
|
-
* Get the window size
|
|
22
|
-
*
|
|
23
|
-
* @returns
|
|
26
|
+
* Get the window size.
|
|
27
|
+
*
|
|
28
|
+
* @returns The window size (width and height)
|
|
24
29
|
*/
|
|
25
|
-
export function getWindowSize(this:
|
|
30
|
+
export declare function getWindowSize(this: XCUITestDriver): Promise<Size>;
|
|
26
31
|
/**
|
|
27
32
|
* Retrieves the actual device time.
|
|
28
33
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @returns
|
|
31
|
-
* @this {XCUITestDriver}
|
|
34
|
+
* @param 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.
|
|
35
|
+
* @returns Formatted datetime string or the raw command output (if formatting fails)
|
|
32
36
|
*/
|
|
33
|
-
export function getDeviceTime(this:
|
|
37
|
+
export declare function getDeviceTime(this: XCUITestDriver, format?: string): Promise<string>;
|
|
34
38
|
/**
|
|
35
|
-
* Retrieves the current device time
|
|
39
|
+
* Retrieves the current device time.
|
|
40
|
+
*
|
|
41
|
+
* This is a wrapper around {@linkcode getDeviceTime}.
|
|
36
42
|
*
|
|
37
|
-
* @param
|
|
38
|
-
* @returns
|
|
39
|
-
* @this {XCUITestDriver}
|
|
43
|
+
* @param format - See {@linkcode getDeviceTime.format}
|
|
44
|
+
* @returns Formatted datetime string or the raw command output if formatting fails
|
|
40
45
|
*/
|
|
41
|
-
export function mobileGetDeviceTime(this:
|
|
46
|
+
export declare function mobileGetDeviceTime(this: XCUITestDriver, format?: string): Promise<string>;
|
|
42
47
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
48
|
+
* Gets the window rectangle (position and size).
|
|
49
|
+
*
|
|
50
|
+
* For W3C compatibility. In web context, returns the browser window dimensions.
|
|
51
|
+
* In native context, returns the device window dimensions.
|
|
52
|
+
*
|
|
53
|
+
* @returns The window rectangle
|
|
46
54
|
*/
|
|
47
|
-
export function getWindowRect(this:
|
|
55
|
+
export declare function getWindowRect(this: XCUITestDriver): Promise<Rect>;
|
|
48
56
|
/**
|
|
49
|
-
*
|
|
57
|
+
* Removes/uninstalls the given application from the device under test.
|
|
58
|
+
*
|
|
59
|
+
* This is a wrapper around {@linkcode mobileRemoveApp mobile: removeApp}.
|
|
60
|
+
*
|
|
61
|
+
* @param bundleId - The bundle identifier of the application to be removed
|
|
62
|
+
* @returns `true` if the application has been removed successfully; `false` otherwise
|
|
50
63
|
*/
|
|
51
|
-
export function removeApp(this:
|
|
64
|
+
export declare function removeApp(this: XCUITestDriver, bundleId: string): Promise<boolean>;
|
|
52
65
|
/**
|
|
53
|
-
*
|
|
66
|
+
* Launches the app.
|
|
67
|
+
*
|
|
68
|
+
* @deprecated This API has been deprecated and is not supported anymore.
|
|
69
|
+
* Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
|
|
70
|
+
* @throws {Error} Always throws an error indicating the API is deprecated
|
|
54
71
|
*/
|
|
55
|
-
export function launchApp(this:
|
|
72
|
+
export declare function launchApp(this: XCUITestDriver): Promise<void>;
|
|
56
73
|
/**
|
|
57
|
-
*
|
|
74
|
+
* Closes the app.
|
|
75
|
+
*
|
|
76
|
+
* @deprecated This API has been deprecated and is not supported anymore.
|
|
77
|
+
* Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
|
|
78
|
+
* @throws {Error} Always throws an error indicating the API is deprecated
|
|
58
79
|
*/
|
|
59
|
-
export function closeApp(this:
|
|
80
|
+
export declare function closeApp(this: XCUITestDriver): Promise<void>;
|
|
60
81
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
82
|
+
* Sets the URL for the current session.
|
|
83
|
+
*
|
|
84
|
+
* In web context, navigates to the URL using the remote debugger.
|
|
85
|
+
* In native context on real devices, uses the proxy command.
|
|
86
|
+
* In native context on simulators, uses simctl to open the URL.
|
|
87
|
+
*
|
|
88
|
+
* @param url - The URL to navigate to
|
|
64
89
|
*/
|
|
65
|
-
export function setUrl(this:
|
|
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
|
-
}
|
|
90
|
+
export declare function setUrl(this: XCUITestDriver, url: string): Promise<void>;
|
|
75
91
|
/**
|
|
76
92
|
* Retrieves the viewport dimensions.
|
|
77
93
|
*
|
|
78
94
|
* The viewport is the device's screen size with status bar size subtracted if the latter is present/visible.
|
|
79
|
-
*
|
|
80
|
-
* @
|
|
95
|
+
*
|
|
96
|
+
* @returns The viewport rectangle
|
|
81
97
|
*/
|
|
82
|
-
export function getViewportRect(this:
|
|
98
|
+
export declare function getViewportRect(this: XCUITestDriver): Promise<Viewport>;
|
|
83
99
|
/**
|
|
84
100
|
* Get information about the screen.
|
|
85
101
|
*
|
|
86
102
|
* @privateRemarks memoized in constructor
|
|
87
|
-
* @
|
|
88
|
-
* @returns {Promise<ScreenInfo>}
|
|
103
|
+
* @returns Screen information including dimensions, scale, and status bar size
|
|
89
104
|
*/
|
|
90
|
-
export function getScreenInfo(this:
|
|
105
|
+
export declare function getScreenInfo(this: XCUITestDriver): Promise<ScreenInfo>;
|
|
91
106
|
/**
|
|
92
|
-
*
|
|
107
|
+
* Gets the status bar height.
|
|
108
|
+
*
|
|
109
|
+
* @returns The height of the status bar in logical pixels
|
|
93
110
|
*/
|
|
94
|
-
export function getStatusBarHeight(this:
|
|
111
|
+
export declare function getStatusBarHeight(this: XCUITestDriver): Promise<number>;
|
|
95
112
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
113
|
+
* Gets the device pixel ratio.
|
|
114
|
+
*
|
|
115
|
+
* @privateRemarks memoized in constructor
|
|
116
|
+
* @returns The device pixel ratio (scale factor)
|
|
98
117
|
*/
|
|
99
|
-
export function getDevicePixelRatio(this:
|
|
118
|
+
export declare function getDevicePixelRatio(this: XCUITestDriver): Promise<number>;
|
|
100
119
|
/**
|
|
101
120
|
* Emulates press action on the given physical device button.
|
|
102
121
|
*
|
|
@@ -107,31 +126,16 @@ export function getDevicePixelRatio(this: import("../driver").XCUITestDriver): P
|
|
|
107
126
|
*
|
|
108
127
|
* Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
|
|
109
128
|
*
|
|
110
|
-
* @param
|
|
111
|
-
* @param
|
|
112
|
-
* @this {XCUITestDriver}
|
|
129
|
+
* @param name - The name of the button to be pressed
|
|
130
|
+
* @param durationSeconds - The duration of the button press in seconds (float)
|
|
113
131
|
*/
|
|
114
|
-
export function mobilePressButton(this:
|
|
132
|
+
export declare function mobilePressButton(this: XCUITestDriver, name: ButtonName, durationSeconds?: number): Promise<void>;
|
|
115
133
|
/**
|
|
116
134
|
* Process a string as speech and send it to Siri.
|
|
117
135
|
*
|
|
118
136
|
* 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
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*/
|
|
124
|
-
export function mobileSiriCommand(this: import("../driver").XCUITestDriver, text: string): Promise<void>;
|
|
125
|
-
export type PressButtonOptions = {
|
|
126
|
-
/**
|
|
127
|
-
* - The name of the button to be pressed.
|
|
128
|
-
*/
|
|
129
|
-
name: string;
|
|
130
|
-
/**
|
|
131
|
-
* - Duration in float seconds.
|
|
132
|
-
*/
|
|
133
|
-
durationSeconds?: number | undefined;
|
|
134
|
-
};
|
|
135
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
136
|
-
export type ScreenInfo = import("./types").ScreenInfo;
|
|
137
|
+
*
|
|
138
|
+
* @param text - Text to be sent to Siri
|
|
139
|
+
*/
|
|
140
|
+
export declare function mobileSiriCommand(this: XCUITestDriver, text: string): Promise<void>;
|
|
137
141
|
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../lib/commands/general.
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../lib/commands/general.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAC,IAAI,EAAE,IAAI,EA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