appium-xcuitest-driver 10.13.2 → 10.13.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/app-management.d.ts +99 -76
  3. package/build/lib/commands/app-management.d.ts.map +1 -1
  4. package/build/lib/commands/app-management.js +83 -73
  5. package/build/lib/commands/app-management.js.map +1 -1
  6. package/build/lib/commands/general.d.ts +84 -80
  7. package/build/lib/commands/general.d.ts.map +1 -1
  8. package/build/lib/commands/general.js +66 -53
  9. package/build/lib/commands/general.js.map +1 -1
  10. package/build/lib/commands/log.d.ts +42 -44
  11. package/build/lib/commands/log.d.ts.map +1 -1
  12. package/build/lib/commands/log.js +32 -53
  13. package/build/lib/commands/log.js.map +1 -1
  14. package/build/lib/commands/navigation.d.ts +1 -1
  15. package/build/lib/commands/navigation.d.ts.map +1 -1
  16. package/build/lib/commands/performance.d.ts +36 -55
  17. package/build/lib/commands/performance.d.ts.map +1 -1
  18. package/build/lib/commands/performance.js +93 -86
  19. package/build/lib/commands/performance.js.map +1 -1
  20. package/build/lib/commands/recordscreen.d.ts +31 -63
  21. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  22. package/build/lib/commands/recordscreen.js +29 -28
  23. package/build/lib/commands/recordscreen.js.map +1 -1
  24. package/build/lib/commands/xctest.d.ts +37 -37
  25. package/build/lib/commands/xctest.d.ts.map +1 -1
  26. package/build/lib/commands/xctest.js +38 -50
  27. package/build/lib/commands/xctest.js.map +1 -1
  28. package/build/lib/execute-method-map.d.ts.map +1 -1
  29. package/build/lib/execute-method-map.js +0 -2
  30. package/build/lib/execute-method-map.js.map +1 -1
  31. package/lib/commands/app-management.ts +414 -0
  32. package/lib/commands/{general.js → general.ts} +101 -76
  33. package/lib/commands/{log.js → log.ts} +68 -68
  34. package/lib/commands/{performance.js → performance.ts} +133 -114
  35. package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
  36. package/lib/commands/{xctest.js → xctest.ts} +78 -71
  37. package/lib/execute-method-map.ts +0 -2
  38. package/npm-shrinkwrap.json +8 -8
  39. package/package.json +1 -1
  40. package/lib/commands/app-management.js +0 -346
@@ -7,7 +7,7 @@ exports.PerfRecorder = void 0;
7
7
  exports.mobileStartPerfRecord = mobileStartPerfRecord;
8
8
  exports.mobileStopPerfRecord = mobileStopPerfRecord;
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
- const path_1 = __importDefault(require("path"));
10
+ const node_path_1 = __importDefault(require("node:path"));
11
11
  const support_1 = require("appium/support");
12
12
  const teen_process_1 = require("teen_process");
13
13
  const utils_1 = require("../utils");
@@ -39,10 +39,9 @@ const XCRUN = 'xcrun';
39
39
  *
40
40
  * Read [Recording, Pausing, and Stopping Traces](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html) for more details.
41
41
  *
42
- * @param {number} timeout - The maximum count of milliseconds to record the profiling information.
43
- * @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.
44
- * @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).
45
- * @this {XCUITestDriver}
42
+ * @param timeout - The maximum count of milliseconds to record the profiling information.
43
+ * @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.
44
+ * @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).
46
45
  */
