appium-xcuitest-driver 7.6.1 → 7.7.0

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 (126) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/lib/commands/app-management.d.ts.map +1 -1
  3. package/build/lib/commands/app-management.js +9 -17
  4. package/build/lib/commands/app-management.js.map +1 -1
  5. package/build/lib/commands/appearance.d.ts.map +1 -1
  6. package/build/lib/commands/appearance.js +2 -4
  7. package/build/lib/commands/appearance.js.map +1 -1
  8. package/build/lib/commands/biometric.d.ts.map +1 -1
  9. package/build/lib/commands/biometric.js +3 -6
  10. package/build/lib/commands/biometric.js.map +1 -1
  11. package/build/lib/commands/certificate.d.ts +1 -1
  12. package/build/lib/commands/certificate.d.ts.map +1 -1
  13. package/build/lib/commands/certificate.js +3 -5
  14. package/build/lib/commands/certificate.js.map +1 -1
  15. package/build/lib/commands/condition.d.ts.map +1 -1
  16. package/build/lib/commands/condition.js +2 -4
  17. package/build/lib/commands/condition.js.map +1 -1
  18. package/build/lib/commands/context.d.ts.map +1 -1
  19. package/build/lib/commands/context.js +1 -2
  20. package/build/lib/commands/context.js.map +1 -1
  21. package/build/lib/commands/deviceInfo.d.ts.map +1 -1
  22. package/build/lib/commands/deviceInfo.js +1 -2
  23. package/build/lib/commands/deviceInfo.js.map +1 -1
  24. package/build/lib/commands/file-movement.d.ts.map +1 -1
  25. package/build/lib/commands/file-movement.js +14 -22
  26. package/build/lib/commands/file-movement.js.map +1 -1
  27. package/build/lib/commands/general.d.ts.map +1 -1
  28. package/build/lib/commands/general.js +1 -2
  29. package/build/lib/commands/general.js.map +1 -1
  30. package/build/lib/commands/gesture.d.ts.map +1 -1
  31. package/build/lib/commands/gesture.js +1 -2
  32. package/build/lib/commands/gesture.js.map +1 -1
  33. package/build/lib/commands/keychains.js +1 -2
  34. package/build/lib/commands/keychains.js.map +1 -1
  35. package/build/lib/commands/localization.d.ts.map +1 -1
  36. package/build/lib/commands/localization.js +1 -3
  37. package/build/lib/commands/localization.js.map +1 -1
  38. package/build/lib/commands/location.d.ts.map +1 -1
  39. package/build/lib/commands/location.js +1 -2
  40. package/build/lib/commands/location.js.map +1 -1
  41. package/build/lib/commands/log.d.ts.map +1 -1
  42. package/build/lib/commands/log.js +2 -4
  43. package/build/lib/commands/log.js.map +1 -1
  44. package/build/lib/commands/memory.d.ts.map +1 -1
  45. package/build/lib/commands/memory.js +2 -2
  46. package/build/lib/commands/memory.js.map +1 -1
  47. package/build/lib/commands/notifications.d.ts +1 -1
  48. package/build/lib/commands/notifications.d.ts.map +1 -1
  49. package/build/lib/commands/notifications.js +1 -2
  50. package/build/lib/commands/notifications.js.map +1 -1
  51. package/build/lib/commands/pasteboard.d.ts.map +1 -1
  52. package/build/lib/commands/pasteboard.js +2 -4
  53. package/build/lib/commands/pasteboard.js.map +1 -1
  54. package/build/lib/commands/pcap.d.ts.map +1 -1
  55. package/build/lib/commands/pcap.js +1 -2
  56. package/build/lib/commands/pcap.js.map +1 -1
  57. package/build/lib/commands/performance.d.ts.map +1 -1
  58. package/build/lib/commands/performance.js +4 -9
  59. package/build/lib/commands/performance.js.map +1 -1
  60. package/build/lib/commands/permissions.d.ts.map +1 -1
  61. package/build/lib/commands/permissions.js +2 -4
  62. package/build/lib/commands/permissions.js.map +1 -1
  63. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  64. package/build/lib/commands/recordscreen.js +1 -2
  65. package/build/lib/commands/recordscreen.js.map +1 -1
  66. package/build/lib/commands/screenshots.d.ts +3 -2
  67. package/build/lib/commands/screenshots.d.ts.map +1 -1
  68. package/build/lib/commands/screenshots.js +8 -3
  69. package/build/lib/commands/screenshots.js.map +1 -1
  70. package/build/lib/commands/web.d.ts.map +1 -1
  71. package/build/lib/commands/web.js +1 -2
  72. package/build/lib/commands/web.js.map +1 -1
  73. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
  74. package/build/lib/commands/xctest-record-screen.js +2 -4
  75. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  76. package/build/lib/commands/xctest.d.ts.map +1 -1
  77. package/build/lib/commands/xctest.js +2 -4
  78. package/build/lib/commands/xctest.js.map +1 -1
  79. package/build/lib/driver.d.ts +26 -8
  80. package/build/lib/driver.d.ts.map +1 -1
  81. package/build/lib/driver.js +75 -77
  82. package/build/lib/driver.js.map +1 -1
  83. package/build/lib/py-ios-device-client.d.ts +1 -1
  84. package/build/lib/real-device-management.d.ts +30 -27
  85. package/build/lib/real-device-management.d.ts.map +1 -1
  86. package/build/lib/real-device-management.js +34 -35
  87. package/build/lib/real-device-management.js.map +1 -1
  88. package/build/lib/real-device.d.ts +36 -9
  89. package/build/lib/real-device.d.ts.map +1 -1
  90. package/build/lib/real-device.js +46 -15
  91. package/build/lib/real-device.js.map +1 -1
  92. package/build/lib/simulator-management.d.ts +58 -68
  93. package/build/lib/simulator-management.d.ts.map +1 -1
  94. package/build/lib/simulator-management.js +74 -66
  95. package/build/lib/simulator-management.js.map +1 -1
  96. package/lib/commands/app-management.js +11 -18
  97. package/lib/commands/appearance.js +4 -4
  98. package/lib/commands/biometric.js +3 -6
  99. package/lib/commands/certificate.js +3 -5
  100. package/lib/commands/condition.js +2 -4
  101. package/lib/commands/context.js +1 -2
  102. package/lib/commands/deviceInfo.js +1 -2
  103. package/lib/commands/file-movement.js +14 -22
  104. package/lib/commands/general.js +1 -2
  105. package/lib/commands/gesture.js +1 -2
  106. package/lib/commands/keychains.js +2 -2
  107. package/lib/commands/localization.js +1 -4
  108. package/lib/commands/location.js +1 -2
  109. package/lib/commands/log.js +2 -4
  110. package/lib/commands/memory.js +2 -2
  111. package/lib/commands/notifications.js +1 -2
  112. package/lib/commands/pasteboard.js +4 -4
  113. package/lib/commands/pcap.js +1 -2
  114. package/lib/commands/performance.js +4 -8
  115. package/lib/commands/permissions.js +6 -4
  116. package/lib/commands/recordscreen.js +1 -2
  117. package/lib/commands/screenshots.js +8 -3
  118. package/lib/commands/web.js +1 -2
  119. package/lib/commands/xctest-record-screen.js +2 -4
  120. package/lib/commands/xctest.js +2 -4
  121. package/lib/driver.js +79 -78
  122. package/lib/real-device-management.js +37 -44
  123. package/lib/real-device.js +47 -17
  124. package/lib/simulator-management.js +83 -82
  125. package/npm-shrinkwrap.json +7 -29
  126. package/package.json +2 -2
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.setLocalizationPrefs = exports.setSafariPrefs = exports.shutdownOtherSimulators = exports.shutdownSimulator = exports.installToSimulator = exports.runSimulatorReset = exports.getExistingSim = exports.createSim = void 0;
6
+ exports.setLocalizationPrefs = exports.setSafariPrefs = exports.shutdownOtherSimulators = exports.installToSimulator = exports.runSimulatorReset = exports.shutdownSimulator = exports.getExistingSim = exports.createSim = void 0;
7
7
  const appium_ios_simulator_1 = require("appium-ios-simulator");
