appium-xcuitest-driver 7.35.0 → 7.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/lib/commands/appearance.js +1 -1
- package/build/lib/commands/appearance.js.map +1 -1
- package/build/lib/commands/certificate.js +3 -3
- package/build/lib/commands/certificate.js.map +1 -1
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +3 -5
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +0 -1
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +1 -2
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +0 -2
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/gesture.d.ts.map +1 -1
- package/build/lib/commands/gesture.js +0 -1
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/commands/keyboard.js +1 -1
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/log.js +4 -4
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/navigation.js +1 -1
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +15 -12
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/record-audio.js +2 -2
- package/build/lib/commands/record-audio.js.map +1 -1
- package/build/lib/commands/recordscreen.js +6 -6
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/web.d.ts.map +1 -1
- package/build/lib/commands/web.js +39 -7
- package/build/lib/commands/web.js.map +1 -1
- package/build/lib/commands/xctest.d.ts.map +1 -1
- package/build/lib/commands/xctest.js +4 -2
- package/build/lib/commands/xctest.js.map +1 -1
- package/build/lib/device-connections-factory.js +2 -2
- package/build/lib/device-connections-factory.js.map +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts +1 -1
- package/build/lib/device-log/ios-crash-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-crash-log.js +2 -3
- package/build/lib/device-log/ios-crash-log.js.map +1 -1
- package/build/lib/device-log/ios-device-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-device-log.js +0 -1
- package/build/lib/device-log/ios-device-log.js.map +1 -1
- package/build/lib/device-log/ios-log.d.ts.map +1 -1
- package/build/lib/device-log/ios-log.js +0 -1
- package/build/lib/device-log/ios-log.js.map +1 -1
- package/build/lib/device-log/ios-simulator-log.js +1 -1
- package/build/lib/device-log/ios-simulator-log.js.map +1 -1
- package/build/lib/device-log/safari-console-log.d.ts +1 -1
- package/build/lib/device-log/safari-console-log.d.ts.map +1 -1
- package/build/lib/device-log/safari-console-log.js +2 -2
- package/build/lib/device-log/safari-console-log.js.map +1 -1
- package/build/lib/doctor/optional-checks.d.ts.map +1 -1
- package/build/lib/doctor/optional-checks.js +0 -1
- package/build/lib/doctor/optional-checks.js.map +1 -1
- package/build/lib/doctor/required-checks.d.ts.map +1 -1
- package/build/lib/doctor/required-checks.js +0 -1
- package/build/lib/doctor/required-checks.js.map +1 -1
- package/build/lib/doctor/utils.js +1 -1
- package/build/lib/doctor/utils.js.map +1 -1
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +5 -6
- package/build/lib/driver.js.map +1 -1
- package/build/lib/ios-fs-helpers.js +39 -6
- package/build/lib/ios-fs-helpers.js.map +1 -1
- package/build/lib/real-device-clients/py-ios-device-client.js +1 -1
- package/build/lib/real-device-clients/py-ios-device-client.js.map +1 -1
- package/build/lib/real-device.js +35 -2
- package/build/lib/real-device.js.map +1 -1
- package/build/lib/simulator-management.js +6 -6
- package/build/lib/simulator-management.js.map +1 -1
- package/build/lib/utils.js +43 -10
- package/build/lib/utils.js.map +1 -1
- package/build/lib/xcrun.js +1 -1
- package/build/lib/xcrun.js.map +1 -1
- package/lib/commands/appearance.js +1 -1
- package/lib/commands/certificate.js +3 -3
- package/lib/commands/context.js +2 -4
- package/lib/commands/execute.js +0 -1
- package/lib/commands/find.js +1 -2
- package/lib/commands/general.js +0 -2
- package/lib/commands/gesture.js +0 -1
- package/lib/commands/keyboard.js +1 -1
- package/lib/commands/log.js +2 -2
- package/lib/commands/navigation.js +1 -1
- package/lib/commands/performance.js +11 -10
- package/lib/commands/record-audio.js +2 -2
- package/lib/commands/recordscreen.js +4 -4
- package/lib/commands/web.js +5 -6
- package/lib/commands/xctest.js +4 -3
- package/lib/device-connections-factory.js +2 -2
- package/lib/device-log/ios-crash-log.ts +1 -2
- package/lib/device-log/ios-device-log.ts +0 -1
- package/lib/device-log/ios-log.ts +0 -1
- package/lib/device-log/ios-simulator-log.ts +1 -1
- package/lib/device-log/safari-console-log.ts +1 -1
- package/lib/doctor/optional-checks.js +0 -1
- package/lib/doctor/required-checks.js +0 -1
- package/lib/doctor/utils.js +1 -1
- package/lib/driver.js +3 -4
- package/lib/ios-fs-helpers.js +6 -6
- package/lib/real-device-clients/py-ios-device-client.ts +1 -1
- package/lib/real-device.js +2 -2
- package/lib/simulator-management.js +3 -3
- package/lib/utils.js +7 -7
- package/lib/xcrun.js +1 -1
- package/npm-shrinkwrap.json +189 -139
- package/package.json +2 -2
package/lib/doctor/utils.js
CHANGED
package/lib/driver.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from './app-utils';
|
|
21
21
|
import commands from './commands';
|
|
22
22
|
import {desiredCapConstraints} from './desired-caps';
|
|
23
|
-
import DEVICE_CONNECTIONS_FACTORY from './device-connections-factory';
|
|
23
|
+
import {DEVICE_CONNECTIONS_FACTORY} from './device-connections-factory';
|
|
24
24
|
import {executeMethodMap} from './execute-method-map';
|
|
25
25
|
import {newMethodMap} from './method-map';
|
|
26
26
|
import { Pyidevice } from './real-device-clients/py-ios-device-client';
|
|
@@ -856,7 +856,7 @@ export class XCUITestDriver extends BaseDriver {
|
|
|
856
856
|
// In case the bundle id process start got failed because of
|
|
857
857
|
// auth popup in the device. Then, the bundle id process itself started. It is safe to stop it here.
|
|
858
858
|
await this.mobileKillApp(this.wda.bundleIdForXctest);
|
|
859
|
-
} catch
|
|
859
|
+
} catch {};
|
|
860
860
|
// Mostly it failed to start the WDA process as no the bundle id
|
|
861
861
|
// e.g. '<bundle id of WDA> not found on device <udid>'
|
|
862
862
|
|
|
@@ -983,7 +983,7 @@ export class XCUITestDriver extends BaseDriver {
|
|
|
983
983
|
if (shouldResetLocationServivce) {
|
|
984
984
|
try {
|
|
985
985
|
await this.mobileResetLocationService();
|
|
986
|
-
} catch
|
|
986
|
+
} catch {
|
|
987
987
|
/* Ignore this error since mobileResetLocationService already logged the error */
|
|
988
988
|
}
|
|
989
989
|
}
|
|
@@ -1694,7 +1694,6 @@ export class XCUITestDriver extends BaseDriver {
|
|
|
1694
1694
|
/**
|
|
1695
1695
|
* Reset the current session (run the delete session and create session subroutines)
|
|
1696
1696
|
*/
|
|
1697
|
-
// eslint-disable-next-line require-await
|
|
1698
1697
|
async reset() {
|
|
1699
1698
|
throw new Error(
|
|
1700
1699
|
`The reset API has been deprecated and is not supported anymore. ` +
|
package/lib/ios-fs-helpers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import B from 'bluebird';
|
|
2
|
+
import B, {TimeoutError} from 'bluebird';
|
|
3
3
|
import {fs, tempDir, mkdirp, zip, util, timing} from 'appium/support';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import log from './logger';
|
|
@@ -38,7 +38,7 @@ export async function pullFile(afcService, remotePath) {
|
|
|
38
38
|
async function folderExists(folderPath) {
|
|
39
39
|
try {
|
|
40
40
|
return (await fs.stat(folderPath)).isDirectory();
|
|
41
|
-
} catch
|
|
41
|
+
} catch {
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -137,7 +137,7 @@ async function remoteMkdirp(afcService, remoteRoot) {
|
|
|
137
137
|
try {
|
|
138
138
|
await afcService.listDirectory(remoteRoot);
|
|
139
139
|
return;
|
|
140
|
-
} catch
|
|
140
|
+
} catch {
|
|
141
141
|
// This means that the directory is missing and we got an object not found error.
|
|
142
142
|
// Therefore, we are going to the parent
|
|
143
143
|
await remoteMkdirp(afcService, path.dirname(remoteRoot));
|
|
@@ -261,7 +261,7 @@ export async function pushFolder(afcService, srcRootPath, dstRootPath, opts = {}
|
|
|
261
261
|
// create the folder structure first
|
|
262
262
|
try {
|
|
263
263
|
await afcService.deleteDirectory(dstRootPath);
|
|
264
|
-
} catch
|
|
264
|
+
} catch {}
|
|
265
265
|
await afcService.createDirectory(dstRootPath);
|
|
266
266
|
for (const relativeFolderPath of foldersToPush) {
|
|
267
267
|
// createDirectory does not accept folder names ending with a path separator
|
|
@@ -315,7 +315,7 @@ export async function pushFolder(afcService, srcRootPath, dstRootPath, opts = {}
|
|
|
315
315
|
await B.any(pushPromises);
|
|
316
316
|
const elapsedMs = timer.getDuration().asMilliSeconds;
|
|
317
317
|
if (elapsedMs > timeoutMs) {
|
|
318
|
-
throw new
|
|
318
|
+
throw new TimeoutError(`Timed out after ${elapsedMs} ms`);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
_.remove(pushPromises, (p) => p.isFulfilled());
|
|
@@ -330,7 +330,7 @@ export async function pushFolder(afcService, srcRootPath, dstRootPath, opts = {}
|
|
|
330
330
|
await _pushFile(relativeFilePath);
|
|
331
331
|
const elapsedMs = timer.getDuration().asMilliSeconds;
|
|
332
332
|
if (elapsedMs > timeoutMs) {
|
|
333
|
-
throw new
|
|
333
|
+
throw new TimeoutError(`Timed out after ${elapsedMs} ms`);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
}
|
package/lib/real-device.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {timing, util, fs} from 'appium/support';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import {services, utilities, INSTRUMENT_CHANNEL} from 'appium-ios-device';
|
|
4
|
-
import B from 'bluebird';
|
|
4
|
+
import B, {TimeoutError} from 'bluebird';
|
|
5
5
|
import defaultLogger from './logger';
|
|
6
6
|
import _ from 'lodash';
|
|
7
7
|
import {SAFARI_BUNDLE_ID} from './app-utils';
|
|
@@ -104,7 +104,7 @@ export class RealDevice {
|
|
|
104
104
|
} catch (err) {
|
|
105
105
|
this.log.debug(err.stack);
|
|
106
106
|
let errMessage = `Cannot install the ${bundleId} application`;
|
|
107
|
-
if (err instanceof
|
|
107
|
+
if (err instanceof TimeoutError) {
|
|
108
108
|
errMessage += `. Consider increasing the value of 'appPushTimeout' capability (the current value equals to ${timeoutMs}ms)`;
|
|
109
109
|
}
|
|
110
110
|
errMessage += `. Original error: ${err.message}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {getSimulator} from 'appium-ios-simulator';
|
|
2
|
-
import Simctl from 'node-simctl';
|
|
2
|
+
import {Simctl} from 'node-simctl';
|
|
3
3
|
import {resetTestProcesses} from 'appium-webdriveragent';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import {util, timing} from 'appium/support';
|
|
@@ -24,7 +24,7 @@ export async function createSim() {
|
|
|
24
24
|
deviceNames = (await simctl
|
|
25
25
|
.getDevices(platformVersion, platform))
|
|
26
26
|
.map(({deviceName}) => deviceName);
|
|
27
|
-
} catch
|
|
27
|
+
} catch {}
|
|
28
28
|
throw new Error(
|
|
29
29
|
`'deviceName' must be provided in order to create a new Simulator for ${platform} platform. ` +
|
|
30
30
|
`Currently available device names: ${deviceNames}`,
|
|
@@ -179,7 +179,7 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
|
|
|
179
179
|
// Terminate the app under test if it is still running on Simulator
|
|
180
180
|
try {
|
|
181
181
|
await device.terminateApp(bundleId);
|
|
182
|
-
} catch
|
|
182
|
+
} catch {
|
|
183
183
|
this.log.warn(`Reset: failed to terminate Simulator application with id "${bundleId}"`);
|
|
184
184
|
}
|
|
185
185
|
|
package/lib/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import xcode from 'appium-xcode';
|
|
1
|
+
import * as xcode from 'appium-xcode';
|
|
2
2
|
import {errors} from 'appium/driver';
|
|
3
3
|
import {fs, net, util} from 'appium/support';
|
|
4
4
|
import B from 'bluebird';
|
|
@@ -6,7 +6,7 @@ import _ from 'lodash';
|
|
|
6
6
|
import os from 'node:os';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import url from 'node:url';
|
|
9
|
-
import semver from 'semver';
|
|
9
|
+
import * as semver from 'semver';
|
|
10
10
|
import {exec} from 'teen_process';
|
|
11
11
|
import iosGenericSimulators from './ios-generic-simulators';
|
|
12
12
|
import log from './logger';
|
|
@@ -123,7 +123,7 @@ async function clearLogs(locations) {
|
|
|
123
123
|
try {
|
|
124
124
|
const {stdout} = await exec('du', ['-sh', location]);
|
|
125
125
|
size = stdout.trim().split(/\s+/)[0];
|
|
126
|
-
} catch
|
|
126
|
+
} catch {}
|
|
127
127
|
try {
|
|
128
128
|
log.debug(`Deleting '${location}'. ${size ? `Freeing ${size}.` : ''}`);
|
|
129
129
|
await fs.rimraf(location);
|
|
@@ -248,7 +248,7 @@ const getModuleManifest = _.memoize(async function getModuleManifest() {
|
|
|
248
248
|
return manifest;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
} catch
|
|
251
|
+
} catch {}
|
|
252
252
|
currentDir = path.dirname(currentDir);
|
|
253
253
|
isAtFsRoot = currentDir.length <= path.dirname(currentDir).length;
|
|
254
254
|
}
|
|
@@ -294,7 +294,7 @@ function normalizeCommandTimeouts(value) {
|
|
|
294
294
|
if (!_.isPlainObject(result)) {
|
|
295
295
|
throw new Error();
|
|
296
296
|
}
|
|
297
|
-
} catch
|
|
297
|
+
} catch {
|
|
298
298
|
throw log.errorWithException(
|
|
299
299
|
`"commandTimeouts" capability should be a valid JSON object. "${value}" was given instead`,
|
|
300
300
|
);
|
|
@@ -337,7 +337,7 @@ async function getPIDsListeningOnPort(port, filteringFunc = null) {
|
|
|
337
337
|
// This only works since Mac OS X El Capitan
|
|
338
338
|
const {stdout} = await exec('lsof', ['-ti', `tcp:${port}`]);
|
|
339
339
|
result.push(...stdout.trim().split(/\n+/));
|
|
340
|
-
} catch
|
|
340
|
+
} catch {
|
|
341
341
|
return result;
|
|
342
342
|
}
|
|
343
343
|
|
|
@@ -428,7 +428,7 @@ function isLocalHost(urlString) {
|
|
|
428
428
|
try {
|
|
429
429
|
const hostname = /** @type {string} */ (url.parse(urlString).hostname);
|
|
430
430
|
return ['localhost', '127.0.0.1', '::1', '::ffff:127.0.0.1'].includes(hostname);
|
|
431
|
-
} catch
|
|
431
|
+
} catch {
|
|
432
432
|
log.warn(`'${urlString}' cannot be parsed as a valid URL`);
|
|
433
433
|
}
|
|
434
434
|
return false;
|
package/lib/xcrun.js
CHANGED