appium-xcuitest-driver 7.34.2 → 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.
Files changed (113) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/appearance.js +1 -1
  3. package/build/lib/commands/appearance.js.map +1 -1
  4. package/build/lib/commands/certificate.js +3 -3
  5. package/build/lib/commands/certificate.js.map +1 -1
  6. package/build/lib/commands/context.d.ts.map +1 -1
  7. package/build/lib/commands/context.js +3 -5
  8. package/build/lib/commands/context.js.map +1 -1
  9. package/build/lib/commands/execute.d.ts.map +1 -1
  10. package/build/lib/commands/execute.js +0 -1
  11. package/build/lib/commands/execute.js.map +1 -1
  12. package/build/lib/commands/find.d.ts.map +1 -1
  13. package/build/lib/commands/find.js +1 -2
  14. package/build/lib/commands/find.js.map +1 -1
  15. package/build/lib/commands/general.d.ts.map +1 -1
  16. package/build/lib/commands/general.js +0 -2
  17. package/build/lib/commands/general.js.map +1 -1
  18. package/build/lib/commands/gesture.d.ts.map +1 -1
  19. package/build/lib/commands/gesture.js +0 -1
  20. package/build/lib/commands/gesture.js.map +1 -1
  21. package/build/lib/commands/keyboard.js +1 -1
  22. package/build/lib/commands/keyboard.js.map +1 -1
  23. package/build/lib/commands/log.js +4 -4
  24. package/build/lib/commands/log.js.map +1 -1
  25. package/build/lib/commands/navigation.js +1 -1
  26. package/build/lib/commands/navigation.js.map +1 -1
  27. package/build/lib/commands/performance.d.ts.map +1 -1
  28. package/build/lib/commands/performance.js +15 -12
  29. package/build/lib/commands/performance.js.map +1 -1
  30. package/build/lib/commands/record-audio.js +2 -2
  31. package/build/lib/commands/record-audio.js.map +1 -1
  32. package/build/lib/commands/recordscreen.js +6 -6
  33. package/build/lib/commands/recordscreen.js.map +1 -1
  34. package/build/lib/commands/web.d.ts.map +1 -1
  35. package/build/lib/commands/web.js +39 -7
  36. package/build/lib/commands/web.js.map +1 -1
  37. package/build/lib/commands/xctest.d.ts.map +1 -1
  38. package/build/lib/commands/xctest.js +4 -2
  39. package/build/lib/commands/xctest.js.map +1 -1
  40. package/build/lib/device-connections-factory.js +2 -2
  41. package/build/lib/device-connections-factory.js.map +1 -1
  42. package/build/lib/device-log/ios-crash-log.d.ts +1 -1
  43. package/build/lib/device-log/ios-crash-log.d.ts.map +1 -1
  44. package/build/lib/device-log/ios-crash-log.js +2 -3
  45. package/build/lib/device-log/ios-crash-log.js.map +1 -1
  46. package/build/lib/device-log/ios-device-log.d.ts.map +1 -1
  47. package/build/lib/device-log/ios-device-log.js +0 -1
  48. package/build/lib/device-log/ios-device-log.js.map +1 -1
  49. package/build/lib/device-log/ios-log.d.ts.map +1 -1
  50. package/build/lib/device-log/ios-log.js +0 -1
  51. package/build/lib/device-log/ios-log.js.map +1 -1
  52. package/build/lib/device-log/ios-simulator-log.js +1 -1
  53. package/build/lib/device-log/ios-simulator-log.js.map +1 -1
  54. package/build/lib/device-log/safari-console-log.d.ts +1 -1
  55. package/build/lib/device-log/safari-console-log.d.ts.map +1 -1
  56. package/build/lib/device-log/safari-console-log.js +2 -2
  57. package/build/lib/device-log/safari-console-log.js.map +1 -1
  58. package/build/lib/doctor/optional-checks.d.ts.map +1 -1
  59. package/build/lib/doctor/optional-checks.js +0 -1
  60. package/build/lib/doctor/optional-checks.js.map +1 -1
  61. package/build/lib/doctor/required-checks.d.ts.map +1 -1
  62. package/build/lib/doctor/required-checks.js +0 -1
  63. package/build/lib/doctor/required-checks.js.map +1 -1
  64. package/build/lib/doctor/utils.js +1 -1
  65. package/build/lib/doctor/utils.js.map +1 -1
  66. package/build/lib/driver.d.ts.map +1 -1
  67. package/build/lib/driver.js +5 -6
  68. package/build/lib/driver.js.map +1 -1
  69. package/build/lib/ios-fs-helpers.js +39 -6
  70. package/build/lib/ios-fs-helpers.js.map +1 -1
  71. package/build/lib/real-device-clients/py-ios-device-client.js +1 -1
  72. package/build/lib/real-device-clients/py-ios-device-client.js.map +1 -1
  73. package/build/lib/real-device.js +35 -2
  74. package/build/lib/real-device.js.map +1 -1
  75. package/build/lib/simulator-management.js +6 -6
  76. package/build/lib/simulator-management.js.map +1 -1
  77. package/build/lib/utils.js +43 -10
  78. package/build/lib/utils.js.map +1 -1
  79. package/build/lib/xcrun.js +1 -1
  80. package/build/lib/xcrun.js.map +1 -1
  81. package/lib/commands/appearance.js +1 -1
  82. package/lib/commands/certificate.js +3 -3
  83. package/lib/commands/context.js +2 -4
  84. package/lib/commands/execute.js +0 -1
  85. package/lib/commands/find.js +1 -2
  86. package/lib/commands/general.js +0 -2
  87. package/lib/commands/gesture.js +0 -1
  88. package/lib/commands/keyboard.js +1 -1
  89. package/lib/commands/log.js +2 -2
  90. package/lib/commands/navigation.js +1 -1
  91. package/lib/commands/performance.js +11 -10
  92. package/lib/commands/record-audio.js +2 -2
  93. package/lib/commands/recordscreen.js +4 -4
  94. package/lib/commands/web.js +5 -6
  95. package/lib/commands/xctest.js +4 -3
  96. package/lib/device-connections-factory.js +2 -2
  97. package/lib/device-log/ios-crash-log.ts +1 -2
  98. package/lib/device-log/ios-device-log.ts +0 -1
  99. package/lib/device-log/ios-log.ts +0 -1
  100. package/lib/device-log/ios-simulator-log.ts +1 -1
  101. package/lib/device-log/safari-console-log.ts +1 -1
  102. package/lib/doctor/optional-checks.js +0 -1
  103. package/lib/doctor/required-checks.js +0 -1
  104. package/lib/doctor/utils.js +1 -1
  105. package/lib/driver.js +3 -4
  106. package/lib/ios-fs-helpers.js +6 -6
  107. package/lib/real-device-clients/py-ios-device-client.ts +1 -1
  108. package/lib/real-device.js +2 -2
  109. package/lib/simulator-management.js +3 -3
  110. package/lib/utils.js +7 -7
  111. package/lib/xcrun.js +1 -1
  112. package/npm-shrinkwrap.json +205 -152
  113. package/package.json +3 -3
