@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,69 +1,42 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { AudioRecorderOptions } from './types';
|
|
3
|
+
export declare class AudioRecorder {
|
|
4
|
+
private readonly input;
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly audioPath;
|
|
7
|
+
private readonly opts;
|
|
8
|
+
private mainProcess;
|
|
9
|
+
constructor(input: string | number, log: any, audioPath: string, opts?: AudioRecorderOptions);
|
|
10
|
+
start(timeoutSeconds: number): Promise<void>;
|
|
11
|
+
isRecording(): boolean;
|
|
12
|
+
interrupt(force?: boolean): Promise<boolean>;
|
|
13
|
+
finish(): Promise<string>;
|
|
14
|
+
cleanup(): Promise<void>;
|
|
15
|
+
}
|
|
1
16
|
/**
|
|
2
17
|
* Records the given hardware audio input and saves it into an `.mp4` file.
|
|
3
18
|
*
|
|
4
19
|
* **To use this command, the `audio_record` security feature must be enabled _and_ [FFMpeg](https://ffmpeg.org/) must be installed on the Appium server.**
|
|
5
20
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
21
|
+
* @param audioInput - The name of the corresponding audio input device to use for the capture. The full list of capture devices could be shown by executing `ffmpeg -f avfoundation -list_devices true -i ""`
|
|
22
|
+
* @param timeLimit - The maximum recording time, in seconds.
|
|
23
|
+
* @param audioCodec - The name of the audio codec.
|
|
24
|
+
* @param audioBitrate - The bitrate of the resulting audio stream.
|
|
25
|
+
* @param audioChannels - The count of audio channels in the resulting stream. Setting it to `1` will create a single channel (mono) audio stream.
|
|
26
|
+
* @param audioRate - The sampling rate of the resulting audio stream (in Hz).
|
|
27
|
+
* @param forceRestart - Whether to restart audio capture process forcefully when `mobile: startRecordingAudio` is called (`true`) or ignore the call until the current audio recording is completed (`false`).
|
|
13
28
|
* @group Real Device Only
|
|
14
|
-
* @this {XCUITestDriver}
|
|
15
|
-
* @returns {Promise<void>}
|
|
16
|
-
* @privateRemarks Using string literals for the default parameters makes better documentation.
|
|
17
29
|
*/
|
|
18
|
-
export function startAudioRecording(this:
|
|
19
|
-
export class startAudioRecording {
|
|
20
|
-
/**
|
|
21
|
-
* Records the given hardware audio input and saves it into an `.mp4` file.
|
|
22
|
-
*
|
|
23
|
-
* **To use this command, the `audio_record` security feature must be enabled _and_ [FFMpeg](https://ffmpeg.org/) must be installed on the Appium server.**
|
|
24
|
-
*
|
|
25
|
-
* @param {string|number} audioInput - The name of the corresponding audio input device to use for the capture. The full list of capture devices could be shown by executing `ffmpeg -f avfoundation -list_devices true -i ""`
|
|
26
|
-
* @param {string|number} timeLimit - The maximum recording time, in seconds.
|
|
27
|
-
* @param {string} audioCodec - The name of the audio codec.
|
|
28
|
-
* @param {string} audioBitrate - The bitrate of the resulting audio stream.
|
|
29
|
-
* @param {string|number} audioChannels - The count of audio channels in the resulting stream. Setting it to `1` will create a single channel (mono) audio stream.
|
|
30
|
-
* @param {string|number} audioRate - The sampling rate of the resulting audio stream (in Hz).
|
|
31
|
-
* @param {boolean} forceRestart - Whether to restart audio capture process forcefully when `mobile: startRecordingAudio` is called (`true`) or ignore the call until the current audio recording is completed (`false`).
|
|
32
|
-
* @group Real Device Only
|
|
33
|
-
* @this {XCUITestDriver}
|
|
34
|
-
* @returns {Promise<void>}
|
|
35
|
-
* @privateRemarks Using string literals for the default parameters makes better documentation.
|
|
36
|
-
*/
|
|
37
|
-
constructor(this: import("../driver").XCUITestDriver, audioInput: string | number, timeLimit?: string | number, audioCodec?: string, audioBitrate?: string, audioChannels?: string | number, audioRate?: string | number, forceRestart?: boolean);
|
|
38
|
-
_audioRecorder: AudioRecorder;
|
|
39
|
-
}
|
|
30
|
+
export declare function startAudioRecording(this: XCUITestDriver, audioInput: string | number, timeLimit?: string | number, audioCodec?: string, audioBitrate?: string, audioChannels?: string | number, audioRate?: string | number, forceRestart?: boolean): Promise<void>;
|
|
40
31
|
/**
|
|
41
32
|
* Stop recording of the audio input. If no audio recording process is running then
|
|
42
33
|
* the endpoint will try to get the recently recorded file.
|
|
43
34
|
* If no previously recorded file is found and no active audio recording
|
|
44
35
|
* processes are running then the method returns an empty string.
|
|
45
36
|
*
|
|
46
|
-
* @returns
|
|
37
|
+
* @returns Base64-encoded content of the recorded media file or an
|
|
47
38
|
* empty string if no audio recording has been started before.
|
|
48
39
|
* @throws {Error} If there was an error while getting the recorded file.
|
|
49
|
-
* @this {XCUITestDriver}
|
|
50
40
|
*/
|
|
51
|
-
export function stopAudioRecording(this:
|
|
52
|
-
export class stopAudioRecording {
|
|
53
|
-
_audioRecorder: any;
|
|
54
|
-
}
|
|
55
|
-
export class AudioRecorder {
|
|
56
|
-
constructor(input: any, log: any, audioPath: any, opts?: {});
|
|
57
|
-
input: any;
|
|
58
|
-
log: any;
|
|
59
|
-
audioPath: any;
|
|
60
|
-
opts: {};
|
|
61
|
-
mainProcess: any;
|
|
62
|
-
start(timeoutSeconds: any): Promise<void>;
|
|
63
|
-
isRecording(): boolean;
|
|
64
|
-
interrupt(force?: boolean): Promise<boolean>;
|
|
65
|
-
finish(): Promise<any>;
|
|
66
|
-
cleanup(): Promise<void>;
|
|
67
|
-
}
|
|
68
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
41
|
+
export declare function stopAudioRecording(this: XCUITestDriver): Promise<string>;
|
|
69
42
|
//# sourceMappingURL=record-audio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-audio.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-audio.
|
|
1
|
+
{"version":3,"file":"record-audio.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-audio.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAWlD,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAC5C,OAAO,CAAC,WAAW,CAAoB;gBAE3B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,oBAAiD;IAQlH,KAAK,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgFlD,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;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,MAAM,GAAG,MAAM,EAC3B,SAAS,GAAE,MAAM,GAAG,MAAY,EAChC,UAAU,SAAQ,EAClB,YAAY,SAAS,EACrB,aAAa,GAAE,MAAM,GAAG,MAAU,EAClC,SAAS,GAAE,MAAM,GAAG,MAAc,EAClC,YAAY,UAAQ,GACnB,OAAO,CAAC,IAAI,CAAC,CA+Df;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAqB9E"}
|
|
@@ -15,6 +15,11 @@ const DEFAULT_EXT = '.mp4';
|
|
|
15
15
|
const FFMPEG_BINARY = 'ffmpeg';
|
|
16
16
|
const ffmpegLogger = support_1.logger.getLogger(FFMPEG_BINARY);
|
|
17
17
|
class AudioRecorder {
|
|
18
|
+
input;
|
|
19
|
+
log;
|
|
20
|
+
audioPath;
|
|
21
|
+
opts;
|
|
22
|
+
mainProcess;
|
|
18
23
|
constructor(input, log, audioPath, opts = {}) {
|
|
19
24
|
this.input = input;
|
|
20
25
|
this.log = log;
|
|
@@ -37,7 +42,7 @@ class AudioRecorder {
|
|
|
37
42
|
'-f',
|
|
38
43
|
audioSource,
|
|
39
44
|
'-i',
|
|
40
|
-
this.input,
|
|
45
|
+
String(this.input),
|
|
41
46
|
'-c:a',
|
|
42
47
|
audioCodec,
|
|
43
48
|
'-b:a',
|
|
@@ -83,7 +88,7 @@ class AudioRecorder {
|
|
|
83
88
|
])}'. ` + `Will timeout in ${timeoutSeconds}s`);
|
|
84
89
|
this.mainProcess.once('exit', (code, signal) => {
|
|
85
90
|
// ffmpeg returns code 255 if SIGINT arrives
|
|
86
|
-
if ([0, 255].includes(code)) {
|
|
91
|
+
if ([0, 255].includes(code ?? 0)) {
|
|
87
92
|
this.log.info(`The recording session on audio input '${this.input}' has been finished`);
|
|
88
93
|
}
|
|
89
94
|
else {
|
|
@@ -126,17 +131,14 @@ exports.AudioRecorder = AudioRecorder;
|
|
|
126
131
|
*
|
|
127
132
|
* **To use this command, the `audio_record` security feature must be enabled _and_ [FFMpeg](https://ffmpeg.org/) must be installed on the Appium server.**
|
|
128
133
|
*
|
|
129
|
-
* @param
|
|
130
|
-
* @param
|
|
131
|
-
* @param
|
|
132
|
-
* @param
|
|
133
|
-
* @param
|
|
134
|
-
* @param
|
|
135
|
-
* @param
|
|
134
|
+
* @param audioInput - The name of the corresponding audio input device to use for the capture. The full list of capture devices could be shown by executing `ffmpeg -f avfoundation -list_devices true -i ""`
|
|
135
|
+
* @param timeLimit - The maximum recording time, in seconds.
|
|
136
|
+
* @param audioCodec - The name of the audio codec.
|
|
137
|
+
* @param audioBitrate - The bitrate of the resulting audio stream.
|
|
138
|
+
* @param audioChannels - The count of audio channels in the resulting stream. Setting it to `1` will create a single channel (mono) audio stream.
|
|
139
|
+
* @param audioRate - The sampling rate of the resulting audio stream (in Hz).
|
|
140
|
+
* @param forceRestart - Whether to restart audio capture process forcefully when `mobile: startRecordingAudio` is called (`true`) or ignore the call until the current audio recording is completed (`false`).
|
|
136
141
|
* @group Real Device Only
|
|
137
|
-
* @this {XCUITestDriver}
|
|
138
|
-
* @returns {Promise<void>}
|
|
139
|
-
* @privateRemarks Using string literals for the default parameters makes better documentation.
|
|
140
142
|
*/
|
|
141
143
|
async function startAudioRecording(audioInput, timeLimit = 180, audioCodec = 'aac', audioBitrate = '128k', audioChannels = 2, audioRate = 44100, forceRestart = false) {
|
|
142
144
|
if (!this.isFeatureEnabled(AUDIO_RECORD_FEAT_NAME)) {
|
|
@@ -173,8 +175,8 @@ async function startAudioRecording(audioInput, timeLimit = 180, audioCodec = 'aa
|
|
|
173
175
|
audioSource: DEFAULT_SOURCE,
|
|
174
176
|
audioCodec,
|
|
175
177
|
audioBitrate,
|
|
176
|
-
audioChannels,
|
|
177
|
-
audioRate,
|
|
178
|
+
audioChannels: Number(audioChannels),
|
|
179
|
+
audioRate: Number(audioRate),
|
|
178
180
|
});
|
|
179
181
|
const timeoutSeconds = parseInt(String(timeLimit), 10);
|
|
180
182
|
if (isNaN(timeoutSeconds) || timeoutSeconds > MAX_RECORDING_TIME_SEC || timeoutSeconds <= 0) {
|
|
@@ -197,10 +199,9 @@ async function startAudioRecording(audioInput, timeLimit = 180, audioCodec = 'aa
|
|
|
197
199
|
* If no previously recorded file is found and no active audio recording
|
|
198
200
|
* processes are running then the method returns an empty string.
|
|
199
201
|
*
|
|
200
|
-
* @returns
|
|
202
|
+
* @returns Base64-encoded content of the recorded media file or an
|
|
201
203
|
* empty string if no audio recording has been started before.
|
|
202
204
|
* @throws {Error} If there was an error while getting the recorded file.
|
|
203
|
-
* @this {XCUITestDriver}
|
|
204
205
|
*/
|
|
205
206
|
async function stopAudioRecording() {
|
|
206
207
|
if (!this._audioRecorder) {
|
|
@@ -222,7 +223,4 @@ async function stopAudioRecording() {
|
|
|
222
223
|
}
|
|
223
224
|
return await (0, utils_1.encodeBase64OrUpload)(resultPath);
|
|
224
225
|
}
|
|
225
|
-
/**
|
|
226
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
227
|
-
*/
|
|
228
226
|
//# sourceMappingURL=record-audio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-audio.js","sourceRoot":"","sources":["../../../lib/commands/record-audio.
|
|
1
|
+
{"version":3,"file":"record-audio.js","sourceRoot":"","sources":["../../../lib/commands/record-audio.ts"],"names":[],"mappings":";;;AA+JA,kDAwEC;AAYD,gDAqBC;AAxQD,4CAAyD;AACzD,+CAAwC;AACxC,oCAA8C;AAC9C,uCAA0C;AAI1C,MAAM,sBAAsB,GAAG,KAAK,CAAC;AACrC,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAC9C,MAAM,cAAc,GAAG,cAAc,CAAC;AACtC,MAAM,0BAA0B,GAAG,IAAI,CAAC;AAExC,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,YAAY,GAAG,gBAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;AAErD,MAAa,aAAa;IACP,KAAK,CAAkB;IACvB,GAAG,CAAM;IACT,SAAS,CAAS;IAClB,IAAI,CAAuB;IACpC,WAAW,CAAoB;IAEvC,YAAY,KAAsB,EAAE,GAAQ,EAAE,SAAiB,EAAE,OAA6B,EAA0B;QACtH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,cAAsB;QAChC,IAAI,CAAC;YACH,MAAM,YAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CACb,IAAI,aAAa,yEAAyE;gBACxF,8DAA8D,CACjE,CAAC;QACJ,CAAC;QAED,MAAM,EAAC,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAC,GAAG,IAAI,CA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AI,CAAC;QACH,MAAM,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,aAAa,CAAC,OAAO,EAAE,CAAC;QAC9B,MAAM,CAAC,CAAC;IACV,CAAC;IACD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;AACtC,CAAC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,kBAAkB;IACtC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;QACzB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;QAChF,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,UAAkB,CAAC;IACvB,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;QAChD,IAAI,CAAC,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAC/B,GAAG,aAAa,cAAc,GAAG,2CAA2C,UAAU,GAAG,CAC1F,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,MAAM,CAAC,CAAC;IACV,CAAC;IACD,OAAO,MAAM,IAAA,4BAAoB,EAAC,UAAU,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { StartRecordingScreenOptions, StopRecordingScreenOptions } from './types';
|
|
3
|
+
export declare class ScreenRecorder {
|
|
4
|
+
private readonly videoPath;
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly opts;
|
|
7
|
+
private readonly udid;
|
|
8
|
+
private mainProcess;
|
|
9
|
+
private timeoutHandler;
|
|
10
|
+
constructor(udid: string, log: any, videoPath: string, opts?: ScreenRecorderOptions);
|
|
11
|
+
start(timeoutMs: number): Promise<void>;
|
|
12
|
+
interrupt(force?: boolean): Promise<boolean>;
|
|
13
|
+
finish(): Promise<string>;
|
|
14
|
+
cleanup(): Promise<void>;
|
|
15
|
+
}
|
|
1
16
|
/**
|
|
2
17
|
* Direct Appium to start recording the device screen
|
|
3
18
|
*
|
|
@@ -7,32 +22,12 @@
|
|
|
7
22
|
* If screen recording has been already started then the command will stop it forcefully and start a new one.
|
|
8
23
|
* The previously recorded video file will be deleted.
|
|
9
24
|
*
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
25
|
+
* @param options - The available options.
|
|
26
|
+
* @returns Base64-encoded content of the recorded media file if
|
|
12
27
|
* any screen recording is currently running or an empty string.
|
|
13
28
|
* @throws {Error} If screen recording has failed to start.
|
|
14
|
-
* @this {XCUITestDriver}
|
|
15
29
|
*/
|
|
16
|
-
export function startRecordingScreen(this:
|
|
17
|
-
export class startRecordingScreen {
|
|
18
|
-
/**
|
|
19
|
-
* Direct Appium to start recording the device screen
|
|
20
|
-
*
|
|
21
|
-
* Record the display of devices running iOS Simulator since Xcode 9 or real devices since iOS 11
|
|
22
|
-
* (ffmpeg utility is required: 'brew install ffmpeg').
|
|
23
|
-
* It records screen activity to a MPEG-4 file. Audio is not recorded with the video file.
|
|
24
|
-
* If screen recording has been already started then the command will stop it forcefully and start a new one.
|
|
25
|
-
* The previously recorded video file will be deleted.
|
|
26
|
-
*
|
|
27
|
-
* @param {import('./types').StartRecordingScreenOptions} [options] - The available options.
|
|
28
|
-
* @returns {Promise<string>} Base64-encoded content of the recorded media file if
|
|
29
|
-
* any screen recording is currently running or an empty string.
|
|
30
|
-
* @throws {Error} If screen recording has failed to start.
|
|
31
|
-
* @this {XCUITestDriver}
|
|
32
|
-
*/
|
|
33
|
-
constructor(this: import("../driver").XCUITestDriver, options?: import("./types").StartRecordingScreenOptions);
|
|
34
|
-
_recentScreenRecorder: ScreenRecorder;
|
|
35
|
-
}
|
|
30
|
+
export declare function startRecordingScreen(this: XCUITestDriver, options?: StartRecordingScreenOptions): Promise<string>;
|
|
36
31
|
/**
|
|
37
32
|
* Direct Appium to stop screen recording and return the video
|
|
38
33
|
*
|
|
@@ -41,49 +36,23 @@ export class startRecordingScreen {
|
|
|
41
36
|
* active screen recording processes are running then the method returns an
|
|
42
37
|
* empty string.
|
|
43
38
|
*
|
|
44
|
-
* @param
|
|
45
|
-
*
|
|
46
|
-
* @returns {Promise<string?>} Base64-encoded content of the recorded media
|
|
39
|
+
* @param options - The available options.
|
|
40
|
+
* @returns Base64-encoded content of the recorded media
|
|
47
41
|
* file if `remotePath` parameter is empty or null or an empty string.
|
|
48
42
|
* @throws {Error} If there was an error while getting the name of a media
|
|
49
43
|
* file or the file content cannot be uploaded to the remote
|
|
50
44
|
* location.
|
|
51
|
-
* @this {XCUITestDriver}
|
|
52
45
|
*/
|
|
53
|
-
export function stopRecordingScreen(this:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* @param {import('./types').StopRecordingScreenOptions} options - The available
|
|
64
|
-
* options.
|
|
65
|
-
* @returns {Promise<string?>} Base64-encoded content of the recorded media
|
|
66
|
-
* file if `remotePath` parameter is empty or null or an empty string.
|
|
67
|
-
* @throws {Error} If there was an error while getting the name of a media
|
|
68
|
-
* file or the file content cannot be uploaded to the remote
|
|
69
|
-
* location.
|
|
70
|
-
* @this {XCUITestDriver}
|
|
71
|
-
*/
|
|
72
|
-
constructor(this: import("../driver").XCUITestDriver, options?: import("./types").StopRecordingScreenOptions);
|
|
73
|
-
_recentScreenRecorder: any;
|
|
74
|
-
}
|
|
75
|
-
export class ScreenRecorder {
|
|
76
|
-
constructor(udid: any, log: any, videoPath: any, opts?: {});
|
|
77
|
-
videoPath: any;
|
|
78
|
-
log: any;
|
|
79
|
-
opts: {};
|
|
80
|
-
udid: any;
|
|
81
|
-
mainProcess: any;
|
|
82
|
-
timeoutHandler: NodeJS.Timeout | null;
|
|
83
|
-
start(timeoutMs: any): Promise<void>;
|
|
84
|
-
interrupt(force?: boolean): Promise<boolean>;
|
|
85
|
-
finish(): Promise<any>;
|
|
86
|
-
cleanup(): Promise<void>;
|
|
46
|
+
export declare function stopRecordingScreen(this: XCUITestDriver, options?: StopRecordingScreenOptions): Promise<string | null>;
|
|
47
|
+
interface ScreenRecorderOptions {
|
|
48
|
+
hardwareAcceleration?: string;
|
|
49
|
+
remotePort?: number;
|
|
50
|
+
remoteUrl?: string;
|
|
51
|
+
videoFps?: number;
|
|
52
|
+
videoType?: string;
|
|
53
|
+
videoScale?: string;
|
|
54
|
+
videoFilters?: string;
|
|
55
|
+
pixelFormat?: string;
|
|
87
56
|
}
|
|
88
|
-
export
|
|
57
|
+
export {};
|
|
89
58
|
//# sourceMappingURL=recordscreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordscreen.d.ts","sourceRoot":"","sources":["../../../lib/commands/recordscreen.
|
|
1
|
+
{"version":3,"file":"recordscreen.d.ts","sourceRoot":"","sources":["../../../lib/commands/recordscreen.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,2BAA2B,EAAE,0BAA0B,EAAC,MAAM,SAAS,CAAC;AAwErF,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO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videoTypeHWAccel: 'h264_qsv',
|
|
64
64
|
},
|
|
65
65
|
/* https://trac.ffmpeg.org/wiki/Hardware/VAAPI */
|
|
66
66
|
vaapi: {
|
|
67
67
|
hwaccel: 'vaapi',
|
|
68
68
|
hwaccelOutputFormat: 'vaapi',
|
|
69
69
|
scaleFilterHWAccel: 'scale_vaapi',
|
|
70
|
-
videoTypeHWAccel: 'h264_vaapi'
|
|
71
|
-
}
|
|
70
|
+
videoTypeHWAccel: 'h264_vaapi',
|
|
71
|
+
},
|
|
72
72
|
};
|
|
73
73
|
const CAPTURE_START_MARKER = /^\s*frame=/;
|
|
74
74
|
class ScreenRecorder {
|
|
75
|
+
videoPath;
|
|
76
|
+
log;
|
|
77
|
+
opts;
|
|
78
|
+
udid;
|
|
79
|
+
mainProcess;
|
|
80
|
+
timeoutHandler;
|
|
75
81
|
constructor(udid, log, videoPath, opts = {}) {
|
|
76
82
|
this.videoPath = videoPath;
|
|
77
83
|
this.log = log;
|
|
@@ -102,7 +108,7 @@ class ScreenRecorder {
|
|
|
102
108
|
'-reconnect_delay_max',
|
|
103
109
|
`${timeoutMs / 1000 + 1}`,
|
|
104
110
|
];
|
|
105
|
-
const { hwaccel, hwaccelOutputFormat, scaleFilterHWAccel, videoTypeHWAccel } = HARDWARE_ACCELERATION_PARAMETERS[hardwareAcceleration] ?? {};
|
|
111
|
+
const { hwaccel, hwaccelOutputFormat, scaleFilterHWAccel, videoTypeHWAccel, } = HARDWARE_ACCELERATION_PARAMETERS[hardwareAcceleration || ''] ?? {};
|
|
106
112
|
if (hwaccel) {
|
|
107
113
|
args.push('-hwaccel', hwaccel);
|
|
108
114
|
}
|
|
@@ -110,10 +116,10 @@ class ScreenRecorder {
|
|
|
110
116
|
args.push('-hwaccel_output_format', hwaccelOutputFormat);
|
|
111
117
|
}
|
|
112
118
|
//Parameter `-r` is optional. See details: https://github.com/appium/appium/issues/12067
|
|
113
|
-
if (videoFps && videoType === 'libx264' || videoTypeHWAccel) {
|
|
114
|
-
args.push('-r', videoFps);
|
|
119
|
+
if ((videoFps && videoType === 'libx264') || videoTypeHWAccel) {
|
|
120
|
+
args.push('-r', String(videoFps));
|
|
115
121
|
}
|
|
116
|
-
const { protocol, hostname } = url_1.default.parse(remoteUrl);
|
|
122
|
+
const { protocol, hostname } = url_1.default.parse(remoteUrl || '');
|
|
117
123
|
args.push('-i', `${protocol}//${hostname}:${remotePort}`);
|
|
118
124
|
if (videoFilters || videoScale) {
|
|
119
125
|
args.push('-vf', videoFilters || `${scaleFilterHWAccel || 'scale'}=${videoScale}`);
|
|
@@ -122,7 +128,7 @@ class ScreenRecorder {
|
|
|
122
128
|
if (pixelFormat) {
|
|
123
129
|
args.push('-pix_fmt', pixelFormat);
|
|
124
130
|
}
|
|
125
|
-
args.push('-vcodec', videoTypeHWAccel || videoType);
|
|
131
|
+
args.push('-vcodec', videoTypeHWAccel || videoType || DEFAULT_VCODEC);
|
|
126
132
|
args.push('-y');
|
|
127
133
|
args.push(this.videoPath);
|
|
128
134
|
this.mainProcess = new teen_process_1.SubProcess(FFMPEG_BINARY, args);
|
|
@@ -152,7 +158,8 @@ class ScreenRecorder {
|
|
|
152
158
|
throw new Error(`The screen capture process '${FFMPEG_BINARY}' died unexpectedly. ` +
|
|
153
159
|
`Check server logs for more details`);
|
|
154
160
|
}
|
|
155
|
-
this.log.info(`Starting screen capture on the device '${this.udid}' with command: '${FFMPEG_BINARY} ${args.join(' ')}'. ` +
|
|
161
|
+
this.log.info(`Starting screen capture on the device '${this.udid}' with command: '${FFMPEG_BINARY} ${args.join(' ')}'. ` +
|
|
162
|
+
`Will timeout in ${timeoutMs}ms`);
|
|
156
163
|
this.timeoutHandler = setTimeout(async () => {
|
|
157
164
|
if (!(await this.interrupt())) {
|
|
158
165
|
this.log.warn(`Cannot finish the active screen recording on the device '${this.udid}' after ${timeoutMs}ms timeout`);
|
|
@@ -199,14 +206,13 @@ exports.ScreenRecorder = ScreenRecorder;
|
|
|
199
206
|
* If screen recording has been already started then the command will stop it forcefully and start a new one.
|
|
200
207
|
* The previously recorded video file will be deleted.
|
|
201
208
|
*
|
|
202
|
-
* @param
|
|
203
|
-
* @returns
|
|
209
|
+
* @param options - The available options.
|
|
210
|
+
* @returns Base64-encoded content of the recorded media file if
|
|
204
211
|
* any screen recording is currently running or an empty string.
|
|
205
212
|
* @throws {Error} If screen recording has failed to start.
|
|
206
|
-
* @this {XCUITestDriver}
|
|
207
213
|
*/
|
|
208
214
|
async function startRecordingScreen(options = {}) {
|
|
209
|
-
const { videoType = DEFAULT_VCODEC, timeLimit = DEFAULT_RECORDING_TIME_SEC, videoQuality = DEFAULT_QUALITY, videoFps = DEFAULT_FPS, videoFilters, videoScale, forceRestart, pixelFormat, hardwareAcceleration } = options;
|
|
215
|
+
const { videoType = DEFAULT_VCODEC, timeLimit = DEFAULT_RECORDING_TIME_SEC, videoQuality = DEFAULT_QUALITY, videoFps = DEFAULT_FPS, videoFilters, videoScale, forceRestart, pixelFormat, hardwareAcceleration, } = options;
|
|
210
216
|
let result = '';
|
|
211
217
|
if (!forceRestart) {
|
|
212
218
|
this.log.info(`Checking if there is/was a previous screen recording. ` +
|
|
@@ -215,7 +221,7 @@ async function startRecordingScreen(options = {}) {
|
|
|
215
221
|
}
|
|
216
222
|
const videoPath = await support_1.tempDir.path({
|
|
217
223
|
prefix: `appium_${Math.random().toString(16).substring(2, 8)}`,
|
|
218
|
-
suffix: MP4_EXT
|
|
224
|
+
suffix: MP4_EXT,
|
|
219
225
|
});
|
|
220
226
|
const wdaBaseUrl = this.opts.wdaBaseUrl || appium_webdriveragent_1.WDA_BASE_URL;
|
|
221
227
|
const screenRecorder = new ScreenRecorder(this.device.udid, this.log, videoPath, {
|
|
@@ -224,9 +230,9 @@ async function startRecordingScreen(options = {}) {
|
|
|
224
230
|
videoType,
|
|
225
231
|
videoFilters,
|
|
226
232
|
videoScale,
|
|
227
|
-
videoFps,
|
|
233
|
+
videoFps: typeof videoFps === 'string' ? parseInt(videoFps, 10) : videoFps,
|
|
228
234
|
pixelFormat,
|
|
229
|
-
hardwareAcceleration
|
|
235
|
+
hardwareAcceleration,
|
|
230
236
|
});
|
|
231
237
|
if (!(await screenRecorder.interrupt(true))) {
|
|
232
238
|
throw this.log.errorWithException('Unable to stop screen recording process');
|
|
@@ -240,8 +246,7 @@ async function startRecordingScreen(options = {}) {
|
|
|
240
246
|
throw this.log.errorWithException(`The timeLimit value must be in range [1, ${MAX_RECORDING_TIME_SEC}] seconds. ` +
|
|
241
247
|
`The value of '${timeLimit}' has been passed instead.`);
|
|
242
248
|
}
|
|
243
|
-
let { mjpegServerScreenshotQuality, mjpegServerFramerate } =
|
|
244
|
-
/** @type {import('appium-webdriveragent').WDASettings} */ (await this.proxyCommand('/appium/settings', 'GET'));
|
|
249
|
+
let { mjpegServerScreenshotQuality, mjpegServerFramerate } = (await this.proxyCommand('/appium/settings', 'GET'));
|
|
245
250
|
if (videoQuality) {
|
|
246
251
|
const quality = lodash_1.default.isInteger(videoQuality)
|
|
247
252
|
? videoQuality
|
|
@@ -249,7 +254,8 @@ async function startRecordingScreen(options = {}) {
|
|
|
249
254
|
if (!quality) {
|
|
250
255
|
throw new Error(`videoQuality value should be one of ${JSON.stringify(lodash_1.default.keys(QUALITY_MAPPING))} or a number in range 1..100. ` + `'${videoQuality}' is given instead`);
|
|
251
256
|
}
|
|
252
|
-
mjpegServerScreenshotQuality =
|
|
257
|
+
mjpegServerScreenshotQuality =
|
|
258
|
+
mjpegServerScreenshotQuality !== quality ? quality : undefined;
|
|
253
259
|
}
|
|
254
260
|
else {
|
|
255
261
|
mjpegServerScreenshotQuality = undefined;
|
|
@@ -269,8 +275,8 @@ async function startRecordingScreen(options = {}) {
|
|
|
269
275
|
await this.proxyCommand('/appium/settings', 'POST', {
|
|
270
276
|
settings: {
|
|
271
277
|
mjpegServerScreenshotQuality,
|
|
272
|
-
mjpegServerFramerate
|
|
273
|
-
}
|
|
278
|
+
mjpegServerFramerate,
|
|
279
|
+
},
|
|
274
280
|
});
|
|
275
281
|
}
|
|
276
282
|
try {
|
|
@@ -292,14 +298,12 @@ async function startRecordingScreen(options = {}) {
|
|
|
292
298
|
* active screen recording processes are running then the method returns an
|
|
293
299
|
* empty string.
|
|
294
300
|
*
|
|
295
|
-
* @param
|
|
296
|
-
*
|
|
297
|
-
* @returns {Promise<string?>} Base64-encoded content of the recorded media
|
|
301
|
+
* @param options - The available options.
|
|
302
|
+
* @returns Base64-encoded content of the recorded media
|
|
298
303
|
* file if `remotePath` parameter is empty or null or an empty string.
|
|
299
304
|
* @throws {Error} If there was an error while getting the name of a media
|
|
300
305
|
* file or the file content cannot be uploaded to the remote
|
|
301
306
|
* location.
|
|
302
|
-
* @this {XCUITestDriver}
|
|
303
307
|
*/
|
|
304
308
|
async function stopRecordingScreen(options = {}) {
|
|
305
309
|
if (!this._recentScreenRecorder) {
|
|
@@ -320,7 +324,4 @@ async function stopRecordingScreen(options = {}) {
|
|
|
320
324
|
this._recentScreenRecorder = null;
|
|
321
325
|
}
|
|
322
326
|
}
|
|
323
|
-
/**
|
|
324
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
325
|
-
*/
|
|
326
327
|
//# sourceMappingURL=recordscreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordscreen.js","sourceRoot":"","sources":["../../../lib/commands/recordscreen.
|
|
1
|
+
{"version":3,"file":"recordscreen.js","sourceRoot":"","sources":["../../../lib/commands/recordscreen.ts"],"names":[],"mappings":";;;;;;AAmQA,oDA4GC;AAiBD,kDAuBC;AAvZD,oDAAuB;AACvB,4CAAyD;AACzD,+CAAwC;AACxC,oCAA8C;AAC9C,iEAAmD;AACnD,uCAA0C;AAC1C,8CAAsB;AAKtB;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,IAAI,CAAC;AACpC,MAAM,0BAA0B,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,eAAe,GA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AC5D,IAAI,CAAC,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAC/B,yCAAyC;gBACvC,4CAA4C,SAAS,GAAG,CAC3D,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,IAAA,4BAAoB,EAAC,SAAS,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;YAAS,CAAC;QACT,MAAM,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;QAC3C,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { Element } from '@appium/types';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
+
* Takes a screenshot of the current screen.
|
|
5
|
+
*
|
|
6
|
+
* @returns Base64-encoded screenshot data
|
|
4
7
|
*/
|
|
5
|
-
export function getScreenshot(this:
|
|
8
|
+
export declare function getScreenshot(this: XCUITestDriver): Promise<string>;
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
10
|
+
* Takes a screenshot of a specific element.
|
|
11
|
+
*
|
|
12
|
+
* @param el - Element to capture
|
|
13
|
+
* @returns Base64-encoded screenshot data
|
|
8
14
|
*/
|
|
9
|
-
export function getElementScreenshot(this:
|
|
15
|
+
export declare function getElementScreenshot(this: XCUITestDriver, el: Element<string> | string): Promise<string>;
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
17
|
+
* Takes a screenshot of the current viewport.
|
|
18
|
+
*
|
|
19
|
+
* @returns Base64-encoded screenshot data
|
|
13
20
|
*/
|
|
14
|
-
export function getViewportScreenshot(this:
|
|
15
|
-
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
21
|
+
export declare function getViewportScreenshot(this: XCUITestDriver): Promise<string>;
|
|
16
22
|
//# sourceMappingURL=screenshots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../../lib/commands/screenshots.
|
|
1
|
+
{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../../lib/commands/screenshots.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAE3C;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8DzE;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAC3B,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BjF"}
|