8
8
  const node_simctl_1 = __importDefault(require("node-simctl"));
9
9
  const appium_webdriveragent_1 = require("appium-webdriveragent");
10
10
  const lodash_1 = __importDefault(require("lodash"));
11
- const logger_1 = __importDefault(require("./logger"));
12
11
  const support_1 = require("appium/support");
13
12
  const utils_1 = require("./utils");
14
13
  const APPIUM_SIM_PREFIX = 'appiumTest';
@@ -20,22 +19,15 @@ const SAFARI_OPTS_ALIASES_MAP = /** @type {const} */ ({
20
19
  safariIgnoreFraudWarning: [['WarnAboutFraudulentWebsites'], (x) => Number(!x)],
21
20
  safariOpenLinksInBackground: [['OpenLinksInBackground'], (x) => Number(Boolean(x))],
22
21
  });
23
- /**
24
- * @typedef {Object} SimulatorCreationOptions
25
- * @property {string} deviceName - A name for the device
26
- * @property {string} platformVersion - The version of iOS to use
27
- * @property {string} [simulatorDevicesSetPath]
28
- * @property {string} [platformName]
29
- */
30
22
  /**
31
23
  * Create a new simulator with `appiumTest-` prefix and return the object.
32
24
  *
33
- * @param {Partial<SimulatorCreationOptions>} caps - Capability set by a user. The options available are:
25
+ * @this {import('./driver').XCUITestDriver}
34
26
  * @returns {Promise<object>} Simulator object associated with the udid passed in.
35
27
  */
