@limrun/appium-xcuitest-driver 10.11.0-lim.4 → 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 +0 -2
- package/build/lib/device/simulator-management.js.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 +6 -5
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +16 -14
- 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/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 +0 -2
- package/lib/doctor/optional-checks.ts +0 -33
- package/lib/driver.ts +19 -17
- package/lib/execute-method-map.ts +0 -9
- package/package.json +6 -6
- 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,8 +11,9 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
11
11
|
const driver_1 = require("appium/driver");
|
|
12
12
|
const support_1 = require("appium/support");
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Takes a screenshot of the current screen.
|
|
15
|
+
*
|
|
16
|
+
* @returns Base64-encoded screenshot data
|
|
16
17
|
*/
|
|
17
18
|
async function getScreenshot() {
|
|
18
19
|
if (this.isWebContext()) {
|
|
@@ -20,8 +21,8 @@ async function getScreenshot() {
|
|
|
20
21
|
switch (lodash_1.default.toLower(webScreenshotMode)) {
|
|
21
22
|
case 'page':
|
|
22
23
|
case 'viewport':
|
|
23
|
-
return await
|
|
24
|
-
coordinateSystem:
|
|
24
|
+
return await this.remote.captureScreenshot({
|
|
25
|
+
coordinateSystem: lodash_1.default.capitalize(webScreenshotMode),
|
|
25
26
|
});
|
|
26
27
|
case 'native':
|
|
27
28
|
case undefined:
|
|
@@ -60,17 +61,20 @@ async function getScreenshot() {
|
|
|
60
61
|
// simulator attempt
|
|
61
62
|
if (this.isSimulator()) {
|
|
62
63
|
this.log.info(`Falling back to 'simctl io screenshot' API`);
|
|
63
|
-
const payload = await
|
|
64
|
+
const payload = await this.device.simctl.getScreenshot();
|
|
64
65
|
if (!payload) {
|
|
65
66
|
throw new driver_1.errors.UnableToCaptureScreen();
|
|
66
67
|
}
|
|
67
68
|
return payload;
|
|
68
69
|
}
|
|
69
70
|
// Retry for real devices only. Fail fast on Simulator if simctl does not work as expected
|
|
70
|
-
return
|
|
71
|
+
return await (0, asyncbox_1.retryInterval)(2, 1000, getScreenshotFromWDA);
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
73
|
-
*
|
|
74
|
+
* Takes a screenshot of a specific element.
|
|
75
|
+
*
|
|
76
|
+
* @param el - Element to capture
|
|
77
|
+
* @returns Base64-encoded screenshot data
|
|
74
78
|
*/
|
|
75
79
|
async function getElementScreenshot(el) {
|
|
76
80
|
el = support_1.util.unwrapElement(el);
|
|
@@ -81,8 +85,7 @@ async function getElementScreenshot(el) {
|
|
|
81
85
|
throw new driver_1.errors.UnableToCaptureScreen('Cannot take a screenshot of a zero-size element');
|
|
82
86
|
}
|
|
83
87
|
const { x, y } = await this.executeAtom('get_top_left_coordinates', [atomsElement]);
|
|
84
|
-
return await (
|
|
85
|
-
.captureScreenshot({ rect: { x, y, width, height } });
|
|
88
|
+
return await this.remote.captureScreenshot({ rect: { x, y, width, height } });
|
|
86
89
|
}
|
|
87
90
|
const data = await this.proxyCommand(`/element/${el}/screenshot`, 'GET');
|
|
88
91
|
if (!lodash_1.default.isString(data)) {
|
|
@@ -91,13 +94,13 @@ async function getElementScreenshot(el) {
|
|
|
91
94
|
return data;
|
|
92
95
|
}
|
|
93
96
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
97
|
+
* Takes a screenshot of the current viewport.
|
|
98
|
+
*
|
|
99
|
+
* @returns Base64-encoded screenshot data
|
|
96
100
|
*/
|
|
97
101
|
async function getViewportScreenshot() {
|
|
98
102
|
if (this.isWebContext()) {
|
|
99
|
-
return await
|
|
100
|
-
.captureScreenshot();
|
|
103
|
+
return await this.remote.captureScreenshot();
|
|
101
104
|
}
|
|
102
105
|
const screenshot = await this.getScreenshot();
|
|
103
106
|
// if we don't have a status bar, there's nothing to crop, so we can avoid
|
|
@@ -123,7 +126,4 @@ async function getViewportScreenshot() {
|
|
|
123
126
|
this.log.debug(`Calculated viewport rect: ${JSON.stringify(region)}`);
|
|
124
127
|
return await support_1.imageUtil.cropBase64Image(screenshot, region);
|
|
125
128
|
}
|
|
126
|
-
/**
|
|
127
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
128
|
-
*/
|
|
129
129
|
//# sourceMappingURL=screenshots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../../lib/commands/screenshots.
|
|
1
|
+
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../../lib/commands/screenshots.ts"],"names":[],"mappings":";;;;;AAaA,sCA8DC;AAQD,oDAsBC;AAOD,sDA6BC;AA7ID,uCAAuC;AACvC,oDAAuB;AACvB,0CAAqC;AACrC,4CAA+C;AAK/C;;;;GAIG;AACI,KAAK,UAAU,aAAa;IACjC,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACxB,MAAM,iBAAiB,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,iBAAiB,CAAC;QAChF,Q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IAAI,MAAM,EAAE,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;IAC5C,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;QACvC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;QACnF,MAAM,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;IACrC,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,EAAE,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;QACpF,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC;IACtC,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtE,OAAO,MAAM,mBAAS,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
export interface SimctlExecResponse {
|
|
3
|
+
/** The output of standard out. */
|
|
4
|
+
stdout: string;
|
|
5
|
+
/** The output of standard error. */
|
|
6
|
+
stderr: string;
|
|
7
|
+
/** Return code. */
|
|
8
|
+
code: number;
|
|
9
|
+
}
|
|
1
10
|
/**
|
|
2
11
|
* Run the given command with arguments as `xcrun simctl` subcommand.
|
|
3
12
|
* This method works behind the 'simctl' security flag.
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @returns
|
|
9
|
-
* @throws
|
|
13
|
+
*
|
|
14
|
+
* @param command - Subcommand to run with `xcrun simctl`. Must be one of the supported commands.
|
|
15
|
+
* @param args - Arguments for the subcommand. The arguments should be after <device> in the help.
|
|
16
|
+
* @param timeout - The maximum number of milliseconds
|
|
17
|
+
* @returns The execution result with stdout, stderr, and return code
|
|
18
|
+
* @throws If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
|
|
10
19
|
*/
|
|
11
|
-
export function mobileSimctl(this:
|
|
12
|
-
export type SimctlExecResponse = {
|
|
13
|
-
/**
|
|
14
|
-
* The output of standard out.
|
|
15
|
-
*/
|
|
16
|
-
stdout: string;
|
|
17
|
-
/**
|
|
18
|
-
* The output of standard error.
|
|
19
|
-
*/
|
|
20
|
-
stderr: string;
|
|
21
|
-
/**
|
|
22
|
-
* Return code.
|
|
23
|
-
*/
|
|
24
|
-
code: number;
|
|
25
|
-
};
|
|
26
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
20
|
+
export declare function mobileSimctl(this: XCUITestDriver, command: string, args?: string[], timeout?: number): Promise<SimctlExecResponse>;
|
|
27
21
|
//# sourceMappingURL=simctl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../lib/commands/simctl.
|
|
1
|
+
{"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../lib/commands/simctl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAgC9C,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,CAAC,CAuB7B"}
|
|
@@ -33,14 +33,14 @@ const SUBCOMMANDS_HAS_DEVICE = [
|
|
|
33
33
|
/**
|
|
34
34
|
* Run the given command with arguments as `xcrun simctl` subcommand.
|
|
35
35
|
* This method works behind the 'simctl' security flag.
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @returns
|
|
41
|
-
* @throws
|
|
36
|
+
*
|
|
37
|
+
* @param command - Subcommand to run with `xcrun simctl`. Must be one of the supported commands.
|
|
38
|
+
* @param args - Arguments for the subcommand. The arguments should be after <device> in the help.
|
|
39
|
+
* @param timeout - The maximum number of milliseconds
|
|
40
|
+
* @returns The execution result with stdout, stderr, and return code
|
|
41
|
+
* @throws If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
|
|
42
42
|
*/
|
|
43
|
-
async function mobileSimctl(command, args = [], timeout
|
|
43
|
+
async function mobileSimctl(command, args = [], timeout) {
|
|
44
44
|
if (!this.isSimulator()) {
|
|
45
45
|
throw new driver_1.errors.UnsupportedOperationError(`Only simulator is supported.`);
|
|
46
46
|
}
|
|
@@ -51,15 +51,11 @@ async function mobileSimctl(command, args = [], timeout = undefined) {
|
|
|
51
51
|
throw new driver_1.errors.InvalidArgumentError(`The given command '${command}' is not supported. ` +
|
|
52
52
|
`Available subcommands are ${SUBCOMMANDS_HAS_DEVICE.join(',')}`);
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
const result = await this.device.simctl.exec(command, { args: [this.opts.udid, ...args], timeout });
|
|
55
|
+
return {
|
|
56
|
+
stdout: result?.stdout ?? '',
|
|
57
|
+
stderr: result?.stderr ?? '',
|
|
58
|
+
code: result?.code ?? 0
|
|
59
|
+
};
|
|
55
60
|
}
|
|
56
|
-
/**
|
|
57
|
-
* @typedef {Object} SimctlExecResponse
|
|
58
|
-
* @property {string} stdout The output of standard out.
|
|
59
|
-
* @property {string} stderr The output of standard error.
|
|
60
|
-
* @property {number} code Return code.
|
|
61
|
-
*/
|
|
62
|
-
/**
|
|
63
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
64
|
-
*/
|
|
65
61
|
//# sourceMappingURL=simctl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../../lib/commands/simctl.
|
|
1
|
+
{"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../../lib/commands/simctl.ts"],"names":[],"mappings":";;AAoDA,oCA4BC;AAhFD,0CAAuC;AAIvC;;;GAGG;AACH,MAAM,sBAAsB,GAAG;IAC7B,MAAM;IACN,mBAAmB;IACnB,QAAQ;IACR,aAAa;IACb,SAAS;IACT,kBAAkB;IAClB,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;IACT,MAAM;IACN,UAAU;IACV,OAAO;IACP,YAAY;IACZ,WAAW;IACX,IAAI;IACJ,WAAW;CACH,CAAC;AAWX;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAEhC,OAAe,EACf,OAAiB,EAAE,EACnB,OAAgB;IAEhB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,eAAM,CAAC,yBAAyB,CAAC,8BAA8B,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,sCAAsC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,IAAI,CAAE,sBAA4C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,sBAAsB,OAAO,sBAAsB;YACvF,6BAA6B,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,MAAM,GAAG,MAAO,IAAI,CAAC,MAAoB,CAAC,MAAM,CAAC,IAAI,CACzD,OAAgD,EAChD,EAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,OAAO,EAAC,CAC3C,CAAC;IACF,OAAO;QACL,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE;QAC5B,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE;QAC5B,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC;KACxB,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { SourceFormat } from './types';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Retrieves the page source of the current application.
|
|
5
|
+
*
|
|
6
|
+
* @returns The page source as XML or HTML string
|
|
3
7
|
*/
|
|
4
|
-
export function getPageSource(this:
|
|
8
|
+
export declare function getPageSource(this: XCUITestDriver): Promise<string>;
|
|
5
9
|
/**
|
|
6
10
|
* Retrieve the source tree of the current page in XML or JSON format.
|
|
7
11
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
12
|
+
* @param format - Page tree source representation format.
|
|
13
|
+
* @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
|
|
10
14
|
* @privateRemarks Why isn't `excludedAttributes` an array?
|
|
11
|
-
* @returns
|
|
12
|
-
* @this {XCUITestDriver}
|
|
15
|
+
* @returns The source tree of the current page in the given format.
|
|
13
16
|
*/
|
|
14
|
-
export function mobileGetSource(this:
|
|
15
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
17
|
+
export declare function mobileGetSource(this: XCUITestDriver, format?: SourceFormat, excludedAttributes?: string): Promise<string>;
|
|
16
18
|
//# sourceMappingURL=source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/commands/source.
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/commands/source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAI1C;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBzE;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,cAAc,EACpB,MAAM,GAAE,YAAoB,EAC5B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,MAAM,CAAC,CAYjB"}
|
|
@@ -9,7 +9,9 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
9
9
|
const js2xmlparser2_1 = __importDefault(require("js2xmlparser2"));
|
|
10
10
|
const APPIUM_AUT_TAG = 'AppiumAUT';
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Retrieves the page source of the current application.
|
|
13
|
+
*
|
|
14
|
+
* @returns The page source as XML or HTML string
|
|
13
15
|
*/
|
|
14
16
|
async function getPageSource() {
|
|
15
17
|
if (this.isWebContext()) {
|
|
@@ -27,11 +29,10 @@ async function getPageSource() {
|
|
|
27
29
|
/**
|
|
28
30
|
* Retrieve the source tree of the current page in XML or JSON format.
|
|
29
31
|
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
+
* @param format - Page tree source representation format.
|
|
33
|
+
* @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
|
|
32
34
|
* @privateRemarks Why isn't `excludedAttributes` an array?
|
|
33
|
-
* @returns
|
|
34
|
-
* @this {XCUITestDriver}
|
|
35
|
+
* @returns The source tree of the current page in the given format.
|
|
35
36
|
*/
|
|
36
37
|
async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
37
38
|
const paramsMap = {
|
|
@@ -44,7 +45,7 @@ async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
|
44
45
|
const query = Object.entries(paramsMap)
|
|
45
46
|
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
46
47
|
.join('&');
|
|
47
|
-
return
|
|
48
|
+
return await this.proxyCommand(`/source?${query}`, 'GET');
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* Will get JSON of the form:
|
|
@@ -76,13 +77,12 @@ async function mobileGetSource(format = 'xml', excludedAttributes) {
|
|
|
76
77
|
*/
|
|
77
78
|
function getTreeForXML(srcTree) {
|
|
78
79
|
function getTree(element, elementIndex, parentPath) {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const curPath = `${parentPath}/${elementIndex}`;
|
|
81
|
+
const rect = element.rect || {};
|
|
81
82
|
/**
|
|
82
83
|
* @privateRemarks I don't even want to try to type this right now
|
|
83
|
-
* @type {any}
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
const subtree = {
|
|
86
86
|
'@': {
|
|
87
87
|
type: `XCUIElementType${element.type}`,
|
|
88
88
|
enabled: parseInt(element.isEnabled, 10) === 1,
|
|
@@ -112,7 +112,7 @@ function getTreeForXML(srcTree) {
|
|
|
112
112
|
[`XCUIElementType${element.type}`]: subtree,
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
const tree = getTree(srcTree, 0, '');
|
|
116
116
|
return tree;
|
|
117
117
|
}
|
|
118
118
|
function getSourceXml(jsonSource) {
|
|
@@ -122,7 +122,4 @@ function getSourceXml(jsonSource) {
|
|
|
122
122
|
prettyPrinting: { indentString: ' ' },
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
/**
|
|
126
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
127
|
-
*/
|
|
128
125
|
//# sourceMappingURL=source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../lib/commands/source.
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../lib/commands/source.ts"],"names":[],"mappings":";;;;;AAYA,sCAiBC;AAUD,0CAgBC;AAvDD,oDAAuB;AACvB,kEAAmC;AAInC,MAAM,cAAc,GAAG,WAAW,CAAC;AAEnC;;;;GAIG;AACI,KAAK,UAAU,aAAa;IACjC,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,2CAA2C,CAAC;QAC3D,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,EACJ,4BAA4B,EAAE,kBAAkB,EAChD,aAAa,EACd,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IACtC,MAAM,qBAAqB,GAAG,gBAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC/F,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC3G,OAAO,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACnG,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe,CAEnC,SAAuB,KAAK,EAC5B,kBAA2B;IAE3B,MAAM,SAAS,GAA2B;QACxC,MAAM;QACN,KAAK,EAAE,cAAc;KACtB,CAAC;IACF,IAAI,kBAAk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AC;AACL,CAAC"}
|
|
@@ -1,53 +1,46 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* Sets the page load timeout using W3C protocol.
|
|
4
|
+
*
|
|
5
|
+
* @param ms - Timeout in milliseconds
|
|
3
6
|
*/
|
|
4
|
-
export function pageLoadTimeoutW3C(this:
|
|
7
|
+
export declare function pageLoadTimeoutW3C(this: XCUITestDriver, ms: number): Promise<void>;
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
9
|
+
* Sets the page load timeout using MJSONWP protocol.
|
|
10
|
+
*
|
|
11
|
+
* @param ms - Timeout in milliseconds
|
|
7
12
|
*/
|
|
8
|
-
export function pageLoadTimeoutMJSONWP(this:
|
|
13
|
+
export declare function pageLoadTimeoutMJSONWP(this: XCUITestDriver, ms: number): Promise<void>;
|
|
9
14
|
/**
|
|
10
|
-
*
|
|
15
|
+
* Sets the async script timeout using W3C protocol.
|
|
16
|
+
*
|
|
17
|
+
* @param ms - Timeout in milliseconds
|
|
11
18
|
*/
|
|
12
|
-
export function scriptTimeoutW3C(this:
|
|
19
|
+
export declare function scriptTimeoutW3C(this: XCUITestDriver, ms: number): Promise<void>;
|
|
13
20
|
/**
|
|
14
21
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
15
22
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @this {XCUITestDriver}
|
|
23
|
+
* @param ms - The timeout in milliseconds
|
|
18
24
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
19
25
|
*/
|
|
20
|
-
export function scriptTimeoutMJSONWP(this:
|
|
26
|
+
export declare function scriptTimeoutMJSONWP(this: XCUITestDriver, ms: number): Promise<void>;
|
|
21
27
|
/**
|
|
22
28
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
23
29
|
*
|
|
24
|
-
* @param
|
|
25
|
-
*
|
|
30
|
+
* @param ms - The timeout in milliseconds
|
|
26
31
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
27
|
-
* @this {XCUITestDriver}
|
|
28
32
|
*/
|
|
29
|
-
export function asyncScriptTimeout(this:
|
|
33
|
+
export declare function asyncScriptTimeout(this: XCUITestDriver, ms: number): Promise<void>;
|
|
30
34
|
/**
|
|
31
|
-
*
|
|
35
|
+
* Sets the page load timeout.
|
|
36
|
+
*
|
|
37
|
+
* @param ms - Timeout in milliseconds
|
|
32
38
|
*/
|
|
33
|
-
export function setPageLoadTimeout(this:
|
|
34
|
-
export class setPageLoadTimeout {
|
|
35
|
-
/**
|
|
36
|
-
* @this {XCUITestDriver}
|
|
37
|
-
*/
|
|
38
|
-
constructor(this: import("../driver").XCUITestDriver, ms: any);
|
|
39
|
-
pageLoadMs: any;
|
|
40
|
-
}
|
|
39
|
+
export declare function setPageLoadTimeout(this: XCUITestDriver, ms: number): void;
|
|
41
40
|
/**
|
|
42
|
-
*
|
|
41
|
+
* Sets the async script timeout.
|
|
42
|
+
*
|
|
43
|
+
* @param ms - Timeout in milliseconds
|
|
43
44
|
*/
|
|
44
|
-
export function setAsyncScriptTimeout(this:
|
|
45
|
-
export class setAsyncScriptTimeout {
|
|
46
|
-
/**
|
|
47
|
-
* @this {XCUITestDriver}
|
|
48
|
-
*/
|
|
49
|
-
constructor(this: import("../driver").XCUITestDriver, ms: any);
|
|
50
|
-
asyncWaitMs: any;
|
|
51
|
-
}
|
|
52
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
45
|
+
export declare function setAsyncScriptTimeout(this: XCUITestDriver, ms: number): void;
|
|
53
46
|
//# sourceMappingURL=timeouts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../../lib/commands/timeouts.
|
|
1
|
+
{"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../../lib/commands/timeouts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,IAAI,CAON;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,IAAI,CAGN"}
|
|
@@ -8,19 +8,25 @@ exports.asyncScriptTimeout = asyncScriptTimeout;
|
|
|
8
8
|
exports.setPageLoadTimeout = setPageLoadTimeout;
|
|
9
9
|
exports.setAsyncScriptTimeout = setAsyncScriptTimeout;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Sets the page load timeout using W3C protocol.
|
|
12
|
+
*
|
|
13
|
+
* @param ms - Timeout in milliseconds
|
|
12
14
|
*/
|
|
13
15
|
async function pageLoadTimeoutW3C(ms) {
|
|
14
16
|
await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Sets the page load timeout using MJSONWP protocol.
|
|
20
|
+
*
|
|
21
|
+
* @param ms - Timeout in milliseconds
|
|
18
22
|
*/
|
|
19
23
|
async function pageLoadTimeoutMJSONWP(ms) {
|
|
20
24
|
await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
|
-
*
|
|
27
|
+
* Sets the async script timeout using W3C protocol.
|
|
28
|
+
*
|
|
29
|
+
* @param ms - Timeout in milliseconds
|
|
24
30
|
*/
|
|
25
31
|
async function scriptTimeoutW3C(ms) {
|
|
26
32
|
// XXX: this is synchronous
|
|
@@ -29,8 +35,7 @@ async function scriptTimeoutW3C(ms) {
|
|
|
29
35
|
/**
|
|
30
36
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
31
37
|
*
|
|
32
|
-
* @param
|
|
33
|
-
* @this {XCUITestDriver}
|
|
38
|
+
* @param ms - The timeout in milliseconds
|
|
34
39
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
35
40
|
*/
|
|
36
41
|
async function scriptTimeoutMJSONWP(ms) {
|
|
@@ -39,33 +44,32 @@ async function scriptTimeoutMJSONWP(ms) {
|
|
|
39
44
|
/**
|
|
40
45
|
* Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
|
|
41
46
|
*
|
|
42
|
-
* @param
|
|
43
|
-
*
|
|
47
|
+
* @param ms - The timeout in milliseconds
|
|
44
48
|
* @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
|
|
45
|
-
* @this {XCUITestDriver}
|
|
46
49
|
*/
|
|
47
50
|
async function asyncScriptTimeout(ms) {
|
|
48
51
|
await this.scriptTimeoutW3C(ms);
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
51
|
-
*
|
|
54
|
+
* Sets the page load timeout.
|
|
55
|
+
*
|
|
56
|
+
* @param ms - Timeout in milliseconds
|
|
52
57
|
*/
|
|
53
58
|
function setPageLoadTimeout(ms) {
|
|
54
|
-
ms = parseInt(ms, 10);
|
|
59
|
+
ms = parseInt(String(ms), 10);
|
|
55
60
|
this.pageLoadMs = ms;
|
|
56
|
-
if (this.
|
|
61
|
+
if (this._remote) {
|
|
57
62
|
this.remote.pageLoadMs = ms;
|
|
58
63
|
}
|
|
59
64
|
this.log.debug(`Set page load timeout to ${ms}ms`);
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
|
-
*
|
|
67
|
+
* Sets the async script timeout.
|
|
68
|
+
*
|
|
69
|
+
* @param ms - Timeout in milliseconds
|
|
63
70
|
*/
|
|
64
71
|
function setAsyncScriptTimeout(ms) {
|
|
65
72
|
this.asyncWaitMs = ms;
|
|
66
73
|
this.log.debug(`Set async script timeout to ${ms}ms`);
|
|
67
74
|
}
|
|
68
|
-
/**
|
|
69
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
70
|
-
*/
|
|
71
75
|
//# sourceMappingURL=timeouts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeouts.js","sourceRoot":"","sources":["../../../lib/commands/timeouts.
|
|
1
|
+
{"version":3,"file":"timeouts.js","sourceRoot":"","sources":["../../../lib/commands/timeouts.ts"],"names":[],"mappings":";;AAOA,gDAKC;AAOD,wDAKC;AAOD,4CAMC;AAQD,oDAKC;AAQD,gDAKC;AAOD,gDAUC;AAOD,sDAMC;AA3FD;;;;GAIG;AACI,KAAK,UAAU,kBAAkB,CAEtC,EAAU;IAEV,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,sBAAsB,CAE1C,EAAU;IAEV,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAEpC,EAAU;IAEV,2BAA2B;IAC3B,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CAExC,EAAU;IAEV,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,kBAAkB,CAEtC,EAAU;IAEV,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAEhC,EAAU;IAEV,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAEnC,EAAU;IAEV,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACtB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+BAA+B,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -303,6 +303,28 @@ export interface ProcessArguments {
|
|
|
303
303
|
env: StringRecord<string>;
|
|
304
304
|
args: string[];
|
|
305
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Accessibility audit item returned by the audit command.
|
|
308
|
+
*/
|
|
309
|
+
export interface AccessibilityAuditItem {
|
|
310
|
+
/**
|
|
311
|
+
* The detailed description of the found accessibility issue.
|
|
312
|
+
*/
|
|
313
|
+
detailedDescription: string;
|
|
314
|
+
/**
|
|
315
|
+
* The compact description of the found accessibility issue.
|
|
316
|
+
*/
|
|
317
|
+
compactDescription: string;
|
|
318
|
+
/**
|
|
319
|
+
* The name of the audit type this issue belongs to. Could be
|
|
320
|
+
* a number if the type name is unknown.
|
|
321
|
+
*/
|
|
322
|
+
auditType: string | number;
|
|
323
|
+
/**
|
|
324
|
+
* The description of the element this issue was found for.
|
|
325
|
+
*/
|
|
326
|
+
element: string;
|
|
327
|
+
}
|
|
306
328
|
/**
|
|
307
329
|
* Pressable button names; used by the {@linkcode XCUITest.mobilePressButton mobile: pressButton} command.
|
|
308
330
|
*/
|
|
@@ -536,4 +558,62 @@ export interface LogEntry {
|
|
|
536
558
|
message: string;
|
|
537
559
|
}
|
|
538
560
|
export type LogListener = (logEntry: LogEntry) => any;
|
|
561
|
+
/**
|
|
562
|
+
* Condition inducer profile configuration
|
|
563
|
+
*/
|
|
564
|
+
export interface Profile {
|
|
565
|
+
name: string;
|
|
566
|
+
/** The property is profileID used in {@linkcode XCUITestDriver.enableConditionInducer} */
|
|
567
|
+
identifier: string;
|
|
568
|
+
/** Configuration details */
|
|
569
|
+
description: string;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* We can use the returned data to determine whether the Condition is enabled and the currently enabled configuration information
|
|
573
|
+
*/
|
|
574
|
+
export interface Condition {
|
|
575
|
+
profiles: Profile[];
|
|
576
|
+
/** The property is conditionID used in {@linkcode XCUITestDriver.enableConditionInducer} */
|
|
577
|
+
identifier: string;
|
|
578
|
+
profilesSorted: boolean;
|
|
579
|
+
isDestructive: boolean;
|
|
580
|
+
isInternal: boolean;
|
|
581
|
+
/** `true` if this condition identifier is enabled */
|
|
582
|
+
isActive: boolean;
|
|
583
|
+
/** Enabled profiles identifier */
|
|
584
|
+
activeProfile: string;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Information about an XCTest screen recording session
|
|
588
|
+
*/
|
|
589
|
+
export interface XcTestScreenRecordingInfo {
|
|
590
|
+
/** Unique identifier of the video being recorded */
|
|
591
|
+
uuid: string;
|
|
592
|
+
/** FPS value */
|
|
593
|
+
fps: number;
|
|
594
|
+
/** Video codec, where 0 is h264 */
|
|
595
|
+
codec: number;
|
|
596
|
+
/** The timestamp when the screen recording has started in float Unix seconds */
|
|
597
|
+
startedAt: number;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* XCTest screen recording result with payload
|
|
601
|
+
*/
|
|
602
|
+
export interface XcTestScreenRecording extends XcTestScreenRecordingInfo {
|
|
603
|
+
/**
|
|
604
|
+
* Base64-encoded content of the recorded media file if `remotePath` parameter is empty or null or an empty string otherwise.
|
|
605
|
+
* The media is expected to a be a valid QuickTime movie (.mov).
|
|
606
|
+
*/
|
|
607
|
+
payload: string;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Options for AudioRecorder
|
|
611
|
+
*/
|
|
612
|
+
export interface AudioRecorderOptions {
|
|
613
|
+
audioSource: string;
|
|
614
|
+
audioCodec: string;
|
|
615
|
+
audioBitrate: string;
|
|
616
|
+
audioChannels: number;
|
|
617
|
+
audioRate: number;
|
|
618
|
+
}
|
|
539
619
|
//# sourceMappingURL=types.d.ts.map
|