@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
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { PushPayload, NotificationType } from './types';
|
|
1
3
|
/**
|
|
2
4
|
* Simulates push notification delivery to a simulated device.
|
|
3
5
|
*
|
|
4
6
|
* **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
|
|
5
7
|
*
|
|
6
8
|
* Supported in Xcode SDK 11.4+.
|
|
7
|
-
*
|
|
8
|
-
* @param
|
|
9
|
+
*
|
|
10
|
+
* @param bundleId - The bundle identifier of the target application
|
|
11
|
+
* @param payload - Valid push payload.
|
|
9
12
|
* @group Simulator Only
|
|
10
|
-
* @this {XCUITestDriver}
|
|
11
13
|
*/
|
|
12
|
-
export function mobilePushNotification(this:
|
|
14
|
+
export declare function mobilePushNotification(this: XCUITestDriver, bundleId: string, payload: PushPayload): Promise<void>;
|
|
13
15
|
/**
|
|
14
16
|
* Blocks until the expected notification is delivered.
|
|
15
17
|
*
|
|
@@ -17,12 +19,10 @@ export function mobilePushNotification(this: import("../driver").XCUITestDriver,
|
|
|
17
19
|
* [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
|
|
18
20
|
* [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
|
|
19
21
|
*
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
22
|
+
* @param name - The name of the notification to expect
|
|
23
|
+
* @param type - Which notification type to expect.
|
|
24
|
+
* @param timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
|
|
23
25
|
* @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
|
|
24
|
-
* @this {XCUITestDriver}
|
|
25
26
|
*/
|
|
26
|
-
export function mobileExpectNotification(this:
|
|
27
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
27
|
+
export declare function mobileExpectNotification(this: XCUITestDriver, name: string, type?: NotificationType, timeoutSeconds?: number): Promise<void>;
|
|
28
28
|
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAG3D;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,gBAA0B,EAChC,cAAc,GAAE,MAAW,GAC1B,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -13,10 +13,10 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
13
13
|
* **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
|
|
14
14
|
*
|
|
15
15
|
* Supported in Xcode SDK 11.4+.
|
|
16
|
-
*
|
|
17
|
-
* @param
|
|
16
|
+
*
|
|
17
|
+
* @param bundleId - The bundle identifier of the target application
|
|
18
|
+
* @param payload - Valid push payload.
|
|
18
19
|
* @group Simulator Only
|
|
19
|
-
* @this {XCUITestDriver}
|
|
20
20
|
*/
|
|
21
21
|
async function mobilePushNotification(bundleId, payload) {
|
|
22
22
|
if (!this.isSimulator()) {
|
|
@@ -33,7 +33,7 @@ async function mobilePushNotification(bundleId, payload) {
|
|
|
33
33
|
throw new driver_1.errors.InvalidArgumentError(`The 'payload.aps' value must be a valid dictionary. ` +
|
|
34
34
|
`Got ${JSON.stringify(payload.aps)} instead`);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
await this.device.pushNotification({
|
|
37
37
|
...payload,
|
|
38
38
|
'Simulator Target Bundle': bundleId,
|
|
39
39
|
});
|
|
@@ -45,20 +45,16 @@ async function mobilePushNotification(bundleId, payload) {
|
|
|
45
45
|
* [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
|
|
46
46
|
* [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
48
|
+
* @param name - The name of the notification to expect
|
|
49
|
+
* @param type - Which notification type to expect.
|
|
50
|
+
* @param timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
|
|
51
51
|
* @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
|
|
52
|
-
* @this {XCUITestDriver}
|
|
53
52
|
*/
|
|
54
53
|
async function mobileExpectNotification(name, type = 'plain', timeoutSeconds = 60) {
|
|
55
|
-
|
|
54
|
+
await this.proxyCommand('/wda/expectNotification', 'POST', {
|
|
56
55
|
name,
|
|
57
56
|
type,
|
|
58
57
|
timeout: timeoutSeconds,
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
|
-
/**
|
|
62
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
63
|
-
*/
|
|
64
60
|
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../lib/commands/notifications.
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../lib/commands/notifications.ts"],"names":[],"mappings":";;;;;AAiBA,wDA8BC;AAcD,4DAWC;AAxED,0CAAqC;AACrC,oDAAuB;AAKvB;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAE1C,QAAgB,EAChB,OAAoB;IAEpB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,2DAA2D;YACzD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAC3C,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,sDAAsD;YACpD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAC/C,CAAC;IACJ,CAAC;IACD,MAAO,IAAI,CAAC,MAAoB,CAAC,gBAAgB,CAAC;QAChD,GAAG,OAAO;QACV,yBAAyB,EAAE,QAAQ;KACpC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,wBAAwB,CAE5C,IAAY,EACZ,OAAyB,OAAO,EAChC,iBAAyB,EAAE;IAE3B,MAAM,IAAI,CAAC,YAAY,CAAC,yBAAyB,EAAE,MAAM,EAAE;QACzD,IAAI;QACJ,IAAI;QACJ,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Sets the Simulator's pasteboard content to the given value.
|
|
3
4
|
*
|
|
4
5
|
* Does not work for real devices.
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
6
|
+
*
|
|
7
|
+
* @param content - The content to set
|
|
8
|
+
* @param encoding - The content's encoding
|
|
7
9
|
* @group Simulator Only
|
|
8
|
-
* @returns {Promise<void>}
|
|
9
|
-
* @this {XCUITestDriver}
|
|
10
10
|
*/
|
|
11
|
-
export function mobileSetPasteboard(this:
|
|
11
|
+
export declare function mobileSetPasteboard(this: XCUITestDriver, content: string, encoding?: BufferEncoding): Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Gets the Simulator's pasteboard content.
|
|
14
14
|
*
|
|
15
15
|
* Does not work for real devices.
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
|
+
* @param encoding - Expected encoding of returned string
|
|
17
18
|
* @group Simulator Only
|
|
18
|
-
* @
|
|
19
|
-
* @returns {Promise<string>} The pasteboard content string
|
|
19
|
+
* @returns The pasteboard content string
|
|
20
20
|
*/
|
|
21
|
-
export function mobileGetPasteboard(this:
|
|
22
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
21
|
+
export declare function mobileGetPasteboard(this: XCUITestDriver, encoding?: BufferEncoding): Promise<string>;
|
|
23
22
|
//# sourceMappingURL=pasteboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pasteboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/pasteboard.
|
|
1
|
+
{"version":3,"file":"pasteboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/pasteboard.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAG9C;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,cAAuB,GAChC,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,QAAQ,GAAE,cAAuB,GAChC,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -11,11 +11,10 @@ const utils_1 = require("../utils");
|
|
|
11
11
|
* Sets the Simulator's pasteboard content to the given value.
|
|
12
12
|
*
|
|
13
13
|
* Does not work for real devices.
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
14
|
+
*
|
|
15
|
+
* @param content - The content to set
|
|
16
|
+
* @param encoding - The content's encoding
|
|
16
17
|
* @group Simulator Only
|
|
17
|
-
* @returns {Promise<void>}
|
|
18
|
-
* @this {XCUITestDriver}
|
|
19
18
|
*/
|
|
20
19
|
async function mobileSetPasteboard(content, encoding = 'utf8') {
|
|
21
20
|
utils_1.assertSimulator.call(this, 'Setting pasteboard content');
|
|
@@ -23,23 +22,19 @@ async function mobileSetPasteboard(content, encoding = 'utf8') {
|
|
|
23
22
|
// can be empty string
|
|
24
23
|
throw new Error('Pasteboard content is mandatory to set');
|
|
25
24
|
}
|
|
26
|
-
|
|
25
|
+
await this.device.simctl.setPasteboard(content, encoding);
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
28
|
* Gets the Simulator's pasteboard content.
|
|
30
29
|
*
|
|
31
30
|
* Does not work for real devices.
|
|
32
|
-
*
|
|
31
|
+
*
|
|
32
|
+
* @param encoding - Expected encoding of returned string
|
|
33
33
|
* @group Simulator Only
|
|
34
|
-
* @
|
|
35
|
-
* @returns {Promise<string>} The pasteboard content string
|
|
34
|
+
* @returns The pasteboard content string
|
|
36
35
|
*/
|
|
37
36
|
async function mobileGetPasteboard(encoding = 'utf8') {
|
|
38
37
|
utils_1.assertSimulator.call(this, 'Getting pasteboard content');
|
|
39
|
-
return await
|
|
40
|
-
/** @type {BufferEncoding} */ (encoding));
|
|
38
|
+
return await this.device.simctl.getPasteboard(encoding);
|
|
41
39
|
}
|
|
42
|
-
/**
|
|
43
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
44
|
-
*/
|
|
45
40
|
//# sourceMappingURL=pasteboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pasteboard.js","sourceRoot":"","sources":["../../../lib/commands/pasteboard.
|
|
1
|
+
{"version":3,"file":"pasteboard.js","sourceRoot":"","sources":["../../../lib/commands/pasteboard.ts"],"names":[],"mappings":";;;;;AAcA,kDAWC;AAWD,kDAMC;AA1CD,oDAAuB;AACvB,oCAA2C;AAI3C;;;;;;;;GAQG;AACI,KAAK,UAAU,mBAAmB,CAEvC,OAAe,EACf,WAA2B,MAAM;IAEjC,uBAAe,CAAC,IAAI,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAC;IACzD,IAAI,CAAC,gBAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,sBAAsB;QACtB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAO,IAAI,CAAC,MAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,mBAAmB,CAEvC,WAA2B,MAAM;IAEjC,uBAAe,CAAC,IAAI,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAC;IACzD,OAAO,MAAO,IAAI,CAAC,MAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
export declare class TrafficCapture {
|
|
3
|
+
private mainProcess;
|
|
4
|
+
private readonly udid;
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly resultPath;
|
|
7
|
+
constructor(udid: string, log: any, resultPath: string);
|
|
8
|
+
start(timeoutSeconds: number): Promise<void>;
|
|
9
|
+
isCapturing(): boolean;
|
|
10
|
+
interrupt(force?: boolean): Promise<boolean>;
|
|
11
|
+
finish(): Promise<string>;
|
|
12
|
+
cleanup(): Promise<void>;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Records the given network traffic capture into a .pcap file.
|
|
3
16
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
17
|
+
* @param timeLimitSec - The maximum recording time, in seconds. The maximum value is `43200` (12 hours).
|
|
18
|
+
* @param forceRestart - Whether to restart traffic capture process forcefully when startPcap is called (`true`) or ignore the call until the current traffic capture is completed (`false`, the default value).
|
|
6
19
|
* @throws {Error} If network traffic capture has failed to start.
|
|
7
|
-
* @returns {Promise<void>}
|
|
8
|
-
* @this {XCUITestDriver}
|
|
9
20
|
*/
|
|
10
|
-
export function mobileStartPcap(this:
|
|
11
|
-
export class mobileStartPcap {
|
|
12
|
-
/**
|
|
13
|
-
* Records the given network traffic capture into a .pcap file.
|
|
14
|
-
*
|
|
15
|
-
* @param {number} timeLimitSec - The maximum recording time, in seconds. The maximum value is `43200` (12 hours).
|
|
16
|
-
* @param {boolean} forceRestart - Whether to restart traffic capture process forcefully when startPcap is called (`true`) or ignore the call until the current traffic capture is completed (`false`, the default value).
|
|
17
|
-
* @throws {Error} If network traffic capture has failed to start.
|
|
18
|
-
* @returns {Promise<void>}
|
|
19
|
-
* @this {XCUITestDriver}
|
|
20
|
-
*/
|
|
21
|
-
constructor(this: import("../driver").XCUITestDriver, timeLimitSec?: number, forceRestart?: boolean);
|
|
22
|
-
_trafficCapture: TrafficCapture;
|
|
23
|
-
}
|
|
21
|
+
export declare function mobileStartPcap(this: XCUITestDriver, timeLimitSec?: number, forceRestart?: boolean): Promise<void>;
|
|
24
22
|
/**
|
|
25
23
|
* Stops network traffic capture.
|
|
26
24
|
*
|
|
@@ -29,26 +27,8 @@ export class mobileStartPcap {
|
|
|
29
27
|
* If no previously recorded file is found and no active traffic capture processes are running, then the method returns an empty string.
|
|
30
28
|
*
|
|
31
29
|
* @remarks Network capture files can be viewed in [Wireshark](https://www.wireshark.org/) and other similar applications.
|
|
32
|
-
* @returns
|
|
30
|
+
* @returns Base64-encoded content of the recorded pcap file or an empty string if no traffic capture has been started before.
|
|
33
31
|
* @throws {Error} If there was an error while getting the capture file.
|
|
34
|
-
* @this {XCUITestDriver}
|
|
35
32
|
*/
|
|
36
|
-
export function mobileStopPcap(this:
|
|
37
|
-
export class mobileStopPcap {
|
|
38
|
-
_trafficCapture: any;
|
|
39
|
-
}
|
|
40
|
-
export class TrafficCapture {
|
|
41
|
-
constructor(udid: any, log: any, resultPath: any);
|
|
42
|
-
/** @type {import('teen_process').SubProcess|null} */
|
|
43
|
-
mainProcess: any | null;
|
|
44
|
-
udid: any;
|
|
45
|
-
log: any;
|
|
46
|
-
resultPath: any;
|
|
47
|
-
start(timeoutSeconds: any): Promise<void>;
|
|
48
|
-
isCapturing(): boolean;
|
|
49
|
-
interrupt(force?: boolean): Promise<boolean>;
|
|
50
|
-
finish(): Promise<any>;
|
|
51
|
-
cleanup(): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
33
|
+
export declare function mobileStopPcap(this: XCUITestDriver): Promise<string>;
|
|
54
34
|
//# sourceMappingURL=pcap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pcap.d.ts","sourceRoot":"","sources":["../../../lib/commands/pcap.
|
|
1
|
+
{"version":3,"file":"pcap.d.ts","sourceRoot":"","sources":["../../../lib/commands/pcap.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAM9C,qBAAa,cAAc;IACzB,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM;IAMhD,KAAK,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBlD,WAAW,IAAI,OAAO;IAIhB,SAAS,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAkB1C,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAK/B;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,cAAc,EACpB,YAAY,SAAM,EAClB,YAAY,UAAQ,GACnB,OAAO,CAAC,IAAI,CAAC,CA6Cf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsB1E"}
|
|
@@ -10,19 +10,20 @@ const driver_1 = require("appium/driver");
|
|
|
10
10
|
const MAX_CAPTURE_TIME_SEC = 60 * 60 * 12;
|
|
11
11
|
const DEFAULT_EXT = '.pcap';
|
|
12
12
|
class TrafficCapture {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
mainProcess = null;
|
|
14
|
+
udid;
|
|
15
|
+
log;
|
|
16
|
+
resultPath;
|
|
15
17
|
constructor(udid, log, resultPath) {
|
|
16
18
|
this.udid = udid;
|
|
17
19
|
this.log = log;
|
|
18
20
|
this.resultPath = resultPath;
|
|
19
|
-
this.mainProcess = null;
|
|
20
21
|
}
|
|
21
22
|
async start(timeoutSeconds) {
|
|
22
|
-
this.mainProcess =
|
|
23
|
+
this.mainProcess = await new py_ios_device_client_1.Pyidevice({
|
|
23
24
|
udid: this.udid,
|
|
24
25
|
log: this.log,
|
|
25
|
-
}).collectPcap(this.resultPath)
|
|
26
|
+
}).collectPcap(this.resultPath);
|
|
26
27
|
this.mainProcess.on('line-stderr', (line) => this.log.info(`[Pcap] ${line}`));
|
|
27
28
|
this.log.info(`Starting network traffic capture session on the device '${this.udid}'. ` +
|
|
28
29
|
`Will timeout in ${timeoutSeconds}s`);
|
|
@@ -64,11 +65,9 @@ exports.TrafficCapture = TrafficCapture;
|
|
|
64
65
|
/**
|
|
65
66
|
* Records the given network traffic capture into a .pcap file.
|
|
66
67
|
*
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
68
|
+
* @param timeLimitSec - The maximum recording time, in seconds. The maximum value is `43200` (12 hours).
|
|
69
|
+
* @param forceRestart - Whether to restart traffic capture process forcefully when startPcap is called (`true`) or ignore the call until the current traffic capture is completed (`false`, the default value).
|
|
69
70
|
* @throws {Error} If network traffic capture has failed to start.
|
|
70
|
-
* @returns {Promise<void>}
|
|
71
|
-
* @this {XCUITestDriver}
|
|
72
71
|
*/
|
|
73
72
|
async function mobileStartPcap(timeLimitSec = 180, forceRestart = false) {
|
|
74
73
|
if (this.isSimulator()) {
|
|
@@ -118,9 +117,8 @@ async function mobileStartPcap(timeLimitSec = 180, forceRestart = false) {
|
|
|
118
117
|
* If no previously recorded file is found and no active traffic capture processes are running, then the method returns an empty string.
|
|
119
118
|
*
|
|
120
119
|
* @remarks Network capture files can be viewed in [Wireshark](https://www.wireshark.org/) and other similar applications.
|
|
121
|
-
* @returns
|
|
120
|
+
* @returns Base64-encoded content of the recorded pcap file or an empty string if no traffic capture has been started before.
|
|
122
121
|
* @throws {Error} If there was an error while getting the capture file.
|
|
123
|
-
* @this {XCUITestDriver}
|
|
124
122
|
*/
|
|
125
123
|
async function mobileStopPcap() {
|
|
126
124
|
if (!this._trafficCapture) {
|
|
@@ -143,7 +141,4 @@ async function mobileStopPcap() {
|
|
|
143
141
|
}
|
|
144
142
|
return await (0, utils_1.encodeBase64OrUpload)(resultPath);
|
|
145
143
|
}
|
|
146
|
-
/**
|
|
147
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
148
|
-
*/
|
|
149
144
|
//# sourceMappingURL=pcap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pcap.js","sourceRoot":"","sources":["../../../lib/commands/pcap.
|
|
1
|
+
{"version":3,"file":"pcap.js","sourceRoot":"","sources":["../../../lib/comm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CUITestDriver } from '../driver';
|
|
2
|
+
import type { Method } from 'axios';
|
|
1
3
|
/**
|
|
2
4
|
* Starts performance profiling for the device under test.
|
|
3
5
|
*
|
|
@@ -11,34 +13,11 @@
|
|
|
11
13
|
*
|
|
12
14
|
* Read [Recording, Pausing, and Stopping Traces](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html) for more details.
|
|
13
15
|
*
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @this {XCUITestDriver}
|
|
16
|
+
* @param timeout - The maximum count of milliseconds to record the profiling information.
|
|
17
|
+
* @param profileName - The name of existing performance profile to apply. Can also contain the full path to the chosen template on the server file system. Note: not all profiles are supported on mobile devices.
|
|
18
|
+
* @param pid - The ID of the process to measure the performance for. Set it to `current` in order to measure the performance of the process, which belongs to the currently active application. All processes running on the device are measured if `pid` is unset (the default setting).
|
|
18
19
|
*/
|
|
19
|
-
export function mobileStartPerfRecord(this:
|
|
20
|
-
export class mobileStartPerfRecord {
|
|
21
|
-
/**
|
|
22
|
-
* Starts performance profiling for the device under test.
|
|
23
|
-
*
|
|
24
|
-
* Relaxing security is mandatory for simulators. It can always work for real devices.
|
|
25
|
-
*
|
|
26
|
-
* Since XCode 12 the method tries to use `xctrace` tool to record performance stats.
|
|
27
|
-
*
|
|
28
|
-
* The `instruments` developer utility is used as a fallback for this purpose if `xctrace` is not available.
|
|
29
|
-
*
|
|
30
|
-
* It is possible to record multiple profiles at the same time.
|
|
31
|
-
*
|
|
32
|
-
* Read [Recording, Pausing, and Stopping Traces](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html) for more details.
|
|
33
|
-
*
|
|
34
|
-
* @param {number} timeout - The maximum count of milliseconds to record the profiling information.
|
|
35
|
-
* @param {string} profileName - The name of existing performance profile to apply. Can also contain the full path to the chosen template on the server file system. Note: not all profiles are supported on mobile devices.
|
|
36
|
-
* @param {number|'current'} [pid] - The ID of the process to measure the performance for. Set it to `current` in order to measure the performance of the process, which belongs to the currently active application. All processes running on the device are measured if `pid` is unset (the default setting).
|
|
37
|
-
* @this {XCUITestDriver}
|
|
38
|
-
*/
|
|
39
|
-
constructor(this: import("../driver").XCUITestDriver, timeout?: number, profileName?: string, pid?: number | "current");
|
|
40
|
-
_perfRecorders: PerfRecorder[] | undefined;
|
|
41
|
-
}
|
|
20
|
+
export declare function mobileStartPerfRecord(this: XCUITestDriver, timeout?: number, profileName?: string, pid?: number | 'current'): Promise<void>;
|
|
42
21
|
/**
|
|
43
22
|
* Stops performance recording operation previously started by {@linkcode XCUITestDriver.mobileStartPerfRecord mobile: startPerfRecord}.
|
|
44
23
|
*
|
|
@@ -46,40 +25,42 @@ export class mobileStartPerfRecord {
|
|
|
46
25
|
*
|
|
47
26
|
* The resulting file in `.trace` format can be either returned directly as base64-encoded zip archive or uploaded to a remote location (such files can be pretty large). Afterwards it is possible to unarchive and open such files with Xcode Dev Tools.
|
|
48
27
|
*
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
*
|
|
58
|
-
* @returns {Promise<string>} The resulting file in `.trace` format. This file can either be returned directly as base64-encoded `.zip` archive or uploaded to a remote location (note that such files may be large), _depending on the `remotePath` argument value._ Thereafter, the file may be unarchived and opened with Xcode Developer Tools.
|
|
28
|
+
* @param remotePath - The path to the remote location, where the resulting zipped `.trace` file should be uploaded. The following protocols are supported: `http`, `https`, `ftp`. Null or empty string value (the default setting) means the content of resulting file should be zipped, encoded as Base64 and passed as the endpoint response value. An exception will be thrown if the generated file is too big to fit into the available process memory.
|
|
29
|
+
* @param user - The name of the user for the remote authentication. Only works if `remotePath` is provided.
|
|
30
|
+
* @param pass - The password for the remote authentication. Only works if `remotePath` is provided.
|
|
31
|
+
* @param method - The http multipart upload method name. Only works if `remotePath` is provided. Defaults to `PUT`
|
|
32
|
+
* @param profileName - The name of existing performance profile to stop the recording for. Multiple recorders for different profile names could be executed at the same time.
|
|
33
|
+
* @param headers - Additional headers mapping for multipart http(s) uploads
|
|
34
|
+
* @param fileFieldName - The name of the form field, where the file content BLOB should be stored for http(s) uploads. Defaults to `file`
|
|
35
|
+
* @param formFields - Additional form fields for multipart http(s) uploads
|
|
36
|
+
* @returns The resulting file in `.trace` format. This file can either be returned directly as base64-encoded `.zip` archive or uploaded to a remote location (note that such files may be large), _depending on the `remotePath` argument value._ Thereafter, the file may be unarchived and opened with Xcode Developer Tools.
|
|
59
37
|
* @throws {Error} If no performance recording with given profile name/device udid combination
|
|
60
38
|
* has been started before or the resulting .trace file has not been generated properly.
|
|
61
|
-
* @this {XCUITestDriver}
|
|
62
39
|
*/
|
|
63
|
-
export function mobileStopPerfRecord(this:
|
|
64
|
-
export class PerfRecorder {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
get profileName(): any;
|
|
77
|
-
getOriginalReportPath(): Promise<string>;
|
|
40
|
+
export declare function mobileStopPerfRecord(this: XCUITestDriver, remotePath?: string, user?: string, pass?: string, method?: Method, profileName?: string, headers?: Record<string, any>, fileFieldName?: string, formFields?: Record<string, any> | [string, any][]): Promise<string>;
|
|
41
|
+
export declare class PerfRecorder {
|
|
42
|
+
private _process;
|
|
43
|
+
private _zippedReportPath;
|
|
44
|
+
private readonly _timeout;
|
|
45
|
+
private readonly _profileName;
|
|
46
|
+
private readonly _reportPath;
|
|
47
|
+
private readonly _pid;
|
|
48
|
+
private readonly _udid;
|
|
49
|
+
private readonly _logger;
|
|
50
|
+
private _archivePromise;
|
|
51
|
+
constructor(reportRoot: string, udid: string, opts?: PerfRecorderOptions);
|
|
52
|
+
get profileName(): string;
|
|
78
53
|
getZippedReportPath(): Promise<string>;
|
|
79
54
|
isRunning(): boolean;
|
|
80
|
-
_enforceTermination(): Promise<string>;
|
|
81
55
|
start(): Promise<void>;
|
|
82
56
|
stop(force?: boolean): Promise<string>;
|
|
57
|
+
private getOriginalReportPath;
|
|
58
|
+
private _enforceTermination;
|
|
59
|
+
}
|
|
60
|
+
interface PerfRecorderOptions {
|
|
61
|
+
timeout?: number;
|
|
62
|
+
profileName?: string;
|
|
63
|
+
pid?: number;
|
|
83
64
|
}
|
|
84
|
-
export
|
|
65
|
+
export {};
|
|
85
66
|
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../lib/commands/performance.
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../lib/commands/performance.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAC;AAiBlC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,SAAqB,EAC5B,WAAW,SAAuB,EAClC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,EACf,WAAW,SAAuB,EAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,aAAa,CAAC,EAAE,MAAM,EACtB,UAAU,CAAC,EAAE,MAAM,CAAC,M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