47
46
  async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName = DEFAULT_PROFILE_NAME, pid) {
48
47
  if (!this.isFeatureEnabled(PERF_RECORD_FEAT_NAME) && !this.isRealDevice()) {
@@ -62,7 +61,7 @@ async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName =
62
61
  let realPid;
63
62
  if (pid) {
64
63
  if (lodash_1.default.toLower(String(pid)) === DEFAULT_PID) {
65
- const appInfo = /** @type {import('./types').ActiveAppInfo} */ (await this.proxyCommand('/wda/activeAppInfo', 'GET'));
64
+ const appInfo = (await this.proxyCommand('/wda/activeAppInfo', 'GET'));
66
65
  realPid = appInfo.pid;
67
66
  }
68
67
  else {
@@ -72,7 +71,7 @@ async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName =
72
71
  const recorder = new PerfRecorder(await support_1.tempDir.openDir(), this.device.udid, {
73
72
  timeout: parseInt(String(timeout), 10),
74
73
  profileName,
75
- pid: parseInt(String(realPid), 10),
74
+ pid: realPid,
76
75
  });
77
76
  await recorder.start();
78
77
  this._perfRecorders = [...(this._perfRecorders || []), recorder];
@@ -84,19 +83,17 @@ async function mobileStartPerfRecord(timeout = DEFAULT_TIMEOUT_MS, profileName =
84
83
  *
85
84
  * 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.
86
85
  *
87
- * @param {string} [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.
88
- * @param {string} [user] - The name of the user for the remote authentication. Only works if `remotePath` is provided.
89
- * @param {string} [pass] - The password for the remote authentication. Only works if `remotePath` is provided.
90
- * @param {import('axios').Method} [method] - The http multipart upload method name. Only works if `remotePath` is provided. Defaults to `PUT`
91
- * @param {string} 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.
92
- * @param {Record<string,any>} [headers] - Additional headers mapping for multipart http(s) uploads
93
- * @param {string} [fileFieldName] - The name of the form field, where the file content BLOB should be stored for http(s) uploads. Defaults to `file`
94
- * @param {Record<string,any>|([string, any])[]} [formFields] - Additional form fields for multipart http(s) uploads
95
- *
96
- * @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.
86
+ * @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.
87
+ * @param user - The name of the user for the remote authentication. Only works if `remotePath` is provided.
88
+ * @param pass - The password for the remote authentication. Only works if `remotePath` is provided.
89
+ * @param method - The http multipart upload method name. Only works if `remotePath` is provided. Defaults to `PUT`
90
+ * @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.
91
+ * @param headers - Additional headers mapping for multipart http(s) uploads
92
+ * @param fileFieldName - The name of the form field, where the file content BLOB should be stored for http(s) uploads. Defaults to `file`
93
+ * @param formFields - Additional form fields for multipart http(s) uploads
94
+ * @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.
97
95
  * @throws {Error} If no performance recording with given profile name/device udid combination
98
96
  * has been started before or the resulting .trace file has not been generated properly.
99
- * @this {XCUITestDriver}
100
97
  */
101
98
  async function mobileStopPerfRecord(remotePath, user, pass, method, profileName = DEFAULT_PROFILE_NAME, headers, fileFieldName, formFields) {
102
99
  if (!this.isFeatureEnabled(PERF_RECORD_FEAT_NAME) && !this.isRealDevice()) {
@@ -112,7 +109,10 @@ async function mobileStopPerfRecord(remotePath, user, pass, method, profileName
112
109
  `and device ${this.device.udid}. Have you started the profiling before?`);
113
110
  }
114
111
  const recorder = lodash_1.default.first(recorders);
115
- const resultPath = await /** @type {PerfRecorder} */ (recorder).stop();
112
+ if (!recorder) {
113
+ throw this.log.errorWithException(`No recorder found for performance profile '${profileName}' and device ${this.device.udid}`);
114
+ }
115
+ const resultPath = await recorder.stop();
116
116
  if (!(await support_1.fs.exists(resultPath))) {
117
117
  throw this.log.errorWithException(`There is no ${DEFAULT_EXT} file found for performance profile '${profileName}' ` +
118
118
  `and device ${this.device.udid}. Make sure the selected profile is supported on this device`);
@@ -129,35 +129,22 @@ async function mobileStopPerfRecord(remotePath, user, pass, method, profileName
129
129
  await support_1.fs.rimraf(resultPath);
130
130
  return result;
131
131
  }
132
- async function requireXctrace() {
133
- const xcrunPath = await requireXcrun();
134
- try {
135
- await (0, teen_process_1.exec)(xcrunPath, [XCTRACE, 'help']);
136
- }
137
- catch (e) {
138
- throw new Error(`${XCTRACE} is not available for the active Xcode version. ` +
139
- `Please make sure XCode is up to date. Original error: ${e.stderr || e.message}`);
140
- }
141
- return xcrunPath;
142
- }
143
- async function requireInstruments() {
144
- try {
145
- return await support_1.fs.which(INSTRUMENTS);
146
- }
147
- catch {
148
- throw new Error(`${INSTRUMENTS} has not been found in PATH. ` +
149
- `Please make sure XCode development tools are installed`);
150
- }
151
- }
152
132
  class PerfRecorder {
153
- /** @type {import('teen_process').SubProcess|null} */
154
133
  _process;
134
+ _zippedReportPath;
135
+ _timeout;
136
+ _profileName;
137
+ _reportPath;
138
+ _pid;
139
+ _udid;
140
+ _logger;
141
+ _archivePromise;
155
142
  constructor(reportRoot, udid, opts = {}) {
156
143
  this._process = null;
157
144
  this._zippedReportPath = '';
158
145
  this._timeout = opts.timeout && opts.timeout > 0 ? opts.timeout : DEFAULT_TIMEOUT_MS;
159
146
  this._profileName = opts.profileName || DEFAULT_PROFILE_NAME;
160
- this._reportPath = path_1.default.resolve(reportRoot, `appium_perf__${this._profileName.replace(/\W/g, '_')}__${Date.now()}${DEFAULT_EXT}`);
147
+ this._reportPath = node_path_1.default.resolve(reportRoot, `appium_perf__${this._profileName.replace(/\W/g, '_')}__${Date.now()}${DEFAULT_EXT}`);
161
148
  this._pid = opts.pid;
162
149
  this._udid = udid;
163
150
  this._logger = support_1.logger.getLogger(`${lodash_1.default.truncate(this._profileName, { length: 10 })}@${this._udid.substring(0, 8)}`);
@@ -166,9 +153,6 @@ class PerfRecorder {
166
153
  get profileName() {
167
154
  return this._profileName;
168
155
  }
169
- async getOriginalReportPath() {
170
- return (await support_1.fs.exists(this._reportPath)) ? this._reportPath : '';
171
- }
172
156
  async getZippedReportPath() {
173
157
  // This is to prevent possible race conditions, because the archive operation
174
158
  // could be pretty time-intensive
@@ -179,13 +163,13 @@ class PerfRecorder {
179
163
  return '';
180
164
  }
181
165
  const zippedReportPath = await support_1.tempDir.path({
182
- prefix: path_1.default.parse(originalReportPath).name,
166
+ prefix: node_path_1.default.parse(originalReportPath).name,
183
167
  suffix: '.zip',
184
168
  });
185
169
  await support_1.zip.toArchive(zippedReportPath, {
186
- cwd: path_1.default.dirname(this._reportPath),
170
+ cwd: node_path_1.default.dirname(this._reportPath),
187
171
  });
188
- await support_1.fs.rimraf(path_1.default.dirname(this._reportPath));
172
+ await support_1.fs.rimraf(node_path_1.default.dirname(this._reportPath));
189
173
  this._zippedReportPath = zippedReportPath;
190
174
  return this._zippedReportPath;
191
175
  })();
@@ -195,41 +179,6 @@ class PerfRecorder {
195
179
  isRunning() {
196
180
  return !!this._process?.isRunning;
197
181
  }
198
- async _enforceTermination() {
199
- if (this._process && this.isRunning()) {
200
- this._logger.debug('Force-stopping the currently running perf recording');
201
- try {
202
- await this._process.stop('SIGKILL');
203
- }
204
- catch { }
205
- }
206
- this._process = null;
207
- const performCleanup = async () => {
208
- try {
209
- await bluebird_1.default.all([this._zippedReportPath, path_1.default.dirname(this._reportPath)]
210
- .filter(Boolean)
211
- .map((x) => support_1.fs.rimraf(x)));
212
- }
213
- catch (e) {
214
- this._logger.warn(e.message);
215
- }
216
- };
217
- if (this._archivePromise) {
218
- (async () => {
219
- try {
220
- await this._archivePromise;
221
- }
222
- catch {
223
- }
224
- finally {
225
- await performCleanup();
226
- this._archivePromise = null;
227
- }
228
- })();
229
- }
230
- await performCleanup();
231
- return '';
232
- }
233
182
  async start() {
234
183
  let binaryPath;
235
184
  try {
@@ -241,7 +190,7 @@ class PerfRecorder {
241
190
  binaryPath = await requireInstruments();
242
191
  }
243
192
  const args = [];
244
- const toolName = path_1.default.basename(binaryPath) === XCRUN ? XCTRACE : INSTRUMENTS;
193
+ const toolName = node_path_1.default.basename(binaryPath) === XCRUN ? XCTRACE : INSTRUMENTS;
245
194
  if (toolName === XCTRACE) {
246
195
  args.push(XCTRACE, 'record', '--device', this._udid, '--template', this._profileName, '--output', this._reportPath, '--time-limit', `${this._timeout}ms`);
247
196
  if (this._pid) {
@@ -323,8 +272,69 @@ class PerfRecorder {
323
272
  }
324
273
  return await this.getZippedReportPath();
325
274
  }
275
+ async getOriginalReportPath() {
276
+ return (await support_1.fs.exists(this._reportPath)) ? this._reportPath : '';
277
+ }
278
+ async _enforceTermination() {
279
+ if (this._process && this.isRunning()) {
280
+ this._logger.debug('Force-stopping the currently running perf recording');
281
+ try {
282
+ await this._process.stop('SIGKILL');
283
+ }
284
+ catch {
285
+ // Ignore errors
286
+ }
287
+ }
288
+ this._process = null;
289
+ const performCleanup = async () => {
290
+ try {
291
+ await bluebird_1.default.all([this._zippedReportPath, node_path_1.default.dirname(this._reportPath)]
292
+ .filter(Boolean)
293
+ .map((x) => support_1.fs.rimraf(x)));
294
+ }
295
+ catch (e) {
296
+ this._logger.warn(e.message);
297
+ }
298
+ };
299
+ if (this._archivePromise) {
300
+ (async () => {
301
+ try {
302
+ await this._archivePromise;
303
+ }
304
+ catch {
305
+ // Ignore errors
306
+ }
307
+ finally {
308
+ await performCleanup();
309
+ this._archivePromise = null;
310
+ }
311
+ })();
312
+ }
313
+ await performCleanup();
314
+ return '';
315
+ }
326
316
  }
327
317
  exports.PerfRecorder = PerfRecorder;
318
+ async function requireXctrace() {
319
+ const xcrunPath = await requireXcrun();
320
+ try {
321
+ await (0, teen_process_1.exec)(xcrunPath, [XCTRACE, 'help']);
322
+ }
323
+ catch (e) {
324
+ throw new Error(`${XCTRACE} is not available for the active Xcode version. ` +
325
+ `Please make sure XCode is up to date. Original error: ${e.stderr || e.message}`);
326
+ }
327
+ return xcrunPath;
328
+ }
329
+ async function requireInstruments() {
330
+ try {
331
+ return await support_1.fs.which(INSTRUMENTS);
332
+ }
333
+ catch {
334
+ throw new Error(`${INSTRUMENTS} has not been found in PATH. ` +
335
+ `Please make sure XCode development tools are installed`);
336
+ }
337
+ }
328
338
  async function requireXcrun() {
329
339
  try {
330
340
  return await support_1.fs.which(XCRUN);
@@ -334,7 +344,4 @@ async function requireXcrun() {
334
344
  `Please make sure XCode development tools are installed`);
335
345
  }
336
346
  }
337
- /**
338
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
339
- */
340
347
  //# sourceMappingURL=performance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"performance.js","sourceRoot":"","sources":["../../../lib/commands/performance.js"],"names":[],"mappings":";;;;;;AAyCA,sDAyCC;AAuBD,oDA+CC;AAxJD,oDAAuB;AACvB,gDAAwB;AACxB,4CAA8D;AAC9D,+CAA8C;AAC9C,oCAA8C;AAC9C,uCAA0C;AAC1C,wDAAyB;AAEzB,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAC5C,MAAM,4BAA4B,GAChC,oEAAoE;IACpE,+DAA+D,qBAAqB,IAAI;IACxF,uHAAuH,CAAC;AAC1H,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACzC,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACtC,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC;AACrC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAChD,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM,WAAW,GAAG,aAAa,CAAC;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AAC;AACH,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 {import('./types').StartRecordingScreenOptions} [options] - The available options.
11
- * @returns {Promise<string>} Base64-encoded content of the recorded media file if
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: import("../driver").XCUITestDriver, options?: import("./types").StartRecordingScreenOptions): Promise<string>;
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,50 +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 {import('./types').StopRecordingScreenOptions} options - The available
45
- * options.
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: import("../driver").XCUITestDriver, options?: import("./types").StopRecordingScreenOptions): Promise<string | null>;
54
- export class stopRecordingScreen {
55
- /**
56
- * Direct Appium to stop screen recording and return the video
57
- *
58
- * If no screen recording process is running then the endpoint will try to get
59
- * the recently recorded file. If no previously recorded file is found and no
60
- * active screen recording processes are running then the method returns an
61
- * empty string.
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: SubProcess<import("teen_process").SubProcessOptions> | null;
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 type XCUITestDriver = import("../driver").XCUITestDriver;
89
- import { SubProcess } from 'teen_process';
57
+ export {};
90
58
  //# sourceMappingURL=recordscreen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recordscreen.d.ts","sourceRoot":"","sources":["../../../lib/commands/recordscreen.js"],"names":[],"mappings":"AAoOA;;;;;;;;;;;;;;GAcG;AACH,yFANW,OAAO,SAAS,EAAE,2BAA2B,GAC3C,OAAO,CAAC,MAAM,CAAC,CA6G3B;;IAvHD;;;;;;;;;;;;;;OAcG;IACH,gEANW,OAAO,SAAS,EAAE,2BAA2B,EA8GvD;IA7DG,sCAAiC;;AA+DrC;;;;;;;;;;;;;;;;GAgBG;AACH,wFATW,OAAO,SAAS,EAAE,0BAA0B,GAE1C,OAAO,CAAC,MAAM,OAAC,CAAC,CA2B5B;;IArCD;;;;;;;;;;;;;;;;OAgBG;IACH,gEATW,OAAO,SAAS,EAAE,0BAA0B,EA6BtD;IAFG,2BAAiC;;AA3TrC;IACE,4DAOC;IANC,eAA0B;IAC1B,SAAc;IACd,SAAgB;IAChB,UAAgB;IAChB,yEAAuB;IACvB,sCAA0B;IAG5B,qCA8GC;IAED,6CAuBC;IAED,uBAGC;IAED,yBAIC;CACF;6BAmKY,OAAO,WAAW,EAAE,cAAc;2BAnYtB,cAAc"}
1
+ {"version":3,"file":"recordscreen.d.ts","sourceRoot":"","sources":["../../../lib/commands/recordscreen.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,cAAc,EAA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AM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -60,18 +60,24 @@ const HARDWARE_ACCELERATION_PARAMETERS = {
60
60
  hwaccel: 'qsv',
61
61
  hwaccelOutputFormat: '',
62
62
  scaleFilterHWAccel: 'scale_qsv',
63
- videoTypeHWAccel: 'h264_qsv'
63
+ 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(' ')}'. ` + `Will timeout in ${timeoutMs}ms`);
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 {import('./types').StartRecordingScreenOptions} [options] - The available options.
203
- * @returns {Promise<string>} Base64-encoded content of the recorded media file if
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 = mjpegServerScreenshotQuality !== quality ? quality : undefined;
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 {import('./types').StopRecordingScreenOptions} options - The available
296
- * options.
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