@@ -1,4 +1,3 @@
1
- /* eslint-disable require-await */
2
1
  import {resolveExecutablePath} from './utils';
3
2
  import {doctor} from 'appium/support';
4
3
  import '@colors/colors';
@@ -1,4 +1,3 @@
1
- /* eslint-disable require-await */
2
1
  import {fs, doctor} from 'appium/support';
3
2
  import {exec} from 'teen_process';
4
3
  import { getPath as getXcodePath } from 'appium-xcode';
@@ -12,6 +12,6 @@ export async function resolveExecutablePath(cmd) {
12
12
  if (executablePath && (await fs.exists(executablePath))) {
13
13
  return executablePath;
14
14
  }
15
- } catch (err) {}
15
+ } catch {}
16
16
  return null;
17
17
  }
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 (ign) {};
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 (ignore) {
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. ` +
@@ -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 (e) {
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 (e) {
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 (ign) {}
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 B.TimeoutError(`Timed out after ${elapsedMs} ms`);
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 B.TimeoutError(`Timed out after ${elapsedMs} ms`);
333
+ throw new TimeoutError(`Timed out after ${elapsedMs} ms`);
334
334
  }
335
335
  }
336
336
  }
@@ -40,7 +40,7 @@ export class Pyidevice extends BaseDeviceClient {
40
40
  try {
41
41
  this._binaryPath = await fs.which(BINARY_NAME);
42
42
  return true;
43
- } catch (e) {
43
+ } catch {
44
44
  if (isStrict) {
45
45
  throw new Error(
46
46
  `${BINARY_NAME} binary cannot be found in PATH. ` +
@@ -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 B.TimeoutError) {
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 (ign) {}
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 (err) {
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 (ign) {}
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 (ign) {}
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 (err) {
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 (e) {
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 (ign) {
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
@@ -5,7 +5,7 @@ const XCRUN = 'xcrun';
5
5
  async function requireXcrun() {
6
6
  try {
7
7
  return await fs.which(XCRUN);
8
- } catch (e) {
8
+ } catch {
9
9
  throw new Error(
10
10
  `${XCRUN} has not been found in PATH. ` +
11
11
  `Please make sure XCode development tools are installed`,