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.
- package/CHANGELOG.md +12 -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/general.d.ts +84 -80
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +66 -53
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/log.d.ts +42 -44
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +32 -53
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +1 -1
- package/build/lib/commands/navigation.d.ts.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/commands/xctest.d.ts +37 -37
- package/build/lib/commands/xctest.d.ts.map +1 -1
- package/build/lib/commands/xctest.js +38 -50
- package/build/lib/commands/xctest.js.map +1 -1
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +0 -2
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/app-management.ts +414 -0
- package/lib/commands/{general.js → general.ts} +101 -76
- package/lib/commands/{log.js → log.ts} +68 -68
- package/lib/commands/{performance.js → performance.ts} +133 -114
- package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
- package/lib/commands/{xctest.js → xctest.ts} +78 -71
- package/lib/execute-method-map.ts +0 -2
- package/npm-shrinkwrap.json +8 -8
- package/package.json +1 -1
- package/lib/commands/app-management.js +0 -346
|
@@ -24,14 +24,11 @@ const constants_1 = require("./bidi/constants");
|
|
|
24
24
|
const models_1 = require("./bidi/models");
|
|
25
25
|
/**
|
|
26
26
|
* Determines the websocket endpoint based on the `sessionId`
|
|
27
|
-
* @param {string} sessionId
|
|
28
|
-
* @returns {string}
|
|
29
27
|
*/
|
|
30
28
|
const WEBSOCKET_ENDPOINT = (sessionId) => `${driver_1.DEFAULT_WS_PATHNAME_PREFIX}/session/${sessionId}/appium/device/syslog`;
|
|
31
29
|
const COLOR_CODE_PATTERN = /\u001b\[(\d+(;\d+)*)?m/g; // eslint-disable-line no-control-regex
|
|
32
30
|
const GET_SERVER_LOGS_FEATURE = 'get_server_logs';
|
|
33
31
|
/**
|
|
34
|
-
* @type {import('@appium/types').LogDefRecord}
|
|
35
32
|
* @privateRemarks The return types for these getters should be specified
|
|
36
33
|
*/
|
|
37
34
|
const SUPPORTED_LOG_TYPES = {
|
|
@@ -57,9 +54,6 @@ const SUPPORTED_LOG_TYPES = {
|
|
|
57
54
|
},
|
|
58
55
|
server: {
|
|
59
56
|
description: 'Appium server logs',
|
|
60
|
-
/**
|
|
61
|
-
* @returns {import('./types').LogEntry[]}
|
|
62
|
-
*/
|
|
63
57
|
getter: (self) => {
|
|
64
58
|
self.assertFeatureEnabled(GET_SERVER_LOGS_FEATURE);
|
|
65
59
|
return self.log.unwrap().record.map(nativeLogEntryToSeleniumEntry);
|
|
@@ -73,10 +67,12 @@ const LOG_NAMES_TO_CAPABILITY_NAMES_MAP = {
|
|
|
73
67
|
};
|
|
74
68
|
exports.supportedLogTypes = SUPPORTED_LOG_TYPES;
|
|
75
69
|
/**
|
|
70
|
+
* Extracts logs of the specified type from the logs container.
|
|
76
71
|
*
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
79
|
-
* @
|
|
72
|
+
* @param logType - The type of log to extract
|
|
73
|
+
* @param logsContainer - Container holding log objects
|
|
74
|
+
* @returns The extracted logs
|
|
75
|
+
* @throws {Error} If logs are not available or the log type is not found
|
|
80
76
|
*/
|
|
81
77
|
async function extractLogs(logType, logsContainer = {}) {
|
|
82
78
|
// make sure that we have logs at all
|
|
@@ -96,7 +92,12 @@ async function extractLogs(logType, logsContainer = {}) {
|
|
|
96
92
|
throw new Error(`No logs of type '${logType}' found. Supported log types are: ${lodash_1.default.keys(SUPPORTED_LOG_TYPES)}.`);
|
|
97
93
|
}
|
|
98
94
|
/**
|
|
99
|
-
*
|
|
95
|
+
* Starts capturing iOS system logs.
|
|
96
|
+
*
|
|
97
|
+
* Initializes and starts capturing syslog and crashlog. Optionally starts Safari console and network logs
|
|
98
|
+
* if the corresponding capabilities are enabled.
|
|
99
|
+
*
|
|
100
|
+
* @returns `true` if syslog capture started successfully; `false` otherwise
|
|
100
101
|
*/
|
|
101
102
|
async function startLogCapture() {
|
|
102
103
|
this.logs = this.logs || {};
|
|
@@ -106,7 +107,7 @@ async function startLogCapture() {
|
|
|
106
107
|
}
|
|
107
108
|
if (lodash_1.default.isUndefined(this.logs.syslog)) {
|
|
108
109
|
[this.logs.crashlog,] = assignBiDiLogListener.bind(this)(new ios_crash_log_1.IOSCrashLog({
|
|
109
|
-
sim:
|
|
110
|
+
sim: this.device,
|
|
110
111
|
udid: this.isRealDevice() ? this.opts.udid : undefined,
|
|
111
112
|
log: this.log,
|
|
112
113
|
}), {
|
|
@@ -114,12 +115,12 @@ async function startLogCapture() {
|
|
|
114
115
|
});
|
|
115
116
|
[this.logs.syslog,] = assignBiDiLogListener.bind(this)(this.isRealDevice()
|
|
116
117
|
? new ios_device_log_1.IOSDeviceLog({
|
|
117
|
-
udid:
|
|
118
|
+
udid: this.opts.udid,
|
|
118
119
|
showLogs: this.opts.showIOSLog,
|
|
119
120
|
log: this.log,
|
|
120
121
|
})
|
|
121
122
|
: new ios_simulator_log_1.IOSSimulatorLog({
|
|
122
|
-
sim:
|
|
123
|
+
sim: this.device,
|
|
123
124
|
showLogs: this.opts.showIOSLog,
|
|
124
125
|
iosSimulatorLogsPredicate: this.opts.iosSimulatorLogsPredicate,
|
|
125
126
|
simulatorLogLevel: this.opts.simulatorLogLevel,
|
|
@@ -153,7 +154,6 @@ async function startLogCapture() {
|
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
let didStartSyslog = false;
|
|
156
|
-
/** @type {Promise[]} */
|
|
157
157
|
const promises = [
|
|
158
158
|
(async () => {
|
|
159
159
|
try {
|
|
@@ -174,18 +174,16 @@ async function startLogCapture() {
|
|
|
174
174
|
/**
|
|
175
175
|
* Starts an iOS system logs broadcast websocket.
|
|
176
176
|
*
|
|
177
|
-
* The websocket listens on the same host and port as Appium.
|
|
177
|
+
* The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
|
|
178
178
|
*
|
|
179
179
|
* If the websocket is already running, this command does nothing.
|
|
180
180
|
*
|
|
181
|
-
* Each connected
|
|
181
|
+
* Each connected websocket listener will receive syslog lines as soon as they are visible to Appium.
|
|
182
182
|
* @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
|
|
183
|
-
* @returns {Promise<void>}
|
|
184
|
-
* @this {XCUITestDriver}
|
|
185
183
|
*/
|
|
186
184
|
async function mobileStartLogsBroadcast() {
|
|
187
|
-
const pathname = WEBSOCKET_ENDPOINT(
|
|
188
|
-
if (!lodash_1.default.isEmpty(await
|
|
185
|
+
const pathname = WEBSOCKET_ENDPOINT(this.sessionId);
|
|
186
|
+
if (!lodash_1.default.isEmpty(await this.server.getWebSocketHandlers(pathname))) {
|
|
189
187
|
this.log.debug(`The system logs broadcasting web socket server is already listening at ${pathname}`);
|
|
190
188
|
return;
|
|
191
189
|
}
|
|
@@ -227,61 +225,42 @@ async function mobileStartLogsBroadcast() {
|
|
|
227
225
|
this.log.debug(closeMsg);
|
|
228
226
|
});
|
|
229
227
|
});
|
|
230
|
-
await
|
|
231
|
-
/** @type {import('@appium/types').WSServer} */ (wss));
|
|
228
|
+
await this.server.addWebSocketHandler(pathname, wss);
|
|
232
229
|
}
|
|
233
230
|
/**
|
|
234
|
-
* Stops the syslog broadcasting
|
|
231
|
+
* Stops the syslog broadcasting websocket server previously started by `mobile: startLogsBroadcast`.
|
|
232
|
+
*
|
|
235
233
|
* If no websocket server is running, this command does nothing.
|
|
236
|
-
* @this {XCUITestDriver}
|
|
237
|
-
* @returns {Promise<void>}
|
|
238
234
|
*/
|
|
239
235
|
async function mobileStopLogsBroadcast() {
|
|
240
|
-
const pathname = WEBSOCKET_ENDPOINT(
|
|
241
|
-
if (lodash_1.default.isEmpty(await
|
|
236
|
+
const pathname = WEBSOCKET_ENDPOINT(this.sessionId);
|
|
237
|
+
if (lodash_1.default.isEmpty(await this.server.getWebSocketHandlers(pathname))) {
|
|
242
238
|
return;
|
|
243
239
|
}
|
|
244
240
|
this.log.debug('Stopping the system logs broadcasting web socket server');
|
|
245
|
-
await
|
|
241
|
+
await this.server.removeWebSocketHandler(pathname);
|
|
246
242
|
}
|
|
247
243
|
/**
|
|
244
|
+
* Assigns a BiDi log listener to the given log emitter.
|
|
245
|
+
*
|
|
248
246
|
* https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
|
|
249
247
|
*
|
|
250
|
-
* @template
|
|
251
|
-
* @
|
|
252
|
-
* @param
|
|
253
|
-
* @
|
|
254
|
-
* @returns {[EE, import('./types').LogListener]}
|
|
248
|
+
* @template EE extends EventEmitter
|
|
249
|
+
* @param logEmitter - The event emitter to attach the listener to
|
|
250
|
+
* @param properties - Configuration for the BiDi listener
|
|
251
|
+
* @returns A tuple containing the log emitter and the listener function
|
|
255
252
|
*/
|
|
256
253
|
function assignBiDiLogListener(logEmitter, properties) {
|
|
257
254
|
const { type, context = utils_1.NATIVE_WIN, srcEventName = 'output', entryTransformer, } = properties;
|
|
258
|
-
const listener = (
|
|
255
|
+
const listener = (logEntry) => {
|
|
259
256
|
const finalEntry = entryTransformer ? entryTransformer(logEntry) : logEntry;
|
|
260
257
|
this.eventEmitter.emit(constants_1.BIDI_EVENT_NAME, (0, models_1.makeLogEntryAddedEvent)(finalEntry, context, type));
|
|
261
258
|
};
|
|
262
259
|
logEmitter.on(srcEventName, listener);
|
|
263
260
|
return [logEmitter, listener];
|
|
264
261
|
}
|
|
265
|
-
/**
|
|
266
|
-
*
|
|
267
|
-
* @param {Object} x
|
|
268
|
-
* @returns {import('./types').LogEntry}
|
|
269
|
-
*/
|
|
270
262
|
function nativeLogEntryToSeleniumEntry(x) {
|
|
271
263
|
const msg = lodash_1.default.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`;
|
|
272
|
-
return (0, helpers_1.toLogEntry)(lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''),
|
|
273
|
-
/** @type {any} */ (x).timestamp ?? Date.now());
|
|
264
|
+
return (0, helpers_1.toLogEntry)(lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''), x.timestamp ?? Date.now());
|
|
274
265
|
}
|
|
275
|
-
/**
|
|
276
|
-
* @typedef {import('../driver').XCUITestDriver} XCUITestDriver
|
|
277
|
-
* @typedef {keyof typeof SUPPORTED_LOG_TYPES} XCUITestDriverLogTypes
|
|
278
|
-
* @typedef {import('@appium/types').AppiumServer} AppiumServer
|
|
279
|
-
*/
|
|
280
|
-
/**
|
|
281
|
-
* @typedef {Object} BiDiListenerProperties
|
|
282
|
-
* @property {string} type
|
|
283
|
-
* @property {string} [srcEventName='output']
|
|
284
|
-
* @property {string} [context=NATIVE_WIN]
|
|
285
|
-
* @property {(x: Object) => import('./types').LogEntry} [entryTransformer]
|
|
286
|
-
*/
|
|
287
266
|
//# sourceMappingURL=log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../lib/commands/log.
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../lib/commands/log.ts"],"names":[],"mappings":";;;;;;AAqFA,kCAyBC;AAUD,0CAoFC;AAYD,4DAyDC;AAOD,0DAQ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C,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC5E,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,2BAAe,EAAE,IAAA,+BAAsB,EAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7F,CAAC,CAAC;IACF,UAAU,CAAC,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACtC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,6BAA6B,CAAC,CAAM;IAC3C,MAAM,GAAG,GAAG,gBAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3E,OAAO,IAAA,oBAAU,EACf,gBAAC,CAAC,OAAO,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE,CAAC,EACtC,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,CAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -27,7 +27,7 @@ export function mobileDeepLink(this: import("../driver").XCUITestDriver, url: st
|
|
|
27
27
|
/**
|
|
28
28
|
* @this {XCUITestDriver}
|
|
29
29
|
*/
|
|
30
|
-
export function nativeBack(this: import("../driver").XCUITestDriver): Promise<
|
|
30
|
+
export function nativeBack(this: import("../driver").XCUITestDriver): Promise<void>;
|
|
31
31
|
export type XCUITestDriver = import("../driver").XCUITestDriver;
|
|
32
32
|
export type DeepLinkOptions = {
|
|
33
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":"AAQA;;GAEG;AACH,8EAMC;AAED;;GAEG;AACH,iFAIC;AAED;;GAEG;AACH,oFAsBC;AAED;;;;;;;;;;;;GAYG;AACH,8EAPW,MAAM,aACN,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CASzB;AAED;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":"AAQA;;GAEG;AACH,8EAMC;AAED;;GAEG;AACH,iFAIC;AAED;;GAEG;AACH,oFAsBC;AAED;;;;;;;;;;;;GAYG;AACH,8EAPW,MAAM,aACN,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CASzB;AAED;;GAEG;AACH,oFAwCC;6BAGY,OAAO,WAAW,EAAE,cAAc;;;;;SAKjC,MAAM;;;;;;cACN,MAAM,OAAC"}
|
|
@@ -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,EAA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