appium-mac2-driver 3.2.2 → 3.2.4
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 +15 -0
- package/build/lib/commands/app-management.d.ts +18 -21
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +14 -25
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/applescript.d.ts +8 -9
- package/build/lib/commands/applescript.d.ts.map +1 -1
- package/build/lib/commands/applescript.js +14 -13
- package/build/lib/commands/applescript.js.map +1 -1
- package/build/lib/commands/execute.d.ts +5 -8
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +5 -13
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/find.d.ts +6 -8
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +8 -13
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +105 -118
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +141 -154
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +4 -6
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +2 -8
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/record-screen.d.ts +57 -98
- package/build/lib/commands/record-screen.d.ts.map +1 -1
- package/build/lib/commands/record-screen.js +81 -84
- package/build/lib/commands/record-screen.js.map +1 -1
- package/build/lib/commands/screenshots.d.ts +5 -5
- package/build/lib/commands/screenshots.d.ts.map +1 -1
- package/build/lib/commands/screenshots.js +3 -8
- package/build/lib/commands/screenshots.js.map +1 -1
- package/build/lib/commands/source.d.ts +4 -5
- package/build/lib/commands/source.d.ts.map +1 -1
- package/build/lib/commands/source.js +3 -8
- package/build/lib/commands/source.js.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts +12 -10
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js +9 -9
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/doctor/required-checks.d.ts +12 -10
- package/build/lib/doctor/required-checks.d.ts.map +1 -1
- package/build/lib/doctor/required-checks.js +9 -9
- package/build/lib/doctor/required-checks.js.map +1 -1
- package/build/lib/doctor/utils.d.ts +3 -3
- package/build/lib/doctor/utils.d.ts.map +1 -1
- package/build/lib/doctor/utils.js +2 -2
- package/build/lib/doctor/utils.js.map +1 -1
- package/build/lib/logger.d.ts +1 -1
- package/build/lib/logger.d.ts.map +1 -1
- package/build/lib/logger.js.map +1 -1
- package/build/lib/utils.d.ts +11 -11
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +6 -7
- package/build/lib/utils.js.map +1 -1
- package/lib/commands/app-management.ts +88 -0
- package/lib/commands/{applescript.js → applescript.ts} +28 -24
- package/lib/commands/execute.ts +32 -0
- package/lib/commands/find.ts +34 -0
- package/lib/commands/{gestures.js → gestures.ts} +333 -238
- package/lib/commands/navigation.ts +19 -0
- package/lib/commands/{record-screen.js → record-screen.ts} +165 -138
- package/lib/commands/screenshots.ts +18 -0
- package/lib/commands/{source.js → source.ts} +10 -11
- package/lib/doctor/optional-checks.ts +67 -0
- package/lib/doctor/required-checks.ts +75 -0
- package/lib/doctor/{utils.js → utils.ts} +4 -3
- package/lib/{logger.js → logger.ts} +1 -0
- package/lib/{utils.js → utils.ts} +8 -10
- package/npm-shrinkwrap.json +13 -13
- package/package.json +1 -1
- package/lib/commands/app-management.js +0 -83
- package/lib/commands/execute.js +0 -33
- package/lib/commands/find.js +0 -31
- package/lib/commands/navigation.js +0 -18
- package/lib/commands/screenshots.js +0 -18
- package/lib/doctor/optional-checks.js +0 -64
- package/lib/doctor/required-checks.js +0 -72
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAElB"}
|
|
@@ -5,18 +5,12 @@ exports.macosDeepLink = macosDeepLink;
|
|
|
5
5
|
* Opens the given URL with the default or the given application.
|
|
6
6
|
* Xcode must be at version 14.3+.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @param
|
|
10
|
-
* @param {string} [bundleId] The bundle identifier of an application to open
|
|
8
|
+
* @param url - The URL to be opened.
|
|
9
|
+
* @param bundleId - The bundle identifier of an application to open
|
|
11
10
|
* the given url with. If not provided then the default application
|
|
12
11
|
* for the given url scheme is going to be used.
|
|
13
|
-
* @returns {Promise<unknown>}
|
|
14
12
|
*/
|
|
15
13
|
async function macosDeepLink(url, bundleId) {
|
|
16
14
|
return await this.wda.proxy.command('/url', 'POST', { url, bundleId });
|
|
17
15
|
}
|
|
18
|
-
;
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
21
|
-
*/
|
|
22
16
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.ts"],"names":[],"mappings":";;AAWA,sCAMC;AAfD;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CAEjC,GAAW,EACX,QAAiB;IAEjB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
2
|
+
import type { AppiumLogger, StringRecord } from '@appium/types';
|
|
3
|
+
type Preset = 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow';
|
|
4
|
+
interface ScreenRecorderOptions {
|
|
5
|
+
fps?: number;
|
|
6
|
+
deviceId: string | number;
|
|
7
|
+
preset?: Preset;
|
|
8
|
+
captureCursor?: boolean;
|
|
9
|
+
captureClicks?: boolean;
|
|
10
|
+
videoFilter?: string;
|
|
11
|
+
timeLimit?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class ScreenRecorder {
|
|
14
|
+
private readonly _log;
|
|
15
|
+
private readonly _videoPath;
|
|
16
|
+
private _process;
|
|
17
|
+
private readonly _fps;
|
|
18
|
+
private readonly _deviceId;
|
|
19
|
+
private readonly _captureCursor?;
|
|
20
|
+
private readonly _captureClicks?;
|
|
21
|
+
private readonly _preset;
|
|
22
|
+
private readonly _videoFilter?;
|
|
23
|
+
private readonly _timeLimit;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param videoPath - Path to the video file
|
|
27
|
+
* @param log - Logger instance
|
|
28
|
+
* @param opts - Screen recorder options
|
|
29
|
+
*/
|
|
30
|
+
constructor(videoPath: string, log: AppiumLogger, opts: ScreenRecorderOptions);
|
|
31
|
+
getVideoPath(): Promise<string>;
|
|
32
|
+
isRunning(): boolean;
|
|
33
|
+
start(): Promise<void>;
|
|
34
|
+
stop(force?: boolean): Promise<string>;
|
|
35
|
+
private _enforceTermination;
|
|
36
|
+
}
|
|
1
37
|
/**
|
|
2
38
|
* Record the display in background while the automated test is running.
|
|
3
39
|
* This method requires FFMPEG (https://www.ffmpeg.org/download.html) to be installed
|
|
@@ -5,133 +41,56 @@
|
|
|
5
41
|
* in System Preferences->Security & Privacy->Screen Recording.
|
|
6
42
|
* The resulting video uses H264 codec and is ready to be played by media players built-in into web browsers.
|
|
7
43
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @param {string|number} deviceId Screen device index to use for the recording.
|
|
44
|
+
* @param deviceId - Screen device index to use for the recording.
|
|
10
45
|
* The list of available devices could be retrieved using
|
|
11
46
|
* `ffmpeg -f avfoundation -list_devices true -i` command.
|
|
12
|
-
* @param
|
|
47
|
+
* @param timeLimit - The maximum recording time, in seconds. The default
|
|
13
48
|
* value is 600 seconds (10 minutes).
|
|
14
|
-
* @param
|
|
49
|
+
* @param videoFilter - The video filter spec to apply for ffmpeg.
|
|
15
50
|
* See https://trac.ffmpeg.org/wiki/FilteringGuide for more details on the possible values.
|
|
16
51
|
* Example: Set it to `scale=ifnot(gte(iw\,1024)\,iw\,1024):-2` in order to limit the video width
|
|
17
52
|
* to 1024px. The height will be adjusted automatically to match the actual ratio.
|
|
18
|
-
* @param
|
|
53
|
+
* @param fps - The count of frames per second in the resulting video.
|
|
19
54
|
* The greater fps it has the bigger file size is. 15 by default.
|
|
20
|
-
* @param
|
|
21
|
-
* One of the supported encoding presets. A preset is a collection of options that will provide a
|
|
55
|
+
* @param preset - One of the supported encoding presets. A preset is a collection of options that will provide a
|
|
22
56
|
* certain encoding speed to compression ratio.
|
|
23
57
|
* A slower preset will provide better compression (compression is quality per filesize).
|
|
24
58
|
* This means that, for example, if you target a certain file size or constant bit rate, you will
|
|
25
59
|
* achieve better quality with a slower preset. Read https://trac.ffmpeg.org/wiki/Encode/H.264 for more details.
|
|
26
60
|
* `veryfast` by default
|
|
27
|
-
* @param
|
|
61
|
+
* @param captureCursor - Whether to capture the mouse cursor while recording the screen.
|
|
28
62
|
* False by default
|
|
29
|
-
* @param
|
|
63
|
+
* @param captureClicks - Whether to capture mouse clicks while recording the screen.
|
|
30
64
|
* False by default.
|
|
31
|
-
* @param
|
|
32
|
-
|
|
33
|
-
|
|
65
|
+
* @param forceRestart - Whether to ignore the call if a screen recording is currently running
|
|
66
|
+
* (`false`) or to start a new recording immediately and terminate the existing one
|
|
67
|
+
* if running (`true`). The default value is `true`.
|
|
34
68
|
* @throws {Error} If screen recording has failed to start or is not supported on the device under test.
|
|
35
69
|
*/
|
|
36
|
-
export function startRecordingScreen(this:
|
|
37
|
-
export class startRecordingScreen {
|
|
38
|
-
/**
|
|
39
|
-
* Record the display in background while the automated test is running.
|
|
40
|
-
* This method requires FFMPEG (https://www.ffmpeg.org/download.html) to be installed
|
|
41
|
-
* and present in PATH. Also, the Appium process must be allowed to access screen recording
|
|
42
|
-
* in System Preferences->Security & Privacy->Screen Recording.
|
|
43
|
-
* The resulting video uses H264 codec and is ready to be played by media players built-in into web browsers.
|
|
44
|
-
*
|
|
45
|
-
* @this {Mac2Driver}
|
|
46
|
-
* @param {string|number} deviceId Screen device index to use for the recording.
|
|
47
|
-
* The list of available devices could be retrieved using
|
|
48
|
-
* `ffmpeg -f avfoundation -list_devices true -i` command.
|
|
49
|
-
* @param {string|number} [timeLimit] The maximum recording time, in seconds. The default
|
|
50
|
-
* value is 600 seconds (10 minutes).
|
|
51
|
-
* @param {string} [videoFilter] The video filter spec to apply for ffmpeg.
|
|
52
|
-
* See https://trac.ffmpeg.org/wiki/FilteringGuide for more details on the possible values.
|
|
53
|
-
* Example: Set it to `scale=ifnot(gte(iw\,1024)\,iw\,1024):-2` in order to limit the video width
|
|
54
|
-
* to 1024px. The height will be adjusted automatically to match the actual ratio.
|
|
55
|
-
* @param {string|number} [fps] The count of frames per second in the resulting video.
|
|
56
|
-
* The greater fps it has the bigger file size is. 15 by default.
|
|
57
|
-
* @param {'ultrafast'|'superfast'|'veryfast'|'faster'|'fast'|'medium'|'slow'|'slower'|'veryslow'} [preset]
|
|
58
|
-
* One of the supported encoding presets. A preset is a collection of options that will provide a
|
|
59
|
-
* certain encoding speed to compression ratio.
|
|
60
|
-
* A slower preset will provide better compression (compression is quality per filesize).
|
|
61
|
-
* This means that, for example, if you target a certain file size or constant bit rate, you will
|
|
62
|
-
* achieve better quality with a slower preset. Read https://trac.ffmpeg.org/wiki/Encode/H.264 for more details.
|
|
63
|
-
* `veryfast` by default
|
|
64
|
-
* @param {boolean} [captureCursor] Whether to capture the mouse cursor while recording the screen.
|
|
65
|
-
* False by default
|
|
66
|
-
* @param {boolean} [captureClicks] Whether to capture mouse clicks while recording the screen.
|
|
67
|
-
* False by default.
|
|
68
|
-
* @param {boolean} [forceRestart=true] Whether to ignore the call if a screen recording is currently running
|
|
69
|
-
* (`false`) or to start a new recording immediately and terminate the existing one
|
|
70
|
-
* if running (`true`). The default value is `true`.
|
|
71
|
-
* @throws {Error} If screen recording has failed to start or is not supported on the device under test.
|
|
72
|
-
*/
|
|
73
|
-
constructor(this: import("../driver").Mac2Driver, deviceId: string | number, timeLimit?: string | number, videoFilter?: string, fps?: string | number, preset?: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow", captureCursor?: boolean, captureClicks?: boolean, forceRestart?: boolean);
|
|
74
|
-
_screenRecorder: ScreenRecorder;
|
|
75
|
-
}
|
|
70
|
+
export declare function startRecordingScreen(this: Mac2Driver, deviceId: string | number, timeLimit?: string | number, videoFilter?: string, fps?: string | number, preset?: Preset, captureCursor?: boolean, captureClicks?: boolean, forceRestart?: boolean): Promise<void>;
|
|
76
71
|
/**
|
|
77
72
|
* Stop recording the screen.
|
|
78
73
|
* If no screen recording has been started before then the method returns an empty string.
|
|
79
74
|
*
|
|
80
|
-
* @param
|
|
75
|
+
* @param remotePath - The path to the remote location, where the resulting video should be uploaded.
|
|
81
76
|
* The following protocols are supported: http/https, ftp.
|
|
82
77
|
* Null or empty string value (the default setting) means the content of resulting
|
|
83
78
|
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
84
79
|
* An exception will be thrown if the generated media file is too big to
|
|
85
80
|
* fit into the available process memory.
|
|
86
|
-
* @param
|
|
87
|
-
* @param
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
*
|
|
91
|
-
* @param {string} [fileFieldName] The name of the form field, where the file content BLOB should
|
|
81
|
+
* @param user - The name of the user for the remote authentication.
|
|
82
|
+
* @param pass - The password for the remote authentication.
|
|
83
|
+
* @param method - The http multipart upload method name. The 'PUT' one is used by default.
|
|
84
|
+
* @param headers - Additional headers mapping for multipart http(s) uploads
|
|
85
|
+
* @param fileFieldName - The name of the form field, where the file content BLOB should
|
|
92
86
|
* be stored for http(s) uploads
|
|
93
|
-
* @param
|
|
94
|
-
*
|
|
95
|
-
* @returns {Promise<string>} Base64-encoded content of the recorded media file if 'remotePath'
|
|
87
|
+
* @param formFields - Additional form fields for multipart http(s) uploads
|
|
88
|
+
* @returns Base64-encoded content of the recorded media file if 'remotePath'
|
|
96
89
|
* parameter is falsy or an empty string.
|
|
97
|
-
* @this {Mac2Driver}
|
|
98
90
|
* @throws {Error} If there was an error while getting the name of a media file
|
|
99
91
|
* or the file content cannot be uploaded to the remote location
|
|
100
92
|
* or screen recording is not supported on the device under test.
|
|
101
93
|
*/
|
|
102
|
-
export function stopRecordingScreen(this:
|
|
103
|
-
export
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @param {string} videoPath
|
|
107
|
-
* @param {import('@appium/types').AppiumLogger} log
|
|
108
|
-
* @param {ScreenRecorderOptions} opts
|
|
109
|
-
*/
|
|
110
|
-
constructor(videoPath: string, log: import("@appium/types").AppiumLogger, opts: ScreenRecorderOptions);
|
|
111
|
-
_log: import("@appium/types").AppiumLogger;
|
|
112
|
-
_videoPath: string;
|
|
113
|
-
_process: any;
|
|
114
|
-
_fps: number;
|
|
115
|
-
_deviceId: string | number;
|
|
116
|
-
_captureCursor: boolean | undefined;
|
|
117
|
-
_captureClicks: boolean | undefined;
|
|
118
|
-
_preset: string;
|
|
119
|
-
_videoFilter: string | undefined;
|
|
120
|
-
_timeLimit: number;
|
|
121
|
-
getVideoPath(): Promise<string>;
|
|
122
|
-
isRunning(): boolean;
|
|
123
|
-
_enforceTermination(): Promise<string>;
|
|
124
|
-
start(): Promise<void>;
|
|
125
|
-
stop(force?: boolean): Promise<any>;
|
|
126
|
-
}
|
|
127
|
-
export type Mac2Driver = import("../driver").Mac2Driver;
|
|
128
|
-
export type ScreenRecorderOptions = {
|
|
129
|
-
fps?: number | undefined;
|
|
130
|
-
deviceId: string | number;
|
|
131
|
-
preset?: string | undefined;
|
|
132
|
-
captureCursor?: boolean | undefined;
|
|
133
|
-
captureClicks?: boolean | undefined;
|
|
134
|
-
videoFilter?: string | undefined;
|
|
135
|
-
timeLimit?: number | undefined;
|
|
136
|
-
};
|
|
94
|
+
export declare function stopRecordingScreen(this: Mac2Driver, remotePath?: string | null, user?: string, pass?: string, method?: string, headers?: StringRecord | [string, any][], fileFieldName?: string, formFields?: StringRecord | [string, string][]): Promise<string>;
|
|
95
|
+
export {};
|
|
137
96
|
//# sourceMappingURL=record-screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-screen.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-screen.
|
|
1
|
+
{"version":3,"file":"record-screen.d.ts","sourceRoot":"","sources":["../../../lib/commands/record-screen.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAWhE,KAAK,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAErH,UAAU,qBAAqB;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,S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G;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,UAAU,EAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,EAC1B,IAAI,CAAC,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EACxC,aAAa,CAAC,EAAE,MAAM,EACtB,UAAU,CAAC,EAAE,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAC7C,OAAO,CAAC,MAAM,CAAC,CAqBjB"}
|
|
@@ -21,37 +21,45 @@ const FFMPEG_BINARY = 'ffmpeg';
|
|
|
21
21
|
const DEFAULT_FPS = 15;
|
|
22
22
|
const DEFAULT_PRESET = 'veryfast';
|
|
23
23
|
/**
|
|
24
|
-
* @param
|
|
24
|
+
* @param log - Logger instance
|
|
25
25
|
*/
|
|
26
26
|
async function requireFfmpegPath(log) {
|
|
27
27
|
try {
|
|
28
28
|
return await support_1.fs.which(FFMPEG_BINARY);
|
|
29
29
|
}
|
|
30
30
|
catch {
|
|
31
|
-
throw log.errorWithException(`${FFMPEG_BINARY} has not been found in PATH. ` +
|
|
32
|
-
`Please make sure it is installed`);
|
|
31
|
+
throw log.errorWithException(`${FFMPEG_BINARY} has not been found in PATH. ` + `Please make sure it is installed`);
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
class ScreenRecorder {
|
|
35
|
+
_log;
|
|
36
|
+
_videoPath;
|
|
37
|
+
_process;
|
|
38
|
+
_fps;
|
|
39
|
+
_deviceId;
|
|
40
|
+
_captureCursor;
|
|
41
|
+
_captureClicks;
|
|
42
|
+
_preset;
|
|
43
|
+
_videoFilter;
|
|
44
|
+
_timeLimit;
|
|
36
45
|
/**
|
|
37
46
|
*
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
47
|
+
* @param videoPath - Path to the video file
|
|
48
|
+
* @param log - Logger instance
|
|
49
|
+
* @param opts - Screen recorder options
|
|
41
50
|
*/
|
|
42
51
|
constructor(videoPath, log, opts) {
|
|
43
52
|
this._log = log;
|
|
44
53
|
this._videoPath = videoPath;
|
|
45
54
|
this._process = null;
|
|
46
|
-
this._fps =
|
|
55
|
+
this._fps = opts.fps && opts.fps > 0 ? opts.fps : DEFAULT_FPS;
|
|
47
56
|
this._deviceId = opts.deviceId;
|
|
48
57
|
this._captureCursor = opts.captureCursor;
|
|
49
58
|
this._captureClicks = opts.captureClicks;
|
|
50
59
|
this._preset = opts.preset || DEFAULT_PRESET;
|
|
51
60
|
this._videoFilter = opts.videoFilter;
|
|
52
|
-
this._timeLimit =
|
|
53
|
-
? opts.timeLimit
|
|
54
|
-
: DEFAULT_TIME_LIMIT;
|
|
61
|
+
this._timeLimit =
|
|
62
|
+
opts.timeLimit && opts.timeLimit > 0 ? opts.timeLimit : DEFAULT_TIME_LIMIT;
|
|
55
63
|
}
|
|
56
64
|
async getVideoPath() {
|
|
57
65
|
return (await support_1.fs.exists(this._videoPath)) ? this._videoPath : '';
|
|
@@ -59,48 +67,40 @@ class ScreenRecorder {
|
|
|
59
67
|
isRunning() {
|
|
60
68
|
return !!(this._process?.isRunning);
|
|
61
69
|
}
|
|
62
|
-
async _enforceTermination() {
|
|
63
|
-
if (this._process && this.isRunning()) {
|
|
64
|
-
this._log.debug('Force-stopping the currently running video recording');
|
|
65
|
-
try {
|
|
66
|
-
await this._process.stop('SIGKILL');
|
|
67
|
-
}
|
|
68
|
-
catch { }
|
|
69
|
-
}
|
|
70
|
-
this._process = null;
|
|
71
|
-
const videoPath = await this.getVideoPath();
|
|
72
|
-
if (videoPath) {
|
|
73
|
-
await support_1.fs.rimraf(videoPath);
|
|
74
|
-
}
|
|
75
|
-
return '';
|
|
76
|
-
}
|
|
77
70
|
async start() {
|
|
78
71
|
const ffmpeg = await requireFfmpegPath(this._log);
|
|
79
|
-
/** @type {string[]} */
|
|
80
72
|
const args = [
|
|
81
|
-
'-loglevel',
|
|
82
|
-
'
|
|
83
|
-
'-
|
|
73
|
+
'-loglevel',
|
|
74
|
+
'error',
|
|
75
|
+
'-t',
|
|
76
|
+
`${this._timeLimit}`,
|
|
77
|
+
'-f',
|
|
78
|
+
'avfoundation',
|
|
84
79
|
...(this._captureCursor ? ['-capture_cursor', '1'] : []),
|
|
85
80
|
...(this._captureClicks ? ['-capture_mouse_clicks', '1'] : []),
|
|
86
|
-
'-framerate',
|
|
87
|
-
|
|
88
|
-
'-
|
|
89
|
-
|
|
90
|
-
'-
|
|
91
|
-
'
|
|
92
|
-
'-
|
|
93
|
-
|
|
94
|
-
'-
|
|
95
|
-
'
|
|
81
|
+
'-framerate',
|
|
82
|
+
`${this._fps}`,
|
|
83
|
+
'-i',
|
|
84
|
+
`${this._deviceId}`,
|
|
85
|
+
'-vcodec',
|
|
86
|
+
'libx264',
|
|
87
|
+
'-preset',
|
|
88
|
+
this._preset,
|
|
89
|
+
'-tune',
|
|
90
|
+
'zerolatency',
|
|
91
|
+
'-pix_fmt',
|
|
92
|
+
'yuv420p',
|
|
93
|
+
'-movflags',
|
|
94
|
+
'+faststart',
|
|
95
|
+
'-fflags',
|
|
96
|
+
'nobuffer',
|
|
97
|
+
'-f',
|
|
98
|
+
DEFAULT_EXT,
|
|
99
|
+
'-r',
|
|
100
|
+
`${this._fps}`,
|
|
96
101
|
...(this._videoFilter ? ['-filter:v', this._videoFilter] : []),
|
|
97
102
|
];
|
|
98
|
-
|
|
99
|
-
const fullCmd = [
|
|
100
|
-
ffmpeg,
|
|
101
|
-
...args,
|
|
102
|
-
this._videoPath,
|
|
103
|
-
];
|
|
103
|
+
const fullCmd = [ffmpeg, ...args, this._videoPath];
|
|
104
104
|
this._process = new teen_process_1.SubProcess(fullCmd[0], fullCmd.slice(1));
|
|
105
105
|
this._log.debug(`Starting ${FFMPEG_BINARY}: ${support_1.util.quote(fullCmd)}`);
|
|
106
106
|
this._process.on('output', (stdout, stderr) => {
|
|
@@ -166,6 +166,23 @@ class ScreenRecorder {
|
|
|
166
166
|
this._process?.proc?.stdin?.end();
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
+
async _enforceTermination() {
|
|
170
|
+
if (this._process && this.isRunning()) {
|
|
171
|
+
this._log.debug('Force-stopping the currently running video recording');
|
|
172
|
+
try {
|
|
173
|
+
await this._process.stop('SIGKILL');
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// Ignore errors during force stop
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
this._process = null;
|
|
180
|
+
const videoPath = await this.getVideoPath();
|
|
181
|
+
if (videoPath) {
|
|
182
|
+
await support_1.fs.rimraf(videoPath);
|
|
183
|
+
}
|
|
184
|
+
return '';
|
|
185
|
+
}
|
|
169
186
|
}
|
|
170
187
|
exports.ScreenRecorder = ScreenRecorder;
|
|
171
188
|
/**
|
|
@@ -175,32 +192,30 @@ exports.ScreenRecorder = ScreenRecorder;
|
|
|
175
192
|
* in System Preferences->Security & Privacy->Screen Recording.
|
|
176
193
|
* The resulting video uses H264 codec and is ready to be played by media players built-in into web browsers.
|
|
177
194
|
*
|
|
178
|
-
* @
|
|
179
|
-
* @param {string|number} deviceId Screen device index to use for the recording.
|
|
195
|
+
* @param deviceId - Screen device index to use for the recording.
|
|
180
196
|
* The list of available devices could be retrieved using
|
|
181
197
|
* `ffmpeg -f avfoundation -list_devices true -i` command.
|
|
182
|
-
* @param
|
|
198
|
+
* @param timeLimit - The maximum recording time, in seconds. The default
|
|
183
199
|
* value is 600 seconds (10 minutes).
|
|
184
|
-
* @param
|
|
200
|
+
* @param videoFilter - The video filter spec to apply for ffmpeg.
|
|
185
201
|
* See https://trac.ffmpeg.org/wiki/FilteringGuide for more details on the possible values.
|
|
186
202
|
* Example: Set it to `scale=ifnot(gte(iw\,1024)\,iw\,1024):-2` in order to limit the video width
|
|
187
203
|
* to 1024px. The height will be adjusted automatically to match the actual ratio.
|
|
188
|
-
* @param
|
|
204
|
+
* @param fps - The count of frames per second in the resulting video.
|
|
189
205
|
* The greater fps it has the bigger file size is. 15 by default.
|
|
190
|
-
* @param
|
|
191
|
-
* One of the supported encoding presets. A preset is a collection of options that will provide a
|
|
206
|
+
* @param preset - One of the supported encoding presets. A preset is a collection of options that will provide a
|
|
192
207
|
* certain encoding speed to compression ratio.
|
|
193
208
|
* A slower preset will provide better compression (compression is quality per filesize).
|
|
194
209
|
* This means that, for example, if you target a certain file size or constant bit rate, you will
|
|
195
210
|
* achieve better quality with a slower preset. Read https://trac.ffmpeg.org/wiki/Encode/H.264 for more details.
|
|
196
211
|
* `veryfast` by default
|
|
197
|
-
* @param
|
|
212
|
+
* @param captureCursor - Whether to capture the mouse cursor while recording the screen.
|
|
198
213
|
* False by default
|
|
199
|
-
* @param
|
|
214
|
+
* @param captureClicks - Whether to capture mouse clicks while recording the screen.
|
|
200
215
|
* False by default.
|
|
201
|
-
* @param
|
|
202
|
-
|
|
203
|
-
|
|
216
|
+
* @param forceRestart - Whether to ignore the call if a screen recording is currently running
|
|
217
|
+
* (`false`) or to start a new recording immediately and terminate the existing one
|
|
218
|
+
* if running (`true`). The default value is `true`.
|
|
204
219
|
* @throws {Error} If screen recording has failed to start or is not supported on the device under test.
|
|
205
220
|
*/
|
|
206
221
|
async function startRecordingScreen(deviceId, timeLimit, videoFilter, fps, preset, captureCursor, captureClicks, forceRestart = true) {
|
|
@@ -239,29 +254,25 @@ async function startRecordingScreen(deviceId, timeLimit, videoFilter, fps, prese
|
|
|
239
254
|
throw e;
|
|
240
255
|
}
|
|
241
256
|
}
|
|
242
|
-
;
|
|
243
257
|
/**
|
|
244
258
|
* Stop recording the screen.
|
|
245
259
|
* If no screen recording has been started before then the method returns an empty string.
|
|
246
260
|
*
|
|
247
|
-
* @param
|
|
261
|
+
* @param remotePath - The path to the remote location, where the resulting video should be uploaded.
|
|
248
262
|
* The following protocols are supported: http/https, ftp.
|
|
249
263
|
* Null or empty string value (the default setting) means the content of resulting
|
|
250
264
|
* file should be encoded as Base64 and passed as the endpoint response value.
|
|
251
265
|
* An exception will be thrown if the generated media file is too big to
|
|
252
266
|
* fit into the available process memory.
|
|
253
|
-
* @param
|
|
254
|
-
* @param
|
|
255
|
-
* @param
|
|
256
|
-
* @param
|
|
257
|
-
*
|
|
258
|
-
* @param {string} [fileFieldName] The name of the form field, where the file content BLOB should
|
|
267
|
+
* @param user - The name of the user for the remote authentication.
|
|
268
|
+
* @param pass - The password for the remote authentication.
|
|
269
|
+
* @param method - The http multipart upload method name. The 'PUT' one is used by default.
|
|
270
|
+
* @param headers - Additional headers mapping for multipart http(s) uploads
|
|
271
|
+
* @param fileFieldName - The name of the form field, where the file content BLOB should
|
|
259
272
|
* be stored for http(s) uploads
|
|
260
|
-
* @param
|
|
261
|
-
*
|
|
262
|
-
* @returns {Promise<string>} Base64-encoded content of the recorded media file if 'remotePath'
|
|
273
|
+
* @param formFields - Additional form fields for multipart http(s) uploads
|
|
274
|
+
* @returns Base64-encoded content of the recorded media file if 'remotePath'
|
|
263
275
|
* parameter is falsy or an empty string.
|
|
264
|
-
* @this {Mac2Driver}
|
|
265
276
|
* @throws {Error} If there was an error while getting the name of a media file
|
|
266
277
|
* or the file content cannot be uploaded to the remote location
|
|
267
278
|
* or screen recording is not supported on the device under test.
|
|
@@ -283,22 +294,8 @@ async function stopRecordingScreen(remotePath, user, pass, method, headers, file
|
|
|
283
294
|
method,
|
|
284
295
|
headers,
|
|
285
296
|
fileFieldName,
|
|
286
|
-
formFields
|
|
297
|
+
formFields,
|
|
287
298
|
};
|
|
288
299
|
return await helpers_1.uploadRecordedMedia.bind(this)(videoPath, remotePath, options);
|
|
289
300
|
}
|
|
290
|
-
;
|
|
291
|
-
/**
|
|
292
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
293
|
-
*/
|
|
294
|
-
/**
|
|
295
|
-
* @typedef {Object} ScreenRecorderOptions
|
|
296
|
-
* @property {number} [fps]
|
|
297
|
-
* @property {string|number} deviceId
|
|
298
|
-
* @property {string} [preset]
|
|
299
|
-
* @property {boolean} [captureCursor]
|
|
300
|
-
* @property {boolean} [captureClicks]
|
|
301
|
-
* @property {string} [videoFilter]
|
|
302
|
-
* @property {number} [timeLimit]
|
|
303
|
-
*/
|
|
304
301
|
//# sourceMappingURL=record-screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-screen.js","sourceRoot":"","sources":["../../../lib/commands/record-screen.
|
|
1
|
+
{"version":3,"file":"record-screen.js","sourceRoot":"","sources":["../../../lib/commands/record-screen.ts"],"names":[],"mappings":";;;;;;AAuPA,oDAoDC;AAyBD,kDA8BC;AAlWD,oDAAuB;AACvB,uCAA4C;AAC5C,4CAAmD;AACnD,+CAA0C;AAC1C,wDAAyB;AACzB,uCAAgD;AAIhD,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa;AACjD,MAAM,wBAAwB,GAAG,EAAE,GAAG,IAAI,CAAC;AAC3C,MAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,cAAc,GAAG,UAAU,CAAC;AAclC;;GAEG;AACH,KAAK,UAAU,iBAAiB,CAAC,GAAiB;IAChD,IAAI,CAAC;QACH,OAAO,MAAM,YAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,CAAC,kBAAkB,CAC1B,GAAG,aAAa,+BAA+B,GAAG,kCAAkC,CACrF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAa,cAAc;IACR,IAAI,CAAe;IACnB,UAAU,CAAS;IAC5B,QAAQ,CAAoB;IACnB,IAAI,CAAS;IACb,SAAS,CAAkB;IAC3B,cAAc,CAAW;IACzB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AAC;IACZ,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IACpD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACpE,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,OAAO,GAAiB;QAC5B,IAAI;QACJ,IAAI;QACJ,MAAM;QACN,OAAO;QACP,aAAa;QACb,UAAU;KACX,CAAC;IACF,OAAO,MAAM,6BAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
2
|
+
import type { ScreenshotsInfo } from '../types';
|
|
1
3
|
/**
|
|
2
4
|
* Retrieves screenshots of each display available to macOS
|
|
3
5
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @param {number} [displayId] macOS display identifier to take a screenshot for.
|
|
6
|
+
* @param displayId - macOS display identifier to take a screenshot for.
|
|
6
7
|
* If not provided then screenshots of all displays are going to be returned.
|
|
7
8
|
* If no matches were found then an error is thrown.
|
|
8
|
-
* @returns
|
|
9
|
+
* @returns Screenshots information for the requested display(s)
|
|
9
10
|
*/
|
|
10
|
-
export function macosScreenshots(this:
|
|
11
|
-
export type Mac2Driver = import("../driver").Mac2Driver;
|
|
11
|
+
export declare function macosScreenshots(this: Mac2Driver, displayId?: number): Promise<ScreenshotsInfo>;
|
|
12
12
|
//# 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":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,UAAU,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC,CAE1B"}
|
|
@@ -4,17 +4,12 @@ exports.macosScreenshots = macosScreenshots;
|
|
|
4
4
|
/**
|
|
5
5
|
* Retrieves screenshots of each display available to macOS
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
* @param {number} [displayId] macOS display identifier to take a screenshot for.
|
|
7
|
+
* @param displayId - macOS display identifier to take a screenshot for.
|
|
9
8
|
* If not provided then screenshots of all displays are going to be returned.
|
|
10
9
|
* If no matches were found then an error is thrown.
|
|
11
|
-
* @returns
|
|
10
|
+
* @returns Screenshots information for the requested display(s)
|
|
12
11
|
*/
|
|
13
12
|
async function macosScreenshots(displayId) {
|
|
14
|
-
return
|
|
13
|
+
return (await this.wda.proxy.command('/wda/screenshots', 'POST', { displayId }));
|
|
15
14
|
}
|
|
16
|
-
;
|
|
17
|
-
/**
|
|
18
|
-
* @typedef {import('../driver').Mac2Driver} Mac2Driver
|
|
19
|
-
*/
|
|
20
15
|
//# 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":";;AAWA,4CAKC;AAbD;;;;;;;GAOG;AACI,KAAK,UAAU,gBAAgB,CAEpC,SAAkB;IAElB,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAoB,CAAC;AACtG,CAAC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import type { Mac2Driver } from '../driver';
|
|
1
2
|
/**
|
|
2
3
|
* Retrieves the string representation of the current application
|
|
3
4
|
*
|
|
4
|
-
* @
|
|
5
|
-
* @param {string} [format='xml'] The format of the application source to retrieve.
|
|
5
|
+
* @param format - The format of the application source to retrieve.
|
|
6
6
|
* Only two formats are supported:
|
|
7
7
|
* - xml: Returns the source formatted as XML document (the default setting)
|
|
8
8
|
* - description: Returns the source formatted as debugDescription output.
|
|
9
9
|
* See https://developer.apple.com/documentation/xctest/xcuielement/1500909-debugdescription?language=objc
|
|
10
10
|
* for more details.
|
|
11
|
-
* @returns
|
|
11
|
+
* @returns the page source in the requested format
|
|
12
12
|
*/
|
|
13
|
-
export function macosSource(this:
|
|
14
|
-
export type Mac2Driver = import("../driver").Mac2Driver;
|
|
13
|
+
export declare function macosSource(this: Mac2Driver, format?: string): Promise<string>;
|
|
15
14
|
//# 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":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,MAAM,GAAE,MAAc,GACrB,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|