appium-xcuitest-driver 10.8.3 → 10.9.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 (218) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/app-utils.d.ts +2 -2
  3. package/build/lib/app-utils.d.ts.map +1 -1
  4. package/build/lib/app-utils.js +4 -1
  5. package/build/lib/app-utils.js.map +1 -1
  6. package/build/lib/commands/app-management.js +2 -2
  7. package/build/lib/commands/app-management.js.map +1 -1
  8. package/build/lib/commands/appearance.js +2 -2
  9. package/build/lib/commands/appearance.js.map +1 -1
  10. package/build/lib/commands/biometric.js +3 -3
  11. package/build/lib/commands/biometric.js.map +1 -1
  12. package/build/lib/commands/certificate.d.ts.map +1 -1
  13. package/build/lib/commands/certificate.js +9 -3
  14. package/build/lib/commands/certificate.js.map +1 -1
  15. package/build/lib/commands/context.d.ts +5 -5
  16. package/build/lib/commands/context.d.ts.map +1 -1
  17. package/build/lib/commands/context.js +6 -6
  18. package/build/lib/commands/context.js.map +1 -1
  19. package/build/lib/commands/file-movement.d.ts.map +1 -1
  20. package/build/lib/commands/file-movement.js +7 -7
  21. package/build/lib/commands/file-movement.js.map +1 -1
  22. package/build/lib/commands/general.js +1 -1
  23. package/build/lib/commands/general.js.map +1 -1
  24. package/build/lib/commands/gesture.js +1 -1
  25. package/build/lib/commands/gesture.js.map +1 -1
  26. package/build/lib/commands/keychains.js +1 -1
  27. package/build/lib/commands/keychains.js.map +1 -1
  28. package/build/lib/commands/localization.js +1 -1
  29. package/build/lib/commands/localization.js.map +1 -1
  30. package/build/lib/commands/location.js +1 -1
  31. package/build/lib/commands/location.js.map +1 -1
  32. package/build/lib/commands/log.js +7 -7
  33. package/build/lib/commands/log.js.map +1 -1
  34. package/build/lib/commands/memory.js +1 -1
  35. package/build/lib/commands/memory.js.map +1 -1
  36. package/build/lib/commands/notifications.js +1 -1
  37. package/build/lib/commands/notifications.js.map +1 -1
  38. package/build/lib/commands/pasteboard.js +2 -2
  39. package/build/lib/commands/pasteboard.js.map +1 -1
  40. package/build/lib/commands/pcap.js +1 -1
  41. package/build/lib/commands/pcap.js.map +1 -1
  42. package/build/lib/commands/performance.d.ts.map +1 -1
  43. package/build/lib/commands/performance.js +13 -4
  44. package/build/lib/commands/performance.js.map +1 -1
  45. package/build/lib/commands/permissions.js +2 -2
  46. package/build/lib/commands/permissions.js.map +1 -1
  47. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  48. package/build/lib/commands/proxy-helper.js +0 -3
  49. package/build/lib/commands/proxy-helper.js.map +1 -1
  50. package/build/lib/commands/screenshots.js +1 -1
  51. package/build/lib/commands/screenshots.js.map +1 -1
  52. package/build/lib/commands/simctl.d.ts +1 -1
  53. package/build/lib/commands/simctl.d.ts.map +1 -1
  54. package/build/lib/commands/simctl.js +1 -1
  55. package/build/lib/commands/simctl.js.map +1 -1
  56. package/build/lib/commands/web.js +1 -1
  57. package/build/lib/commands/web.js.map +1 -1
  58. package/build/lib/commands/xctest-record-screen.js +2 -2
  59. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  60. package/build/lib/desired-caps.d.ts +383 -507
  61. package/build/lib/desired-caps.d.ts.map +1 -1
  62. package/build/lib/desired-caps.js +6 -10
  63. package/build/lib/desired-caps.js.map +1 -1
  64. package/build/lib/device/clients/base-device-client.d.ts.map +1 -0
  65. package/build/lib/device/clients/base-device-client.js.map +1 -0
  66. package/build/lib/{real-device-clients → device/clients}/py-ios-device-client.d.ts +1 -1
  67. package/build/lib/device/clients/py-ios-device-client.d.ts.map +1 -0
  68. package/build/lib/device/clients/py-ios-device-client.js.map +1 -0
  69. package/build/lib/device/device-connections-factory.d.ts +18 -0
  70. package/build/lib/device/device-connections-factory.d.ts.map +1 -0
  71. package/build/lib/{device-connections-factory.js → device/device-connections-factory.js} +57 -41
  72. package/build/lib/device/device-connections-factory.js.map +1 -0
  73. package/build/lib/{device-log → device/log}/helpers.d.ts +1 -1
  74. package/build/lib/device/log/helpers.d.ts.map +1 -0
  75. package/build/lib/device/log/helpers.js.map +1 -0
  76. package/build/lib/{device-log → device/log}/ios-crash-log.d.ts +1 -1
  77. package/build/lib/device/log/ios-crash-log.d.ts.map +1 -0
  78. package/build/lib/{device-log → device/log}/ios-crash-log.js +1 -1
  79. package/build/lib/device/log/ios-crash-log.js.map +1 -0
  80. package/build/lib/device/log/ios-device-log.d.ts.map +1 -0
  81. package/build/lib/device/log/ios-device-log.js.map +1 -0
  82. package/build/lib/{device-log → device/log}/ios-log.d.ts +1 -1
  83. package/build/lib/device/log/ios-log.d.ts.map +1 -0
  84. package/build/lib/device/log/ios-log.js.map +1 -0
  85. package/build/lib/device/log/ios-performance-log.d.ts.map +1 -0
  86. package/build/lib/device/log/ios-performance-log.js.map +1 -0
  87. package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -0
  88. package/build/lib/device/log/ios-simulator-log.js.map +1 -0
  89. package/build/lib/{device-log → device/log}/line-consuming-log.d.ts +1 -1
  90. package/build/lib/device/log/line-consuming-log.d.ts.map +1 -0
  91. package/build/lib/device/log/line-consuming-log.js.map +1 -0
  92. package/build/lib/{device-log → device/log}/safari-console-log.d.ts +1 -1
  93. package/build/lib/device/log/safari-console-log.d.ts.map +1 -0
  94. package/build/lib/device/log/safari-console-log.js.map +1 -0
  95. package/build/lib/device/log/safari-network-log.d.ts.map +1 -0
  96. package/build/lib/device/log/safari-network-log.js.map +1 -0
  97. package/build/lib/device/real-device-management.d.ts +146 -0
  98. package/build/lib/device/real-device-management.d.ts.map +1 -0
  99. package/build/lib/device/real-device-management.js +728 -0
  100. package/build/lib/device/real-device-management.js.map +1 -0
  101. package/build/lib/device/simulator-management.d.ts +65 -0
  102. package/build/lib/device/simulator-management.d.ts.map +1 -0
  103. package/build/lib/{simulator-management.js → device/simulator-management.js} +24 -43
  104. package/build/lib/device/simulator-management.js.map +1 -0
  105. package/build/lib/driver.d.ts +129 -1385
  106. package/build/lib/driver.d.ts.map +1 -1
  107. package/build/lib/driver.js +476 -600
  108. package/build/lib/driver.js.map +1 -1
  109. package/build/lib/method-map.d.ts +1 -1
  110. package/build/lib/method-map.d.ts.map +1 -1
  111. package/build/lib/method-map.js +2 -2
  112. package/build/lib/method-map.js.map +1 -1
  113. package/lib/app-utils.js +5 -1
  114. package/lib/commands/app-management.js +2 -2
  115. package/lib/commands/appearance.js +2 -2
  116. package/lib/commands/biometric.js +3 -3
  117. package/lib/commands/certificate.js +9 -3
  118. package/lib/commands/context.js +6 -6
  119. package/lib/commands/file-movement.js +11 -7
  120. package/lib/commands/general.js +1 -1
  121. package/lib/commands/gesture.js +1 -1
  122. package/lib/commands/keychains.js +1 -1
  123. package/lib/commands/localization.js +1 -1
  124. package/lib/commands/location.js +1 -1
  125. package/lib/commands/log.js +7 -7
  126. package/lib/commands/memory.js +1 -1
  127. package/lib/commands/notifications.js +1 -1
  128. package/lib/commands/pasteboard.js +2 -2
  129. package/lib/commands/pcap.js +1 -1
  130. package/lib/commands/performance.js +12 -1
  131. package/lib/commands/permissions.js +2 -2
  132. package/lib/commands/proxy-helper.js +0 -3
  133. package/lib/commands/screenshots.js +1 -1
  134. package/lib/commands/simctl.js +1 -1
  135. package/lib/commands/web.js +1 -1
  136. package/lib/commands/xctest-record-screen.js +2 -2
  137. package/lib/{desired-caps.js → desired-caps.ts} +7 -6
  138. package/lib/{real-device-clients → device/clients}/py-ios-device-client.ts +1 -1
  139. package/lib/{device-connections-factory.js → device/device-connections-factory.ts} +96 -60
  140. package/lib/{device-log → device/log}/helpers.ts +1 -1
  141. package/lib/{device-log → device/log}/ios-crash-log.ts +3 -3
  142. package/lib/{device-log → device/log}/ios-log.ts +1 -1
  143. package/lib/{device-log → device/log}/line-consuming-log.ts +1 -1
  144. package/lib/{device-log → device/log}/safari-console-log.ts +1 -1
  145. package/lib/device/real-device-management.ts +819 -0
  146. package/lib/{simulator-management.js → device/simulator-management.ts} +69 -62
  147. package/lib/{driver.js → driver.ts} +619 -713
  148. package/lib/{method-map.js → method-map.ts} +5 -2
  149. package/npm-shrinkwrap.json +5 -5
  150. package/package.json +1 -1
  151. package/build/lib/device-connections-factory.d.ts +0 -13
  152. package/build/lib/device-connections-factory.d.ts.map +0 -1
  153. package/build/lib/device-connections-factory.js.map +0 -1
  154. package/build/lib/device-log/helpers.d.ts.map +0 -1
  155. package/build/lib/device-log/helpers.js.map +0 -1
  156. package/build/lib/device-log/ios-crash-log.d.ts.map +0 -1
  157. package/build/lib/device-log/ios-crash-log.js.map +0 -1
  158. package/build/lib/device-log/ios-device-log.d.ts.map +0 -1
  159. package/build/lib/device-log/ios-device-log.js.map +0 -1
  160. package/build/lib/device-log/ios-log.d.ts.map +0 -1
  161. package/build/lib/device-log/ios-log.js.map +0 -1
  162. package/build/lib/device-log/ios-performance-log.d.ts.map +0 -1
  163. package/build/lib/device-log/ios-performance-log.js.map +0 -1
  164. package/build/lib/device-log/ios-simulator-log.d.ts.map +0 -1
  165. package/build/lib/device-log/ios-simulator-log.js.map +0 -1
  166. package/build/lib/device-log/line-consuming-log.d.ts.map +0 -1
  167. package/build/lib/device-log/line-consuming-log.js.map +0 -1
  168. package/build/lib/device-log/safari-console-log.d.ts.map +0 -1
  169. package/build/lib/device-log/safari-console-log.js.map +0 -1
  170. package/build/lib/device-log/safari-network-log.d.ts.map +0 -1
  171. package/build/lib/device-log/safari-network-log.js.map +0 -1
  172. package/build/lib/ios-fs-helpers.d.ts +0 -75
  173. package/build/lib/ios-fs-helpers.d.ts.map +0 -1
  174. package/build/lib/ios-fs-helpers.js +0 -370
  175. package/build/lib/ios-fs-helpers.js.map +0 -1
  176. package/build/lib/real-device-clients/base-device-client.d.ts.map +0 -1
  177. package/build/lib/real-device-clients/base-device-client.js.map +0 -1
  178. package/build/lib/real-device-clients/py-ios-device-client.d.ts.map +0 -1
  179. package/build/lib/real-device-clients/py-ios-device-client.js.map +0 -1
  180. package/build/lib/real-device-management.d.ts +0 -53
  181. package/build/lib/real-device-management.d.ts.map +0 -1
  182. package/build/lib/real-device-management.js +0 -128
  183. package/build/lib/real-device-management.js.map +0 -1
  184. package/build/lib/real-device.d.ts +0 -112
  185. package/build/lib/real-device.d.ts.map +0 -1
  186. package/build/lib/real-device.js +0 -352
  187. package/build/lib/real-device.js.map +0 -1
  188. package/build/lib/simulator-management.d.ts +0 -96
  189. package/build/lib/simulator-management.d.ts.map +0 -1
  190. package/build/lib/simulator-management.js.map +0 -1
  191. package/build/lib/xcrun.d.ts +0 -3
  192. package/build/lib/xcrun.d.ts.map +0 -1
  193. package/build/lib/xcrun.js +0 -17
  194. package/build/lib/xcrun.js.map +0 -1
  195. package/lib/ios-fs-helpers.js +0 -355
  196. package/lib/real-device-management.js +0 -133
  197. package/lib/real-device.js +0 -347
  198. package/lib/xcrun.js +0 -16
  199. /package/build/lib/{real-device-clients → device/clients}/base-device-client.d.ts +0 -0
  200. /package/build/lib/{real-device-clients → device/clients}/base-device-client.js +0 -0
  201. /package/build/lib/{real-device-clients → device/clients}/py-ios-device-client.js +0 -0
  202. /package/build/lib/{device-log → device/log}/helpers.js +0 -0
  203. /package/build/lib/{device-log → device/log}/ios-device-log.d.ts +0 -0
  204. /package/build/lib/{device-log → device/log}/ios-device-log.js +0 -0
  205. /package/build/lib/{device-log → device/log}/ios-log.js +0 -0
  206. /package/build/lib/{device-log → device/log}/ios-performance-log.d.ts +0 -0
  207. /package/build/lib/{device-log → device/log}/ios-performance-log.js +0 -0
  208. /package/build/lib/{device-log → device/log}/ios-simulator-log.d.ts +0 -0
  209. /package/build/lib/{device-log → device/log}/ios-simulator-log.js +0 -0
  210. /package/build/lib/{device-log → device/log}/line-consuming-log.js +0 -0
  211. /package/build/lib/{device-log → device/log}/safari-console-log.js +0 -0
  212. /package/build/lib/{device-log → device/log}/safari-network-log.d.ts +0 -0
  213. /package/build/lib/{device-log → device/log}/safari-network-log.js +0 -0
  214. /package/lib/{real-device-clients → device/clients}/base-device-client.ts +0 -0
  215. /package/lib/{device-log → device/log}/ios-device-log.ts +0 -0
  216. /package/lib/{device-log → device/log}/ios-performance-log.ts +0 -0
  217. /package/lib/{device-log → device/log}/ios-simulator-log.ts +0 -0
  218. /package/lib/{device-log → device/log}/safari-network-log.ts +0 -0