36
- async function createSim(caps) {
37
- const { simulatorDevicesSetPath: devicesSetPath, deviceName, platformVersion } = caps;
38
- const platform = (0, utils_1.normalizePlatformName)(caps.platformName);
28
+ async function createSim() {
29
+ const { simulatorDevicesSetPath: devicesSetPath, deviceName, platformVersion } = this.opts;
30
+ const platform = (0, utils_1.normalizePlatformName)(this.opts.platformName);
39
31
  const simctl = new node_simctl_1.default({ devicesSetPath });
40
32
  if (!deviceName) {
41
33
  let deviceNames = 'none';
@@ -52,12 +44,13 @@ async function createSim(caps) {
52
44
  throw new Error(`'platformVersion' is required.`);
53
45
  }
54
46
  const simName = `${APPIUM_SIM_PREFIX}-${support_1.util.uuidV4().toUpperCase()}-${deviceName}`;
55
- logger_1.default.debug(`Creating a temporary Simulator device '${simName}'`);
47
+ this.log.debug(`Creating a temporary Simulator device '${simName}'`);
56
48
  const udid = await simctl.createDevice(simName, deviceName, platformVersion, { platform });
57
49
  return await (0, appium_ios_simulator_1.getSimulator)(udid, {
58
50
  platform,
59
51
  checkExistence: false,
60
52
  devicesSetPath,
53
+ logger: this.log,
61
54
  });
62
55
  }
63
56
  exports.createSim = createSim;
@@ -72,21 +65,22 @@ exports.createSim = createSim;
72
65
  /**
73
66
  * Get an existing simulator matching the provided capabilities.
74
67
  *
75
- * @param {SimulatorLookupOptions} opts
76
- * @returns {Promise<any|null>} The matched Simulator instance or `null` if no matching device is found.
68
+ * @this {import('./driver').XCUITestDriver}
69
+ * @returns {Promise<import('./driver').Simulator|null>} The matched Simulator instance or `null` if no matching device is found.
77
70
  */
78
- async function getExistingSim(opts = /** @type {SimulatorLookupOptions} */ ({})) {
79
- const { platformVersion, deviceName, udid, simulatorDevicesSetPath: devicesSetPath } = opts;
80
- const platform = (0, utils_1.normalizePlatformName)(opts.platformName);
71
+ async function getExistingSim() {
72
+ const { platformVersion, deviceName, udid, simulatorDevicesSetPath: devicesSetPath, platformName, } = this.opts;
73
+ const platform = (0, utils_1.normalizePlatformName)(platformName);
81
74
  const selectSim = async (/** @type {{ udid: string; platform: string; }} */ dev) => await (0, appium_ios_simulator_1.getSimulator)(dev.udid, {
82
75
  platform,
83
76
  checkExistence: false,
84
77
  devicesSetPath,
78
+ logger: this.log,
85
79
  });
86
80
  const simctl = new node_simctl_1.default({ devicesSetPath });
87
81
  let devicesMap;
88
82
  if (udid && lodash_1.default.toLower(udid) !== utils_1.UDID_AUTO) {
89
- logger_1.default.debug(`Looking for an existing Simulator with UDID '${udid}'`);
83
+ this.log.debug(`Looking for an existing Simulator with UDID '${udid}'`);
90
84
  devicesMap = await simctl.getDevices(null, platform);
91
85
  for (const device of lodash_1.default.flatMap(lodash_1.default.values(devicesMap))) {
92
86
  if (device.udid === udid) {
@@ -96,16 +90,16 @@ async function getExistingSim(opts = /** @type {SimulatorLookupOptions} */ ({}))
96
90
  return null;
97
91
  }
98
92
  if (!platformVersion) {
99
- logger_1.default.debug(`Provide 'platformVersion' capability if you prefer an existing Simulator to be selected`);
93
+ this.log.debug(`Provide 'platformVersion' capability if you prefer an existing Simulator to be selected`);
100
94
  return null;
101
95
  }
102
96
  const devices = devicesMap?.[platformVersion] ?? (await simctl.getDevices(platformVersion, platform));
103
- logger_1.default.debug(`Looking for an existing Simulator with platformName: ${platform}, ` +
97
+ this.log.debug(`Looking for an existing Simulator with platformName: ${platform}, ` +
104
98
  `platformVersion: ${platformVersion}, deviceName: ${deviceName}`);
105
99
  for (const device of devices) {
106
100
  if ((deviceName && device.name === deviceName) || !deviceName) {
107
101
  if (!deviceName) {
108
- logger_1.default.debug(`The 'deviceName' capability value is empty. ` +
102
+ this.log.debug(`The 'deviceName' capability value is empty. ` +
109
103
  `Selecting the first matching device '${device.name}' having the ` +
110
104
  `'platformVersion' set to ${platformVersion}`);
111
105
  }
@@ -115,34 +109,44 @@ async function getExistingSim(opts = /** @type {SimulatorLookupOptions} */ ({}))
115
109
  return null;
116
110
  }
117
111
  exports.getExistingSim = getExistingSim;
118
- async function shutdownSimulator(device) {
112
+ /**
113
+ * @this {import('./driver').XCUITestDriver}
114
+ */
115
+ async function shutdownSimulator() {
116
+ const device = /** @type {import('./driver').Simulator} */ (this.device);
119
117
  // stop XCTest processes if running to avoid unexpected side effects
120
118
  await (0, appium_webdriveragent_1.resetTestProcesses)(device.udid, true);
121
119
  await device.shutdown();
122
120
  }
123
121
  exports.shutdownSimulator = shutdownSimulator;
124
- async function runSimulatorReset(device, opts) {
125
- const { noReset, fullReset, keychainsExcludePatterns, keepKeyChains, bundleId, app, browserName, enforceSimulatorShutdown, } = opts;
122
+ /**
123
+ * @this {import('./driver').XCUITestDriver}
124
+ * @property {boolean} [enforceSimulatorShutdown=false]
125
+ * @returns {Promise<void>}
126
+ */
127
+ async function runSimulatorReset(enforceSimulatorShutdown = false) {
128
+ const { noReset, fullReset, keychainsExcludePatterns, keepKeyChains, bundleId, app, browserName, } = this.opts;
126
129
  if (noReset && !fullReset) {
127
130
  // noReset === true && fullReset === false
128
- logger_1.default.debug('Reset: noReset is on. Leaving simulator as is');
131
+ this.log.debug('Reset: noReset is on. Leaving simulator as is');
129
132
  return;
130
133
  }
131
- if (!device) {
132
- logger_1.default.debug('Reset: no device available. Skipping');
134
+ const device = /** @type {import('./driver').Simulator} */ (this.device);
135
+ if (!this.device) {
136
+ this.log.debug('Reset: no device available. Skipping');
133
137
  return;
134
138
  }
135
139
  if (fullReset) {
136
- logger_1.default.debug('Reset: fullReset is on. Cleaning simulator');
137
- await shutdownSimulator(device);
140
+ this.log.debug('Reset: fullReset is on. Cleaning simulator');
141
+ await shutdownSimulator.bind(this)();
138
142
  const isKeychainsBackupSuccessful = (keychainsExcludePatterns || keepKeyChains) && (await device.backupKeychains());
139
143
  await device.clean();
140
144
  if (isKeychainsBackupSuccessful) {
141
145
  await device.restoreKeychains(keychainsExcludePatterns || []);
142
- logger_1.default.info(`Successfully restored keychains after full reset`);
146
+ this.log.info(`Successfully restored keychains after full reset`);
143
147
  }
144
148
  else if (keychainsExcludePatterns || keepKeyChains) {
145
- logger_1.default.warn('Cannot restore keychains after full reset, because ' +
149
+ this.log.warn('Cannot restore keychains after full reset, because ' +
146
150
  'the backup operation did not succeed');
147
151
  }
148
152
  }
@@ -153,29 +157,29 @@ async function runSimulatorReset(device, opts) {
153
157
  await device.terminateApp(bundleId);
154
158
  }
155
159
  catch (err) {
156
- logger_1.default.warn(`Reset: failed to terminate Simulator application with id "${bundleId}"`);
160
+ this.log.warn(`Reset: failed to terminate Simulator application with id "${bundleId}"`);
157
161
  }
158
162
  if (app) {
159
- logger_1.default.info('Not scrubbing third party app in anticipation of uninstall');
163
+ this.log.info('Not scrubbing third party app in anticipation of uninstall');
160
164
  }
161
165
  else {
162
166
  const isSafari = lodash_1.default.toLower(browserName) === 'safari';
163
167
  try {
164
168
  if (isSafari) {
165
- await device.scrubSafari();
169
+ await device.scrubSafari(true);
166
170
  }
167
171
  else {
168
172
  await device.scrubApp(bundleId);
169
173
  }
170
174
  }
171
175
  catch (err) {
172
- logger_1.default.debug(err.stack);
173
- logger_1.default.warn(err.message);
174
- logger_1.default.warn(`Reset: could not scrub ${isSafari ? 'Safari browser' : 'application with id "' + opts.bundleId + '"'}. ` + `Leaving as is.`);
176
+ this.log.debug(err.stack);
177
+ this.log.warn(err.message);
178
+ this.log.warn(`Reset: could not scrub ${isSafari ? 'Safari browser' : 'application with id "' + this.opts.bundleId + '"'}. ` + `Leaving as is.`);
175
179
  }
176
180
  }
177
181
  if (enforceSimulatorShutdown && (await device.isRunning())) {
178
- await shutdownSimulator(device);
182
+ await shutdownSimulator.bind(this)(device);
179
183
  }
180
184
  }
181
185
  }
@@ -187,38 +191,43 @@ exports.runSimulatorReset = runSimulatorReset;
187
191
  * @property {boolean} [newSimulator=false] Whether the simulator is brand new
188
192
  */
189
193
  /**
190
- * @param {any} device The simulator device object
194
+ * @this {import('./driver').XCUITestDriver}
191
195
  * @param {string} app The app to the path
192
196
  * @param {string} [bundleId] The bundle id to ensure it is already installed and uninstall it
193
- * @param {InstallOptions} opts
197
+ * @param {InstallOptions} [opts={}]
194
198
  */
195
- async function installToSimulator(device, app, bundleId, opts = /** @type {InstallOptions} */ ({})) {
199
+ async function installToSimulator(app, bundleId, opts = {}) {
196
200
  if (!app) {
197
- logger_1.default.debug('No app path is given. Nothing to install.');
201
+ this.log.debug('No app path is given. Nothing to install.');
198
202
  return;
199
203
  }
200
204
  const { skipUninstall, newSimulator = false } = opts;
205
+ const device = /** @type {import('./driver').Simulator} */ (this.device);
201
206
  if (!skipUninstall && !newSimulator && bundleId && (await device.isAppInstalled(bundleId))) {
202
- logger_1.default.debug(`Reset requested. Removing app with id '${bundleId}' from the device`);
207
+ this.log.debug(`Reset requested. Removing app with id '${bundleId}' from the device`);
203
208
  await device.removeApp(bundleId);
204
209
  }
205
- logger_1.default.debug(`Installing '${app}' on Simulator with UUID '${device.udid}'...`);
210
+ this.log.debug(`Installing '${app}' on Simulator with UUID '${device.udid}'...`);
206
211
  const timer = new support_1.timing.Timer().start();
207
212
  await device.installApp(app);
208
- logger_1.default.info(`The app has been successfully installed in ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`);
213
+ this.log.info(`The app has been successfully installed in ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`);
209
214
  }
210
215
  exports.installToSimulator = installToSimulator;
211
- async function shutdownOtherSimulators(currentDevice) {
216
+ /**
217
+ * @this {import('./driver').XCUITestDriver}
218
+ */
219
+ async function shutdownOtherSimulators() {
220
+ const device = /** @type {import('./driver').Simulator} */ (this.device);
212
221
  const simctl = new node_simctl_1.default({
213
- devicesSetPath: currentDevice.devicesSetPath,
222
+ devicesSetPath: device.devicesSetPath,
214
223
  });
215
224
  const allDevices = lodash_1.default.flatMap(lodash_1.default.values(await simctl.getDevices()));
216
- const otherBootedDevices = allDevices.filter((device) => device.udid !== currentDevice.udid && device.state === 'Booted');
225
+ const otherBootedDevices = allDevices.filter((device) => device.udid !== device.udid && device.state === 'Booted');
217
226
  if (lodash_1.default.isEmpty(otherBootedDevices)) {
218
- logger_1.default.info('No other running simulators have been detected');
227
+ this.log.info('No other running simulators have been detected');
219
228
  return;
220
229
  }
221
- logger_1.default.info(`Detected ${otherBootedDevices.length} other running ${support_1.util.pluralize('Simulator', otherBootedDevices.length)}.` + `Shutting them down...`);
230
+ this.log.info(`Detected ${otherBootedDevices.length} other running ${support_1.util.pluralize('Simulator', otherBootedDevices.length)}.` + `Shutting them down...`);
222
231
  for (const { udid } of otherBootedDevices) {
223
232
  // It is necessary to stop the corresponding xcodebuild process before killing
224
233
  // the simulator, otherwise it will be automatically restarted
@@ -231,37 +240,36 @@ exports.shutdownOtherSimulators = shutdownOtherSimulators;
231
240
  /**
232
241
  * Configures Safari options based on the given session capabilities
233
242
  *
234
- * @param {any} sim Simulator instance
235
- * @param {object} opts Session capabilities
243
+ * @this {import('./driver').XCUITestDriver}
236
244
  * @return {Promise<boolean>} true if any preferences have been updated
237
245
  */
238
- async function setSafariPrefs(sim, opts = {}) {
239
- const safariSettings = lodash_1.default.cloneDeep(opts.safariGlobalPreferences ?? {});
246
+ async function setSafariPrefs() {
247
+ const safariSettings = lodash_1.default.cloneDeep(this.opts.safariGlobalPreferences ?? {});
240
248
  for (const [name, [aliases, valueConverter]] of lodash_1.default.toPairs(SAFARI_OPTS_ALIASES_MAP)) {
241
- if (!lodash_1.default.has(opts, name)) {
249
+ if (!lodash_1.default.has(this.opts, name)) {
242
250
  continue;
243
251
  }
244
252
  for (const alias of aliases) {
245
- safariSettings[alias] = valueConverter(opts[name]);
253
+ safariSettings[alias] = valueConverter(this.opts[name]);
246
254
  }
247
255
  }
248
256
  if (lodash_1.default.isEmpty(safariSettings)) {
249
257
  return false;
250
258
  }
251
- logger_1.default.debug(`About to update Safari preferences: ${JSON.stringify(safariSettings)}`);
252
- await sim.updateSafariSettings(safariSettings);
259
+ this.log.debug(`About to update Safari preferences: ${JSON.stringify(safariSettings)}`);
260
+ await /** @type {import('./driver').Simulator} */ (this.device).updateSafariSettings(safariSettings);
253
261
  return true;
254
262
  }
255
263
  exports.setSafariPrefs = setSafariPrefs;
256
264
  /**
257
265
  * Changes Simulator localization preferences
258
266
  *
259
- * @param {any} sim Simulator instance
260
- * @param {object} opts Session capabilities
267
+ * @this {import('./driver').XCUITestDriver}
261
268
  * @returns {Promise<boolean>} True if preferences were changed
262
269
  */
263
- async function setLocalizationPrefs(sim, opts = {}) {
264
- const { language, locale, calendarFormat, skipSyncUiDialogTranslation } = opts;
270
+ async function setLocalizationPrefs() {
271
+ const { language, locale, calendarFormat, skipSyncUiDialogTranslation } = this.opts;
272
+ /** @type {import('appium-ios-simulator').LocalizationOptions} */
265
273
  const l10nConfig = {};
266
274
  if (language) {
267
275
  l10nConfig.language = { name: language, skipSyncUiDialogTranslation };
@@ -275,8 +283,8 @@ async function setLocalizationPrefs(sim, opts = {}) {
275
283
  if (lodash_1.default.isEmpty(l10nConfig)) {
276
284
  return false;
277
285
  }
278
- logger_1.default.debug(`About to update localization preferences: ${JSON.stringify(l10nConfig)}`);
279
- await sim.configureLocalization(l10nConfig);
286
+ this.log.debug(`About to update localization preferences: ${JSON.stringify(l10nConfig)}`);
287
+ await /** @type {import('./driver').Simulator} */ (this.device).configureLocalization(l10nConfig);
280
288
  return true;
281
289
  }
282
290
  exports.setLocalizationPrefs = setLocalizationPrefs;
@@ -1 +1 @@
1
- {"version":3,"file":"simulator-management.js","sourceRoot":"","sources":["../../lib/simulator-management.js"],"names":[],"mappings":";;;;;;AAAA,+DAAkD;AAClD,8DAAiC;AACjC,iEAAyD;AACzD,oDAAuB;AACvB,sDAA2B;AAC3B,4CAA4C;AAC5C,mCAAyD;AAEzD,MAAM,iBAAiB,GAAG,YAAY,CAAC;AACvC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,CAAC;IACpD,iBAAiB,EAAE;QACjB,CAAC,6CAA6C,EAAE,uCAAuC,CAAC;QACxF,CAAC,CA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,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6CAA6C,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC1F,MAAM,2CAA2C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAClG,OAAO,IAAI,CAAC;AACd,CAAC;AApBD,oDAoBC"}
@@ -23,8 +23,7 @@ export default {
23
23
  const srcAppPath = await this.helpers.configureApp(app, '.app');
24
24
  this.log.info(
25
25
  `Installing '${srcAppPath}' to the ${this.isRealDevice() ? 'real device' : 'Simulator'} ` +
26
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
27
- `with UDID '${this.opts.device.udid}'`,
26
+ `with UDID '${this.device.udid}'`,
28
27
  );
29
28
  if (!(await fs.exists(srcAppPath))) {
30
29
  throw this.log.errorWithException(
@@ -36,7 +35,7 @@ export default {
36
35
  const bundleId = await extractBundleId(srcAppPath);
37
36
  const {install} = await this.checkAutInstallationState(
38
37
  // @ts-expect-error - do not assign arbitrary properties to `this.opts`
39
- {enforceAppInstall: false, fullReset: false, noReset: false, bundleId, device: this.opts.device, app: srcAppPath}
38
+ {enforceAppInstall: false, fullReset: false, noReset: false, bundleId, device: this.device, app: srcAppPath}
40
39
  );
41
40
 
42
41
  if (!install) {
@@ -45,8 +44,7 @@ export default {
45
44
  }
46
45
  }
47
46
 
48
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
49
- await this.opts.device.installApp(
47
+ await this.device.installApp(
50
48
  srcAppPath,
51
49
  timeoutMs ?? this.opts.appPushTimeout,
52
50
  strategy ?? this.opts.appInstallStrategy,
@@ -62,8 +60,7 @@ export default {
62
60
  * @this {XCUITestDriver}
63
61
  */
64
62
  async mobileIsAppInstalled(bundleId) {
65
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
66
- const installed = await this.opts.device.isAppInstalled(bundleId);
63
+ const installed = await this.device.isAppInstalled(bundleId);
67
64
  this.log.info(`App '${bundleId}' is${installed ? '' : ' not'} installed`);
68
65
  return installed;
69
66
  },
@@ -78,14 +75,10 @@ export default {
78
75
  async mobileRemoveApp(bundleId) {
79
76
  this.log.info(
80
77
  `Uninstalling the application with bundle identifier '${bundleId}' ` +
81
- `from the ${this.isRealDevice() ? 'real device' : 'Simulator'} with UDID '${
82
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
83
- this.opts.device.udid
84
- }'`,
78
+ `from the ${this.isRealDevice() ? 'real device' : 'Simulator'} with UDID '${this.device.udid}'`,
85
79
  );
86
80
  try {
87
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
88
- await this.opts.device.removeApp(bundleId);
81
+ await this.device.removeApp(bundleId);
89
82
  this.log.info(`Removal of '${bundleId}' succeeded`);
90
83
  return true;
91
84
  } catch (err) {
@@ -158,8 +151,9 @@ export default {
158
151
  throw new errors.UnsupportedOperationError('A real device is required');
159
152
  }
160
153
 
161
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
162
- return await this.opts.device.terminateApp(bundleId, this.opts.platformVersion);
154
+ return await /** @type {import('../real-device').RealDevice} */ (this.device).terminateApp(
155
+ bundleId, String(this.opts.platformVersion)
156
+ );
163
157
  },
164
158
 
165
159
  /**
@@ -232,7 +226,7 @@ export default {
232
226
  throw new errors.NotImplementedError(`This extension is only supported on real devices`);
233
227
  }
234
228
 
235
- const service = await services.startInstallationProxyService(this.opts.device.udid);
229
+ const service = await services.startInstallationProxyService(this.device.udid);
236
230
  try {
237
231
  return await service.listApplications({applicationType});
238
232
  } finally {
@@ -258,8 +252,7 @@ export default {
258
252
  );
259
253
  }
260
254
 
261
- // @ts-ignore This opt must exist
262
- const simctl = this.opts.device.simctl;
255
+ const simctl = /** @type {import('../driver').Simulator} */ (this.device).simctl;
263
256
  const dataRoot = await simctl.getAppContainer(bundleId, 'data');
264
257
  this.log.debug(`Got the data container root of ${bundleId} at '${dataRoot}'`);
265
258
  if (!await fs.exists(dataRoot)) {
@@ -21,8 +21,7 @@ export default {
21
21
 
22
22
  if (this.isSimulator()) {
23
23
  try {
24
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
25
- return void (await this.opts.device.setAppearance(style));
24
+ return void (await /** @type {import('../driver').Simulator} */ (this.device).setAppearance(style));
26
25
  } catch (e) {
27
26
  this.log.debug(e.stack);
28
27
  }
@@ -53,8 +52,9 @@ export default {
53
52
  let style;
54
53
  if (this.isSimulator()) {
55
54
  try {
56
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
57
- style = await this.opts.device.getAppearance();
55
+ style = /** @type {Style} */ (
56
+ await /** @type {import('../driver').Simulator} */ (this.device).getAppearance()
57
+ );
58
58
  } catch (ign) {}
59
59
  }
60
60
  if (!style) {
@@ -15,8 +15,7 @@ export default {
15
15
  async mobileEnrollBiometric(isEnabled = true) {
16
16
  assertSimulator(this);
17
17
 
18
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
19
- await this.opts.device.enrollBiometric(isEnabled);
18
+ await /** @type {import('../driver').Simulator} */ (this.device).enrollBiometric(isEnabled);
20
19
  },
21
20
 
22
21
  /**
@@ -33,8 +32,7 @@ export default {
33
32
  async mobileSendBiometricMatch(type = 'touchId', match = true) {
34
33
  assertSimulator(this);
35
34
 
36
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
37
- await this.opts.device.sendBiometricMatch(match, type);
35
+ await /** @type {import('../driver').Simulator} */ (this.device).sendBiometricMatch(match, type);
38
36
  },
39
37
 
40
38
  /**
@@ -48,8 +46,7 @@ export default {
48
46
  async mobileIsBiometricEnrolled() {
49
47
  assertSimulator(this);
50
48
 
51
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
52
- return await this.opts.device.isBiometricEnrolled();
49
+ return await /** @type {import('../driver').Simulator} */ (this.device).isBiometricEnrolled();
53
50
  },
54
51
  };
55
52
 
@@ -295,7 +295,7 @@ export default {
295
295
  * @param {string} [commonName] - Common name of the certificate. If this is not set, the command will try to parse it from the provided `content`.
296
296
  * @param {boolean} isRoot - Defines where the certificate should be installed; either the Trusted Root Store (`true`) or the Keychain (`false`). On environments other than Xcode 11.4+ Simulator, this option is ignored.
297
297
  * @returns {Promise<string|void>} The content of the generated `.mobileconfig` file as
298
- a base64-encoded string. This config might be useful for debugging purposes. If the certificate has been successfully set via CLI, then nothing is returned.
298
+ * a base64-encoded string. This config might be useful for debugging purposes. If the certificate has been successfully set via CLI, then nothing is returned.
299
299
  * @this {XCUITestDriver}
300
300
  */
301
301
  async mobileInstallCertificate(content, commonName, isRoot = true) {
@@ -306,8 +306,7 @@ export default {
306
306
  if (this.isSimulator()) {
307
307
  try {
308
308
  const methodName = isRoot ? 'addRootCertificate' : 'addCertificate';
309
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
310
- await this.opts.device.simctl[methodName](Buffer.from(content, 'base64').toString(), {
309
+ await /** @type {import('../driver').Simulator} */ (this.device).simctl[methodName](Buffer.from(content, 'base64').toString(), {
311
310
  raw: true,
312
311
  });
313
312
  return;
@@ -387,8 +386,7 @@ export default {
387
386
  }
388
387
  }
389
388
  } else {
390
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
391
- await this.opts.device.openUrl(certUrl);
389
+ await /** @type {import('../driver').Simulator} */ (this.device).openUrl(certUrl);
392
390
  }
393
391
 
394
392
  let isCertAlreadyInstalled = false;
@@ -63,8 +63,7 @@ export default {
63
63
  */
64
64
  async listConditionInducers() {
65
65
  requireConditionInducerCompatibleDevice(this);
66
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
67
- const conditionInducerService = await services.startInstrumentService(this.opts.device.udid);
66
+ const conditionInducerService = await services.startInstrumentService(this.device.udid);
68
67
  try {
69
68
  const ret = await conditionInducerService.callChannel(
70
69
  INSTRUMENT_CHANNEL.CONDITION_INDUCER,
@@ -100,8 +99,7 @@ export default {
100
99
  if (this._conditionInducerService && !this._conditionInducerService._socketClient.destroyed) {
101
100
  this.log.errorAndThrow(`Condition inducer has been started. A condition is already active.`);
102
101
  }
103
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
104
- this._conditionInducerService = await services.startInstrumentService(this.opts.device.udid);
102
+ this._conditionInducerService = await services.startInstrumentService(this.device.udid);
105
103
  const ret = await this._conditionInducerService.callChannel(
106
104
  INSTRUMENT_CHANNEL.CONDITION_INDUCER,
107
105
  'enableConditionWithIdentifier:profileIdentifier:',
@@ -439,8 +439,7 @@ const helpers = {
439
439
  async getNewRemoteDebugger() {
440
440
  let socketPath;
441
441
  if (!this.isRealDevice()) {
442
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
443
- socketPath = await this.opts.device.getWebInspectorSocket();
442
+ socketPath = await /** @type {import('../driver').Simulator} */ (this.device).getWebInspectorSocket();
444
443
  }
445
444
  return createRemoteDebugger(
446
445
  {
@@ -14,8 +14,7 @@ export default {
14
14
  );
15
15
 
16
16
  if (this.isRealDevice()) {
17
- // @ts-expect-error - do not assign arbitrary properties to `this.opts`
18
- const lockdownInfo = await utilities.getDeviceInfo(this.opts.device.udid);
17
+ const lockdownInfo = await utilities.getDeviceInfo(this.device.udid);
19
18
  return {...infoByWda, ...{lockdownInfo}};
20
19
  }
21
20