appium-xcuitest-driver 10.13.2 → 10.13.3
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 +6 -0
- 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/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/recordscreen.d.ts +31 -63
- 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/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +0 -1
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/app-management.ts +414 -0
- package/lib/commands/{performance.js → performance.ts} +133 -114
- package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
- package/lib/execute-method-map.ts +0 -1
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
- package/lib/commands/app-management.js +0 -346
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { XCUITestDriver } from '../driver';
|
|
2
|
+
import type { Method } from 'axios';
|
|
1
3
|
/**
|
|
2
4
|
* Starts performance profiling for the device under test.
|
|
3
5
|
*
|
|
@@ -11,34 +13,11 @@
|
|
|
11
13
|
*
|
|
12
14
|
* Read [Recording, Pausing, and Stopping Traces](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html) for more details.
|
|
13
15
|
*
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @this {XCUITestDriver}
|
|
16
|
+
* @param timeout - The maximum count of milliseconds to record the profiling information.
|
|
17
|
+
* @param profileName - The name of existing performance profile to apply. Can also contain the full path to the chosen template on the server file system. Note: not all profiles are supported on mobile devices.
|
|
18
|
+
* @param pid - The ID of the process to measure the performance for. Set it to `current` in order to measure the performance of the process, which belongs to the currently active application. All processes running on the device are measured if `pid` is unset (the default setting).
|
|
18
19
|
*/
|
|
19
|
-
export function mobileStartPerfRecord(this:
|
|
20
|
-
export class mobileStartPerfRecord {
|
|
21
|
-
/**
|
|
22
|
-
* Starts performance profiling for the device under test.
|
|
23
|
-
*
|
|
24
|
-
* Relaxing security is mandatory for simulators. It can always work for real devices.
|
|
25
|
-
*
|
|
26
|
-
* Since XCode 12 the method tries to use `xctrace` tool to record performance stats.
|
|
27
|
-
*
|
|
28
|
-
* The `instruments` developer utility is used as a fallback for this purpose if `xctrace` is not available.
|
|
29
|
-
*
|
|
30
|
-
* It is possible to record multiple profiles at the same time.
|
|
31
|
-
*
|
|
32
|
-
* Read [Recording, Pausing, and Stopping Traces](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html) for more details.
|
|
33
|
-
*
|
|
34
|
-
* @param {number} timeout - The maximum count of milliseconds to record the profiling information.
|
|
35
|
-
* @param {string} profileName - The name of existing performance profile to apply. Can also contain the full path to the chosen template on the server file system. Note: not all profiles are supported on mobile devices.
|
|
36
|
-
* @param {number|'current'} [pid] - The ID of the process to measure the performance for. Set it to `current` in order to measure the performance of the process, which belongs to the currently active application. All processes running on the device are measured if `pid` is unset (the default setting).
|
|
37
|
-
* @this {XCUITestDriver}
|
|
38
|
-
*/
|
|
39
|
-
constructor(this: import("../driver").XCUITestDriver, timeout?: number, profileName?: string, pid?: number | "current");
|
|
40
|
-
_perfRecorders: PerfRecorder[] | undefined;
|
|
41
|
-
}
|
|
20
|
+
export declare function mobileStartPerfRecord(this: XCUITestDriver, timeout?: number, profileName?: string, pid?: number | 'current'): Promise<void>;
|
|
42
21
|
/**
|
|
43
22
|
* Stops performance recording operation previously started by {@linkcode XCUITestDriver.mobileStartPerfRecord mobile: startPerfRecord}.
|
|
44
23
|
*
|
|
@@ -46,40 +25,42 @@ export class mobileStartPerfRecord {
|
|
|
46
25
|
*
|
|
47
26
|
* The resulting file in `.trace` format can be either returned directly as base64-encoded zip archive or uploaded to a remote location (such files can be pretty large). Afterwards it is possible to unarchive and open such files with Xcode Dev Tools.
|
|
48
27
|
*
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
*
|
|
58
|
-
* @returns {Promise<string>} The resulting file in `.trace` format. This file can either be returned directly as base64-encoded `.zip` archive or uploaded to a remote location (note that such files may be large), _depending on the `remotePath` argument value._ Thereafter, the file may be unarchived and opened with Xcode Developer Tools.
|
|
28
|
+
* @param remotePath - The path to the remote location, where the resulting zipped `.trace` file should be uploaded. The following protocols are supported: `http`, `https`, `ftp`. Null or empty string value (the default setting) means the content of resulting file should be zipped, encoded as Base64 and passed as the endpoint response value. An exception will be thrown if the generated file is too big to fit into the available process memory.
|
|
29
|
+
* @param user - The name of the user for the remote authentication. Only works if `remotePath` is provided.
|
|
30
|
+
* @param pass - The password for the remote authentication. Only works if `remotePath` is provided.
|
|
31
|
+
* @param method - The http multipart upload method name. Only works if `remotePath` is provided. Defaults to `PUT`
|
|
32
|
+
* @param profileName - The name of existing performance profile to stop the recording for. Multiple recorders for different profile names could be executed at the same time.
|
|
33
|
+
* @param headers - Additional headers mapping for multipart http(s) uploads
|
|
34
|
+
* @param fileFieldName - The name of the form field, where the file content BLOB should be stored for http(s) uploads. Defaults to `file`
|
|
35
|
+
* @param formFields - Additional form fields for multipart http(s) uploads
|
|
36
|
+
* @returns The resulting file in `.trace` format. This file can either be returned directly as base64-encoded `.zip` archive or uploaded to a remote location (note that such files may be large), _depending on the `remotePath` argument value._ Thereafter, the file may be unarchived and opened with Xcode Developer Tools.
|
|
59
37
|
* @throws {Error} If no performance recording with given profile name/device udid combination
|
|
60
38
|
* has been started before or the resulting .trace file has not been generated properly.
|
|
61
|
-
* @this {XCUITestDriver}
|
|
62
39
|
*/
|
|
63
|
-
export function mobileStopPerfRecord(this:
|
|
64
|
-
export class PerfRecorder {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
get profileName(): any;
|
|
77
|
-
getOriginalReportPath(): Promise<string>;
|
|
40
|
+
export declare function mobileStopPerfRecord(this: XCUITestDriver, remotePath?: string, user?: string, pass?: string, method?: Method, profileName?: string, headers?: Record<string, any>, fileFieldName?: string, formFields?: Record<string, any> | [string, any][]): Promise<string>;
|
|
41
|
+
export declare class PerfRecorder {
|
|
42
|
+
private _process;
|
|
43
|
+
private _zippedReportPath;
|
|
44
|
+
private readonly _timeout;
|
|
45
|
+
private readonly _profileName;
|
|
46
|
+
private readonly _reportPath;
|
|
47
|
+
private readonly _pid;
|
|
48
|
+
private readonly _udid;
|
|
49
|
+
private readonly _logger;
|
|
50
|
+
private _archivePromise;
|
|
51
|
+
constructor(reportRoot: string, udid: string, opts?: PerfRecorderOptions);
|
|
52
|
+
get profileName(): string;
|
|
78
53
|
getZippedReportPath(): Promise<string>;
|
|
79
54
|
isRunning(): boolean;
|
|
80
|
-
_enforceTermination(): Promise<string>;
|
|
81
55
|
start(): Promise<void>;
|
|
82
56
|
stop(force?: boolean): Promise<string>;
|
|
57
|
+
private getOriginalReportPath;
|
|
58
|
+
private _enforceTermination;
|
|
59
|
+
}
|
|
60
|
+
interface PerfRecorderOptions {
|
|
61
|
+
timeout?: number;
|
|
62
|
+
profileName?: string;
|
|
63
|
+
pid?: number;
|
|
83
64
|
}
|
|
84
|
-
export
|
|
65
|
+
export {};
|
|
85
66
|
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../lib/commands/performance.
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../lib/commands/performance.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,OAAO,CAAC;AAiBlC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,SAAqB,EAC5B,WAAW,SAAuB,EAClC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,EACf,WAAW,SAAuB,EAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,aAAa,CAAC,EAAE,MAAM,EACtB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GACjD,OAAO,CAAC,MAAM,CAAC,CA2CjB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAM;IAC9B,OAAO,CAAC,eAAe,CAAyB;gBAEpC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,mBAAwB;IAiB5E,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC;IAwB5C,SAAS,IAAI,OAAO;IAId,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqGtB,IAAI,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;YAoB5B,qBAAqB;YAIrB,mBAAmB;CAoClC;AAqCD,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -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
|
|
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
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
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 =
|
|
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:
|
|
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
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
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
|
-
|
|
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 =
|
|
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:
|
|
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:
|
|
170
|
+
cwd: node_path_1.default.dirname(this._reportPath),
|
|
187
171
|
});
|
|
188
|
-
await support_1.fs.rimraf(
|
|
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 =
|
|
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,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,UAAU,YAAY;IACzB,IAAI,CAAC;QACH,OAAO,MAAM,YAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,+BAA+B;YACrC,wDAAwD,CAC3D,CAAC;IACJ,CAAC;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
|
|
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,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
|
|
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: 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
|
|
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.
|
|
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,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,cAAc,CAAwB;gBAElC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,qBAA0B;IASjF,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+GvC,SAAS,CAAC,KAAK,UAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAyB1C,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAK/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,MAAM,CAAC,CAyGjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoBxB;AAED,UAAU,qBAAqB;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,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