@@ -1,25 +1,25 @@
1
- import {getSimulator} from 'appium-ios-simulator';
1
+ import {getSimulator, type Simulator, type LocalizationOptions} from 'appium-ios-simulator';
2
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';
6
- import {UDID_AUTO, normalizePlatformName} from './utils';
7
- import {buildSafariPreferences} from './app-utils';
6
+ import {UDID_AUTO, normalizePlatformName} from '../utils';
7
+ import {buildSafariPreferences} from '../app-utils';
8
+ import type { XCUITestDriver } from '../driver';
8
9
 
9
10
  const APPIUM_SIM_PREFIX = 'appiumTest';
10
11
 
11
12
  /**
12
13
  * Create a new simulator with `appiumTest-` prefix and return the object.
13
14
  *
14
- * @this {import('./driver').XCUITestDriver}
15
- * @returns {Promise<object>} Simulator object associated with the udid passed in.
15
+ * @returns Simulator object associated with the udid passed in.
16
16
  */
17
- export async function createSim() {
17
+ export async function createSim(this: XCUITestDriver): Promise<Simulator> {
18
18
  const {simulatorDevicesSetPath: devicesSetPath, deviceName, platformVersion} = this.opts;
19
19
  const platform = normalizePlatformName(this.opts.platformName);
20
20
  const simctl = new Simctl({devicesSetPath});
21
21
  if (!deviceName) {
22
- let deviceNames = 'none';
22
+ let deviceNames: string | string[] = 'none';
23
23
  try {
24
24
  deviceNames = (await simctl
25
25
  .getDevices(platformVersion, platform))
@@ -47,22 +47,12 @@ export async function createSim() {
47
47
  });
48
48
  }
49
49
 
50
- /**
51
- * @typedef {Object} SimulatorLookupOptions
52
- * @property {string} [deviceName] - The name of the device to lookup
53
- * @property {string} platformVersion - The platform version string
54
- * @property {string} [simulatorDevicesSetPath] - The full path to the simulator devices set
55
- * @property {string} [udid] - Simulator udid
56
- * @property {string} [platformName] The name of the current platform
57
- */
58
-
59
50
  /**
60
51
  * Get an existing simulator matching the provided capabilities.
61
52
  *
62
- * @this {import('./driver').XCUITestDriver}
63
- * @returns {Promise<import('./driver').Simulator|null>} The matched Simulator instance or `null` if no matching device is found.
53
+ * @returns The matched Simulator instance or `null` if no matching device is found.
64
54
  */
65
- export async function getExistingSim() {
55
+ export async function getExistingSim(this: XCUITestDriver): Promise<Simulator | null> {
66
56
  const {
67
57
  platformVersion,
68
58
  deviceName,
@@ -72,7 +62,7 @@ export async function getExistingSim() {
72
62
  } = this.opts;
73
63
 
74
64
  const platform = normalizePlatformName(platformName);
75
- const selectSim = async (/** @type {{ udid: string; platform: string; }} */ dev) =>
65
+ const selectSim = async (dev: { udid: string; platform: string; }): Promise<Simulator> =>
76
66
  await getSimulator(dev.udid, {
77
67
  platform,
78
68
  checkExistence: false,
@@ -82,7 +72,7 @@ export async function getExistingSim() {
82
72
  });
83
73
 
84
74
  const simctl = new Simctl({devicesSetPath});
85
- let devicesMap;
75
+ let devicesMap: Record<string, any[]> | undefined;
86
76
  if (udid && _.toLower(udid) !== UDID_AUTO) {
87
77
  this.log.debug(`Looking for an existing Simulator with UDID '${udid}'`);
88
78
  devicesMap = await simctl.getDevices(null, platform);
@@ -123,21 +113,23 @@ export async function getExistingSim() {
123
113
  }
124
114
 
125
115
  /**
126
- * @this {import('./driver').XCUITestDriver}
116
+ * Shutdown simulator
127
117
  */
128
- export async function shutdownSimulator() {
129
- const device = /** @type {import('./driver').Simulator} */ (this.device);
118
+ export async function shutdownSimulator(this: XCUITestDriver): Promise<void> {
119
+ const device = this.device as Simulator;
130
120
  // stop XCTest processes if running to avoid unexpected side effects
131
121
  await resetTestProcesses(device.udid, true);
132
122
  await device.shutdown();
133
123
  }
134
124
 
135
125
  /**
136
- * @this {import('./driver').XCUITestDriver}
137
- * @property {boolean} [enforceSimulatorShutdown=false]
138
- * @returns {Promise<void>}
126
+ * Run simulator reset
127
+ * @param enforceSimulatorShutdown Whether to enforce simulator shutdown
139
128
  */
140
- export async function runSimulatorReset(enforceSimulatorShutdown = false) {
129
+ export async function runSimulatorReset(
130
+ this: XCUITestDriver,
131
+ enforceSimulatorShutdown: boolean = false
132
+ ): Promise<void> {
141
133
  const {
142
134
  noReset,
143
135
  fullReset,
@@ -152,7 +144,7 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
152
144
  this.log.debug('Reset: noReset is on. Leaving simulator as is');
153
145
  return;
154
146
  }
155
- const device = /** @type {import('./driver').Simulator} */ (this.device);
147
+ const device = this.device as Simulator;
156
148
 
157
149
  if (!this.device) {
158
150
  this.log.debug('Reset: no device available. Skipping');
@@ -165,7 +157,7 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
165
157
  const isKeychainsBackupSuccessful = (keychainsExcludePatterns || keepKeyChains) && (await device.backupKeychains());
166
158
  await device.clean();
167
159
  if (isKeychainsBackupSuccessful) {
168
- await device.restoreKeychains(keychainsExcludePatterns || []);
160
+ await device.restoreKeychains(keychainsExcludePatterns?.split(',')?.map(_.trim) || []);
169
161
  this.log.info(`Successfully restored keychains after full reset`);
170
162
  } else if (keychainsExcludePatterns || keepKeyChains) {
171
163
  this.log.warn(
@@ -194,8 +186,8 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
194
186
  await device.scrubApp(bundleId);
195
187
  }
196
188
  } catch (err) {
197
- this.log.debug(err.stack);
198
- this.log.warn(err.message);
189
+ this.log.debug((err as Error).stack);
190
+ this.log.warn((err as Error).message);
199
191
  this.log.warn(
200
192
  `Reset: could not scrub ${
201
193
  isSafari ? 'Safari browser' : 'application with id "' + this.opts.bundleId + '"'
@@ -205,36 +197,30 @@ export async function runSimulatorReset(enforceSimulatorShutdown = false) {
205
197
  }
206
198
 
207
199
  if (enforceSimulatorShutdown && (await device.isRunning())) {
208
- await shutdownSimulator.bind(this)(device);
200
+ await shutdownSimulator.bind(this)();
209
201
  }
210
202
  }
211
203
  }
212
204
 
213
205
  /**
214
- * @typedef {Object} InstallOptions
215
- *
216
- * @property {boolean} [skipUninstall] Whether to skip app uninstall before installing it
217
- * @property {boolean} [newSimulator=false] Whether the simulator is brand new
218
- */
219
-
220
- /**
221
- * @this {import('./driver').XCUITestDriver}
222
- * @param {string} app The app to the path
223
- * @param {string} [bundleId] The bundle id to ensure it is already installed and uninstall it
224
- * @param {InstallOptions} [opts={}]
206
+ * Install app to simulator
207
+ * @param app The app to the path
208
+ * @param bundleId The bundle id to ensure it is already installed and uninstall it
209
+ * @param opts Install options
225
210
  */
226
211
  export async function installToSimulator(
227
- app,
228
- bundleId,
229
- opts = {},
230
- ) {
212
+ this: XCUITestDriver,
213
+ app: string,
214
+ bundleId?: string,
215
+ opts: SimulatorInstallOptions = {},
216
+ ): Promise<void> {
231
217
  if (!app) {
232
218
  this.log.debug('No app path is given. Nothing to install.');
233
219
  return;
234
220
  }
235
221
 
236
222
  const {skipUninstall, newSimulator = false} = opts;
237
- const device = /** @type {import('./driver').Simulator} */ (this.device);
223
+ const device = this.device as Simulator;
238
224
 
239
225
  if (!skipUninstall && !newSimulator && bundleId && (await device.isAppInstalled(bundleId))) {
240
226
  this.log.debug(`Reset requested. Removing app with id '${bundleId}' from the device`);
@@ -248,10 +234,10 @@ export async function installToSimulator(
248
234
  }
249
235
 
250
236
  /**
251
- * @this {import('./driver').XCUITestDriver}
237
+ * Shutdown other simulators
252
238
  */
253
- export async function shutdownOtherSimulators() {
254
- const device = /** @type {import('./driver').Simulator} */ (this.device);
239
+ export async function shutdownOtherSimulators(this: XCUITestDriver): Promise<void> {
240
+ const device = this.device as Simulator;
255
241
  const simctl = new Simctl({
256
242
  devicesSetPath: device.devicesSetPath,
257
243
  });
@@ -281,30 +267,27 @@ export async function shutdownOtherSimulators() {
281
267
  /**
282
268
  * Configures Safari options based on the given session capabilities
283
269
  *
284
- * @this {import('./driver').XCUITestDriver}
285
- * @return {Promise<boolean>} true if any preferences have been updated
270
+ * @returns true if any preferences have been updated
286
271
  */
287
- export async function setSafariPrefs() {
272
+ export async function setSafariPrefs(this: XCUITestDriver): Promise<boolean> {
288
273
  const prefs = buildSafariPreferences(this.opts);
289
274
  if (_.isEmpty(prefs)) {
290
275
  return false;
291
276
  }
292
277
 
293
278
  this.log.debug(`About to update Safari preferences: ${JSON.stringify(prefs)}`);
294
- await /** @type {import('./driver').Simulator} */ (this.device).updateSafariSettings(prefs);
279
+ await (this.device as Simulator).updateSafariSettings(prefs);
295
280
  return true;
296
281
  }
297
282
 
298
283
  /**
299
284
  * Changes Simulator localization preferences
300
285
  *
301
- * @this {import('./driver').XCUITestDriver}
302
- * @returns {Promise<boolean>} True if preferences were changed
286
+ * @returns True if preferences were changed
303
287
  */
304
- export async function setLocalizationPrefs() {
288
+ export async function setLocalizationPrefs(this: XCUITestDriver): Promise<boolean> {
305
289
  const {language, locale, calendarFormat, skipSyncUiDialogTranslation} = this.opts;
306
- /** @type {import('appium-ios-simulator').LocalizationOptions} */
307
- const l10nConfig = {};
290
+ const l10nConfig: LocalizationOptions = {};
308
291
  if (language) {
309
292
  l10nConfig.language = {name: language, skipSyncUiDialogTranslation };
310
293
  }
@@ -319,6 +302,30 @@ export async function setLocalizationPrefs() {
319
302
  }
320
303
 
321
304
  this.log.debug(`About to update localization preferences: ${JSON.stringify(l10nConfig)}`);
322
- await /** @type {import('./driver').Simulator} */ (this.device).configureLocalization(l10nConfig);
305
+ await (this.device as Simulator).configureLocalization(l10nConfig);
323
306
  return true;
324
307
  }
308
+
309
+ //#region Type Definitions
310
+
311
+ export interface SimulatorLookupOptions {
312
+ /** The name of the device to lookup */
313
+ deviceName?: string;
314
+ /** The platform version string */
315
+ platformVersion: string;
316
+ /** The full path to the simulator devices set */
317
+ simulatorDevicesSetPath?: string;
318
+ /** Simulator udid */
319
+ udid?: string;
320
+ /** The name of the current platform */
321
+ platformName?: string;
322
+ }
323
+
324
+ export interface SimulatorInstallOptions {
325
+ /** Whether to skip app uninstall before installing it */
326
+ skipUninstall?: boolean;
327
+ /** Whether the simulator is brand new */
328
+ newSimulator?: boolean;
329
+ }
330
+
331
+ //#endregion