appium-xcuitest-driver 10.3.0 → 10.4.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 (257) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/active-app-info.d.ts +9 -0
  3. package/build/lib/commands/active-app-info.d.ts.map +1 -0
  4. package/build/lib/commands/active-app-info.js +14 -0
  5. package/build/lib/commands/active-app-info.js.map +1 -0
  6. package/build/lib/commands/alert.d.ts +42 -45
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +66 -62
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +150 -153
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +300 -286
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/app-strings.d.ts +14 -17
  15. package/build/lib/commands/app-strings.d.ts.map +1 -1
  16. package/build/lib/commands/app-strings.js +23 -24
  17. package/build/lib/commands/app-strings.js.map +1 -1
  18. package/build/lib/commands/appearance.d.ts +19 -22
  19. package/build/lib/commands/appearance.d.ts.map +1 -1
  20. package/build/lib/commands/appearance.js +56 -56
  21. package/build/lib/commands/appearance.js.map +1 -1
  22. package/build/lib/commands/audit.d.ts +22 -17
  23. package/build/lib/commands/audit.d.ts.map +1 -1
  24. package/build/lib/commands/audit.js +17 -18
  25. package/build/lib/commands/audit.js.map +1 -1
  26. package/build/lib/commands/battery.d.ts +11 -14
  27. package/build/lib/commands/battery.d.ts.map +1 -1
  28. package/build/lib/commands/battery.js +36 -37
  29. package/build/lib/commands/battery.js.map +1 -1
  30. package/build/lib/commands/biometric.d.ts +30 -33
  31. package/build/lib/commands/biometric.d.ts.map +1 -1
  32. package/build/lib/commands/biometric.js +42 -41
  33. package/build/lib/commands/biometric.js.map +1 -1
  34. package/build/lib/commands/certificate.d.ts +48 -45
  35. package/build/lib/commands/certificate.d.ts.map +1 -1
  36. package/build/lib/commands/certificate.js +218 -205
  37. package/build/lib/commands/certificate.js.map +1 -1
  38. package/build/lib/commands/clipboard.d.ts +19 -22
  39. package/build/lib/commands/clipboard.d.ts.map +1 -1
  40. package/build/lib/commands/clipboard.js +30 -30
  41. package/build/lib/commands/clipboard.js.map +1 -1
  42. package/build/lib/commands/condition.d.ts +49 -26
  43. package/build/lib/commands/condition.d.ts.map +1 -1
  44. package/build/lib/commands/condition.js +87 -86
  45. package/build/lib/commands/condition.js.map +1 -1
  46. package/build/lib/commands/content-size.d.ts +26 -29
  47. package/build/lib/commands/content-size.d.ts.map +1 -1
  48. package/build/lib/commands/content-size.js +36 -36
  49. package/build/lib/commands/content-size.js.map +1 -1
  50. package/build/lib/commands/context.d.ts +161 -108
  51. package/build/lib/commands/context.d.ts.map +1 -1
  52. package/build/lib/commands/context.js +530 -517
  53. package/build/lib/commands/context.js.map +1 -1
  54. package/build/lib/commands/deviceInfo.d.ts +9 -12
  55. package/build/lib/commands/deviceInfo.d.ts.map +1 -1
  56. package/build/lib/commands/deviceInfo.js +17 -18
  57. package/build/lib/commands/deviceInfo.js.map +1 -1
  58. package/build/lib/commands/element.d.ts +102 -105
  59. package/build/lib/commands/element.d.ts.map +1 -1
  60. package/build/lib/commands/element.js +337 -323
  61. package/build/lib/commands/element.js.map +1 -1
  62. package/build/lib/commands/execute.d.ts +24 -19
  63. package/build/lib/commands/execute.d.ts.map +1 -1
  64. package/build/lib/commands/execute.js +63 -62
  65. package/build/lib/commands/execute.js.map +1 -1
  66. package/build/lib/commands/file-movement.d.ts +77 -80
  67. package/build/lib/commands/file-movement.d.ts.map +1 -1
  68. package/build/lib/commands/file-movement.js +130 -124
  69. package/build/lib/commands/file-movement.js.map +1 -1
  70. package/build/lib/commands/find.d.ts +18 -21
  71. package/build/lib/commands/find.d.ts.map +1 -1
  72. package/build/lib/commands/find.js +158 -156
  73. package/build/lib/commands/find.js.map +1 -1
  74. package/build/lib/commands/general.d.ts +124 -116
  75. package/build/lib/commands/general.d.ts.map +1 -1
  76. package/build/lib/commands/general.js +248 -232
  77. package/build/lib/commands/general.js.map +1 -1
  78. package/build/lib/commands/geolocation.d.ts +43 -46
  79. package/build/lib/commands/geolocation.d.ts.map +1 -1
  80. package/build/lib/commands/geolocation.js +10 -11
  81. package/build/lib/commands/geolocation.js.map +1 -1
  82. package/build/lib/commands/gesture.d.ts +273 -276
  83. package/build/lib/commands/gesture.d.ts.map +1 -1
  84. package/build/lib/commands/gesture.js +506 -492
  85. package/build/lib/commands/gesture.js.map +1 -1
  86. package/build/lib/commands/increase-contrast.d.ts +20 -23
  87. package/build/lib/commands/increase-contrast.d.ts.map +1 -1
  88. package/build/lib/commands/increase-contrast.js +30 -30
  89. package/build/lib/commands/increase-contrast.js.map +1 -1
  90. package/build/lib/commands/iohid.d.ts +1370 -1373
  91. package/build/lib/commands/iohid.d.ts.map +1 -1
  92. package/build/lib/commands/iohid.js +30 -31
  93. package/build/lib/commands/iohid.js.map +1 -1
  94. package/build/lib/commands/keyboard.d.ts +29 -32
  95. package/build/lib/commands/keyboard.d.ts.map +1 -1
  96. package/build/lib/commands/keyboard.js +53 -51
  97. package/build/lib/commands/keyboard.js.map +1 -1
  98. package/build/lib/commands/keychains.d.ts +9 -12
  99. package/build/lib/commands/keychains.d.ts.map +1 -1
  100. package/build/lib/commands/keychains.js +13 -14
  101. package/build/lib/commands/keychains.js.map +1 -1
  102. package/build/lib/commands/localization.d.ts +16 -19
  103. package/build/lib/commands/localization.d.ts.map +1 -1
  104. package/build/lib/commands/localization.js +25 -26
  105. package/build/lib/commands/localization.js.map +1 -1
  106. package/build/lib/commands/location.d.ts +36 -39
  107. package/build/lib/commands/location.d.ts.map +1 -1
  108. package/build/lib/commands/location.js +99 -98
  109. package/build/lib/commands/location.js.map +1 -1
  110. package/build/lib/commands/lock.d.ts +21 -24
  111. package/build/lib/commands/lock.d.ts.map +1 -1
  112. package/build/lib/commands/lock.js +39 -38
  113. package/build/lib/commands/lock.js.map +1 -1
  114. package/build/lib/commands/log.d.ts +43 -37
  115. package/build/lib/commands/log.d.ts.map +1 -1
  116. package/build/lib/commands/log.js +174 -171
  117. package/build/lib/commands/log.js.map +1 -1
  118. package/build/lib/commands/memory.d.ts +9 -12
  119. package/build/lib/commands/memory.d.ts.map +1 -1
  120. package/build/lib/commands/memory.js +37 -38
  121. package/build/lib/commands/memory.js.map +1 -1
  122. package/build/lib/commands/navigation.d.ts +30 -33
  123. package/build/lib/commands/navigation.d.ts.map +1 -1
  124. package/build/lib/commands/navigation.js +92 -92
  125. package/build/lib/commands/navigation.js.map +1 -1
  126. package/build/lib/commands/notifications.d.ts +26 -29
  127. package/build/lib/commands/notifications.d.ts.map +1 -1
  128. package/build/lib/commands/notifications.js +53 -53
  129. package/build/lib/commands/notifications.js.map +1 -1
  130. package/build/lib/commands/pasteboard.d.ts +21 -24
  131. package/build/lib/commands/pasteboard.d.ts.map +1 -1
  132. package/build/lib/commands/pasteboard.js +37 -37
  133. package/build/lib/commands/pasteboard.js.map +1 -1
  134. package/build/lib/commands/pcap.d.ts +39 -26
  135. package/build/lib/commands/pcap.d.ts.map +1 -1
  136. package/build/lib/commands/pcap.js +81 -81
  137. package/build/lib/commands/pcap.js.map +1 -1
  138. package/build/lib/commands/performance.d.ts +63 -44
  139. package/build/lib/commands/performance.d.ts.map +1 -1
  140. package/build/lib/commands/performance.js +105 -105
  141. package/build/lib/commands/performance.js.map +1 -1
  142. package/build/lib/commands/permissions.d.ts +33 -36
  143. package/build/lib/commands/permissions.d.ts.map +1 -1
  144. package/build/lib/commands/permissions.js +66 -65
  145. package/build/lib/commands/permissions.js.map +1 -1
  146. package/build/lib/commands/proxy-helper.d.ts +12 -15
  147. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  148. package/build/lib/commands/proxy-helper.js +53 -54
  149. package/build/lib/commands/proxy-helper.js.map +1 -1
  150. package/build/lib/commands/record-audio.d.ts +49 -29
  151. package/build/lib/commands/record-audio.d.ts.map +1 -1
  152. package/build/lib/commands/record-audio.js +100 -104
  153. package/build/lib/commands/record-audio.js.map +1 -1
  154. package/build/lib/commands/recordscreen.d.ts +54 -18
  155. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  156. package/build/lib/commands/recordscreen.js +127 -129
  157. package/build/lib/commands/recordscreen.js.map +1 -1
  158. package/build/lib/commands/screenshots.d.ts +14 -17
  159. package/build/lib/commands/screenshots.d.ts.map +1 -1
  160. package/build/lib/commands/screenshots.js +108 -107
  161. package/build/lib/commands/screenshots.js.map +1 -1
  162. package/build/lib/commands/simctl.d.ts +11 -14
  163. package/build/lib/commands/simctl.d.ts.map +1 -1
  164. package/build/lib/commands/simctl.js +23 -26
  165. package/build/lib/commands/simctl.js.map +1 -1
  166. package/build/lib/commands/source.d.ts +14 -17
  167. package/build/lib/commands/source.d.ts.map +1 -1
  168. package/build/lib/commands/source.js +40 -43
  169. package/build/lib/commands/source.js.map +1 -1
  170. package/build/lib/commands/timeouts.d.ts +44 -33
  171. package/build/lib/commands/timeouts.d.ts.map +1 -1
  172. package/build/lib/commands/timeouts.js +65 -63
  173. package/build/lib/commands/timeouts.js.map +1 -1
  174. package/build/lib/commands/web.d.ts +275 -197
  175. package/build/lib/commands/web.d.ts.map +1 -1
  176. package/build/lib/commands/web.js +866 -785
  177. package/build/lib/commands/web.js.map +1 -1
  178. package/build/lib/commands/xctest-record-screen.d.ts +63 -66
  179. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
  180. package/build/lib/commands/xctest-record-screen.js +103 -102
  181. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  182. package/build/lib/commands/xctest.d.ts +55 -51
  183. package/build/lib/commands/xctest.d.ts.map +1 -1
  184. package/build/lib/commands/xctest.js +116 -117
  185. package/build/lib/commands/xctest.js.map +1 -1
  186. package/build/lib/driver.d.ts +277 -1597
  187. package/build/lib/driver.d.ts.map +1 -1
  188. package/build/lib/driver.js +318 -235
  189. package/build/lib/driver.js.map +1 -1
  190. package/build/lib/execute-method-map.d.ts.map +1 -1
  191. package/build/lib/execute-method-map.js +9 -0
  192. package/build/lib/execute-method-map.js.map +1 -1
  193. package/lib/commands/active-app-info.js +12 -0
  194. package/lib/commands/alert.js +68 -65
  195. package/lib/commands/app-management.js +308 -301
  196. package/lib/commands/app-strings.js +24 -26
  197. package/lib/commands/appearance.js +54 -56
  198. package/lib/commands/audit.js +18 -20
  199. package/lib/commands/battery.js +35 -37
  200. package/lib/commands/biometric.js +44 -46
  201. package/lib/commands/certificate.js +226 -215
  202. package/lib/commands/clipboard.js +30 -32
  203. package/lib/commands/condition.js +98 -100
  204. package/lib/commands/content-size.js +36 -38
  205. package/lib/commands/context.js +495 -490
  206. package/lib/commands/deviceInfo.js +19 -20
  207. package/lib/commands/element.js +367 -357
  208. package/lib/commands/execute.js +72 -72
  209. package/lib/commands/file-movement.js +132 -134
  210. package/lib/commands/find.js +160 -159
  211. package/lib/commands/general.js +238 -231
  212. package/lib/commands/geolocation.js +6 -14
  213. package/lib/commands/gesture.js +525 -515
  214. package/lib/commands/increase-contrast.js +30 -32
  215. package/lib/commands/iohid.js +32 -34
  216. package/lib/commands/keyboard.js +49 -51
  217. package/lib/commands/keychains.js +12 -14
  218. package/lib/commands/localization.js +24 -26
  219. package/lib/commands/location.js +102 -104
  220. package/lib/commands/lock.js +38 -38
  221. package/lib/commands/log.js +197 -198
  222. package/lib/commands/memory.js +40 -42
  223. package/lib/commands/navigation.js +96 -100
  224. package/lib/commands/notifications.js +57 -59
  225. package/lib/commands/pasteboard.js +37 -39
  226. package/lib/commands/pcap.js +84 -86
  227. package/lib/commands/performance.js +132 -133
  228. package/lib/commands/permissions.js +67 -69
  229. package/lib/commands/proxy-helper.js +60 -61
  230. package/lib/commands/record-audio.js +115 -120
  231. package/lib/commands/recordscreen.js +145 -149
  232. package/lib/commands/screenshots.js +116 -116
  233. package/lib/commands/simctl.js +25 -29
  234. package/lib/commands/source.js +42 -46
  235. package/lib/commands/timeouts.js +59 -63
  236. package/lib/commands/web.js +932 -859
  237. package/lib/commands/xctest-record-screen.js +103 -105
  238. package/lib/commands/xctest.js +134 -139
  239. package/lib/driver.js +286 -235
  240. package/lib/execute-method-map.ts +9 -0
  241. package/npm-shrinkwrap.json +8 -8
  242. package/package.json +1 -1
  243. package/build/lib/commands/activeAppInfo.d.ts +0 -12
  244. package/build/lib/commands/activeAppInfo.d.ts.map +0 -1
  245. package/build/lib/commands/activeAppInfo.js +0 -15
  246. package/build/lib/commands/activeAppInfo.js.map +0 -1
  247. package/build/lib/commands/index.d.ts +0 -96
  248. package/build/lib/commands/index.d.ts.map +0 -1
  249. package/build/lib/commands/index.js +0 -100
  250. package/build/lib/commands/index.js.map +0 -1
  251. package/build/lib/cookies.d.ts +0 -15
  252. package/build/lib/cookies.d.ts.map +0 -1
  253. package/build/lib/cookies.js +0 -84
  254. package/build/lib/cookies.js.map +0 -1
  255. package/lib/commands/activeAppInfo.js +0 -14
  256. package/lib/commands/index.js +0 -95
  257. package/lib/cookies.js +0 -92
@@ -3,6 +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.supportedLogTypes = void 0;
7
+ exports.extractLogs = extractLogs;
8
+ exports.startLogCapture = startLogCapture;
9
+ exports.mobileStartLogsBroadcast = mobileStartLogsBroadcast;
10
+ exports.mobileStopLogsBroadcast = mobileStopLogsBroadcast;
6
11
  exports.assignBiDiLogListener = assignBiDiLogListener;
7
12
  const lodash_1 = __importDefault(require("lodash"));
8
13
  const bluebird_1 = __importDefault(require("bluebird"));
@@ -25,16 +30,6 @@ const models_1 = require("./bidi/models");
25
30
  const WEBSOCKET_ENDPOINT = (sessionId) => `${driver_1.DEFAULT_WS_PATHNAME_PREFIX}/session/${sessionId}/appium/device/syslog`;
26
31
  const COLOR_CODE_PATTERN = /\u001b\[(\d+(;\d+)*)?m/g; // eslint-disable-line no-control-regex
27
32
  const GET_SERVER_LOGS_FEATURE = 'get_server_logs';
28
- /**
29
- *
30
- * @param {Object} x
31
- * @returns {import('./types').LogEntry}
32
- */
33
- function nativeLogEntryToSeleniumEntry(x) {
34
- const msg = lodash_1.default.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`;
35
- return (0, helpers_1.toLogEntry)(lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''),
36
- /** @type {any} */ (x).timestamp ?? Date.now());
37
- }
38
33
  /**
39
34
  * @type {import('@appium/types').LogDefRecord}
40
35
  * @privateRemarks The return types for these getters should be specified
@@ -76,181 +71,179 @@ const LOG_NAMES_TO_CAPABILITY_NAMES_MAP = {
76
71
  safariNetwork: 'showSafariNetworkLog',
77
72
  enablePerformanceLogging: 'enablePerformanceLogging',
78
73
  };
79
- exports.default = {
80
- supportedLogTypes: SUPPORTED_LOG_TYPES,
81
- /**
82
- *
83
- * @param {XCUITestDriverLogTypes} logType
84
- * @param {Partial<Record<XCUITestDriverLogTypes,{getLogs(): Promise<any>}>>} [logsContainer]
85
- * @this {XCUITestDriver}
86
- */
87
- async extractLogs(logType, logsContainer = {}) {
88
- // make sure that we have logs at all
89
- // otherwise it's not been initialized
90
- if (lodash_1.default.isEmpty(logsContainer)) {
91
- throw new Error('No logs currently available. Is the device/simulator started?');
92
- }
93
- // If logs captured successfully send response with data, else send error
94
- const logObject = logsContainer[logType];
95
- if (logObject) {
96
- return await logObject.getLogs();
97
- }
98
- if (logType in LOG_NAMES_TO_CAPABILITY_NAMES_MAP) {
99
- throw new Error(`${logType} logs are not enabled. Make sure you've set a proper value ` +
100
- `to the 'appium:${LOG_NAMES_TO_CAPABILITY_NAMES_MAP[logType]}' capability.`);
101
- }
102
- throw new Error(`No logs of type '${logType}' found. Supported log types are: ${lodash_1.default.keys(SUPPORTED_LOG_TYPES)}.`);
103
- },
104
- /**
105
- * @this {XCUITestDriver}
106
- */
107
- async startLogCapture() {
108
- this.logs = this.logs || {};
109
- if (!lodash_1.default.isUndefined(this.logs.syslog) && this.logs.syslog.isCapturing) {
110
- this.log.warn('Trying to start iOS log capture but it has already started!');
111
- return true;
112
- }
113
- if (lodash_1.default.isUndefined(this.logs.syslog)) {
114
- [this.logs.crashlog,] = assignBiDiLogListener.bind(this)(new ios_crash_log_1.IOSCrashLog({
74
+ exports.supportedLogTypes = SUPPORTED_LOG_TYPES;
75
+ /**
76
+ *
77
+ * @param {XCUITestDriverLogTypes} logType
78
+ * @param {Partial<Record<XCUITestDriverLogTypes,{getLogs(): Promise<any>}>>} [logsContainer]
79
+ * @this {XCUITestDriver}
80
+ */
81
+ async function extractLogs(logType, logsContainer = {}) {
82
+ // make sure that we have logs at all
83
+ // otherwise it's not been initialized
84
+ if (lodash_1.default.isEmpty(logsContainer)) {
85
+ throw new Error('No logs currently available. Is the device/simulator started?');
86
+ }
87
+ // If logs captured successfully send response with data, else send error
88
+ const logObject = logsContainer[logType];
89
+ if (logObject) {
90
+ return await logObject.getLogs();
91
+ }
92
+ if (logType in LOG_NAMES_TO_CAPABILITY_NAMES_MAP) {
93
+ throw new Error(`${logType} logs are not enabled. Make sure you've set a proper value ` +
94
+ `to the 'appium:${LOG_NAMES_TO_CAPABILITY_NAMES_MAP[logType]}' capability.`);
95
+ }
96
+ throw new Error(`No logs of type '${logType}' found. Supported log types are: ${lodash_1.default.keys(SUPPORTED_LOG_TYPES)}.`);
97
+ }
98
+ /**
99
+ * @this {XCUITestDriver}
100
+ */
101
+ async function startLogCapture() {
102
+ this.logs = this.logs || {};
103
+ if (!lodash_1.default.isUndefined(this.logs.syslog) && this.logs.syslog.isCapturing) {
104
+ this.log.warn('Trying to start iOS log capture but it has already started!');
105
+ return true;
106
+ }
107
+ if (lodash_1.default.isUndefined(this.logs.syslog)) {
108
+ [this.logs.crashlog,] = assignBiDiLogListener.bind(this)(new ios_crash_log_1.IOSCrashLog({
109
+ sim: /** @type {import('appium-ios-simulator').Simulator} */ (this.device),
110
+ udid: this.isRealDevice() ? this.opts.udid : undefined,
111
+ log: this.log,
112
+ }), {
113
+ type: 'crashlog',
114
+ });
115
+ [this.logs.syslog,] = assignBiDiLogListener.bind(this)(this.isRealDevice()
116
+ ? new ios_device_log_1.IOSDeviceLog({
117
+ udid: this.opts.udid,
118
+ showLogs: this.opts.showIOSLog,
119
+ log: this.log,
120
+ })
121
+ : new ios_simulator_log_1.IOSSimulatorLog({
115
122
  sim: /** @type {import('appium-ios-simulator').Simulator} */ (this.device),
116
- udid: this.isRealDevice() ? this.opts.udid : undefined,
123
+ showLogs: this.opts.showIOSLog,
124
+ iosSimulatorLogsPredicate: this.opts.iosSimulatorLogsPredicate,
125
+ simulatorLogLevel: this.opts.simulatorLogLevel,
117
126
  log: this.log,
127
+ iosSyslogFile: this.opts.iosSyslogFile
118
128
  }), {
119
- type: 'crashlog',
129
+ type: 'syslog',
130
+ });
131
+ if (lodash_1.default.isBoolean(this.opts.showSafariConsoleLog)) {
132
+ [this.logs.safariConsole,] = assignBiDiLogListener.bind(this)(new safari_console_log_1.SafariConsoleLog({
133
+ showLogs: this.opts.showSafariConsoleLog,
134
+ log: this.log,
135
+ }), {
136
+ type: 'safariConsole',
137
+ });
138
+ }
139
+ if (lodash_1.default.isBoolean(this.opts.showSafariNetworkLog)) {
140
+ [this.logs.safariNetwork,] = assignBiDiLogListener.bind(this)(new safari_network_log_1.SafariNetworkLog({
141
+ showLogs: this.opts.showSafariNetworkLog,
142
+ log: this.log,
143
+ }), {
144
+ type: 'safariNetwork',
120
145
  });
121
- [this.logs.syslog,] = assignBiDiLogListener.bind(this)(this.isRealDevice()
122
- ? new ios_device_log_1.IOSDeviceLog({
123
- udid: this.opts.udid,
124
- showLogs: this.opts.showIOSLog,
125
- log: this.log,
126
- })
127
- : new ios_simulator_log_1.IOSSimulatorLog({
128
- sim: /** @type {import('appium-ios-simulator').Simulator} */ (this.device),
129
- showLogs: this.opts.showIOSLog,
130
- iosSimulatorLogsPredicate: this.opts.iosSimulatorLogsPredicate,
131
- simulatorLogLevel: this.opts.simulatorLogLevel,
132
- log: this.log,
133
- iosSyslogFile: this.opts.iosSyslogFile
134
- }), {
135
- type: 'syslog',
146
+ }
147
+ if (this.isFeatureEnabled(GET_SERVER_LOGS_FEATURE)) {
148
+ [, this._bidiServerLogListener] = assignBiDiLogListener.bind(this)(this.log.unwrap(), {
149
+ type: 'server',
150
+ srcEventName: 'log',
151
+ entryTransformer: nativeLogEntryToSeleniumEntry,
136
152
  });
137
- if (lodash_1.default.isBoolean(this.opts.showSafariConsoleLog)) {
138
- [this.logs.safariConsole,] = assignBiDiLogListener.bind(this)(new safari_console_log_1.SafariConsoleLog({
139
- showLogs: this.opts.showSafariConsoleLog,
140
- log: this.log,
141
- }), {
142
- type: 'safariConsole',
143
- });
144
- }
145
- if (lodash_1.default.isBoolean(this.opts.showSafariNetworkLog)) {
146
- [this.logs.safariNetwork,] = assignBiDiLogListener.bind(this)(new safari_network_log_1.SafariNetworkLog({
147
- showLogs: this.opts.showSafariNetworkLog,
148
- log: this.log,
149
- }), {
150
- type: 'safariNetwork',
151
- });
153
+ }
154
+ }
155
+ let didStartSyslog = false;
156
+ /** @type {Promise[]} */
157
+ const promises = [
158
+ (async () => {
159
+ try {
160
+ await this.logs.syslog?.startCapture();
161
+ didStartSyslog = true;
162
+ this.eventEmitter.emit('syslogStarted', this.logs.syslog);
152
163
  }
153
- if (this.isFeatureEnabled(GET_SERVER_LOGS_FEATURE)) {
154
- [, this._bidiServerLogListener] = assignBiDiLogListener.bind(this)(this.log.unwrap(), {
155
- type: 'server',
156
- srcEventName: 'log',
157
- entryTransformer: nativeLogEntryToSeleniumEntry,
158
- });
164
+ catch (err) {
165
+ this.log.debug(err.stack);
166
+ this.log.warn(`Continuing without capturing device logs: ${err.message}`);
159
167
  }
168
+ })(),
169
+ this.logs.crashlog?.startCapture() ?? bluebird_1.default.resolve(),
170
+ ];
171
+ await bluebird_1.default.all(promises);
172
+ return didStartSyslog;
173
+ }
174
+ /**
175
+ * Starts an iOS system logs broadcast websocket.
176
+ *
177
+ * The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
178
+ *
179
+ * If the websocket is already running, this command does nothing.
180
+ *
181
+ * Each connected webcoket listener will receive syslog lines as soon as they are visible to Appium.
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
+ */
186
+ async function mobileStartLogsBroadcast() {
187
+ const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
188
+ if (!lodash_1.default.isEmpty(await /** @type {import('@appium/types').AppiumServer} */ (this.server).getWebSocketHandlers(pathname))) {
189
+ this.log.debug(`The system logs broadcasting web socket server is already listening at ${pathname}`);
190
+ return;
191
+ }
192
+ this.log.info(`Assigning system logs broadcasting web socket server to ${pathname}`);
193
+ // https://github.com/websockets/ws/blob/master/doc/ws.md
194
+ const wss = new ws_1.default.Server({
195
+ noServer: true,
196
+ });
197
+ wss.on('connection', (ws, req) => {
198
+ if (req) {
199
+ const remoteIp = lodash_1.default.isEmpty(req.headers['x-forwarded-for'])
200
+ ? req.connection?.remoteAddress
201
+ : req.headers['x-forwarded-for'];
202
+ this.log.debug(`Established a new system logs listener web socket connection from ${remoteIp}`);
160
203
  }
161
- let didStartSyslog = false;
162
- /** @type {Promise[]} */
163
- const promises = [
164
- (async () => {
165
- try {
166
- await this.logs.syslog?.startCapture();
167
- didStartSyslog = true;
168
- this.eventEmitter.emit('syslogStarted', this.logs.syslog);
169
- }
170
- catch (err) {
171
- this.log.debug(err.stack);
172
- this.log.warn(`Continuing without capturing device logs: ${err.message}`);
204
+ else {
205
+ this.log.debug('Established a new system logs listener web socket connection');
206
+ }
207
+ if (lodash_1.default.isEmpty(this._syslogWebsocketListener)) {
208
+ this._syslogWebsocketListener = (logRecord) => {
209
+ if (ws?.readyState === ws_1.default.OPEN) {
210
+ ws.send(logRecord.message);
173
211
  }
174
- })(),
175
- this.logs.crashlog?.startCapture() ?? bluebird_1.default.resolve(),
176
- ];
177
- await bluebird_1.default.all(promises);
178
- return didStartSyslog;
179
- },
180
- /**
181
- * Starts an iOS system logs broadcast websocket.
182
- *
183
- * The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
184
- *
185
- * If the websocket is already running, this command does nothing.
186
- *
187
- * Each connected webcoket listener will receive syslog lines as soon as they are visible to Appium.
188
- * @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
189
- * @returns {Promise<void>}
190
- * @this {XCUITestDriver}
191
- */
192
- async mobileStartLogsBroadcast() {
193
- const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
194
- if (!lodash_1.default.isEmpty(await /** @type {import('@appium/types').AppiumServer} */ (this.server).getWebSocketHandlers(pathname))) {
195
- this.log.debug(`The system logs broadcasting web socket server is already listening at ${pathname}`);
196
- return;
212
+ };
197
213
  }
198
- this.log.info(`Assigning system logs broadcasting web socket server to ${pathname}`);
199
- // https://github.com/websockets/ws/blob/master/doc/ws.md
200
- const wss = new ws_1.default.Server({
201
- noServer: true,
202
- });
203
- wss.on('connection', (ws, req) => {
204
- if (req) {
205
- const remoteIp = lodash_1.default.isEmpty(req.headers['x-forwarded-for'])
206
- ? req.connection?.remoteAddress
207
- : req.headers['x-forwarded-for'];
208
- this.log.debug(`Established a new system logs listener web socket connection from ${remoteIp}`);
214
+ this.logs.syslog?.on('output', this._syslogWebsocketListener);
215
+ ws.on('close', (code, reason) => {
216
+ if (!lodash_1.default.isEmpty(this._syslogWebsocketListener)) {
217
+ this.logs.syslog?.removeListener('output', this._syslogWebsocketListener);
218
+ this._syslogWebsocketListener = null;
209
219
  }
210
- else {
211
- this.log.debug('Established a new system logs listener web socket connection');
220
+ let closeMsg = 'System logs listener web socket is closed.';
221
+ if (!lodash_1.default.isEmpty(code)) {
222
+ closeMsg += ` Code: ${code}.`;
212
223
  }
213
- if (lodash_1.default.isEmpty(this._syslogWebsocketListener)) {
214
- this._syslogWebsocketListener = (logRecord) => {
215
- if (ws?.readyState === ws_1.default.OPEN) {
216
- ws.send(logRecord.message);
217
- }
218
- };
224
+ if (!lodash_1.default.isEmpty(reason)) {
225
+ closeMsg += ` Reason: ${reason.toString()}.`;
219
226
  }
220
- this.logs.syslog?.on('output', this._syslogWebsocketListener);
221
- ws.on('close', (code, reason) => {
222
- if (!lodash_1.default.isEmpty(this._syslogWebsocketListener)) {
223
- this.logs.syslog?.removeListener('output', this._syslogWebsocketListener);
224
- this._syslogWebsocketListener = null;
225
- }
226
- let closeMsg = 'System logs listener web socket is closed.';
227
- if (!lodash_1.default.isEmpty(code)) {
228
- closeMsg += ` Code: ${code}.`;
229
- }
230
- if (!lodash_1.default.isEmpty(reason)) {
231
- closeMsg += ` Reason: ${reason.toString()}.`;
232
- }
233
- this.log.debug(closeMsg);
234
- });
227
+ this.log.debug(closeMsg);
235
228
  });
236
- await /** @type {AppiumServer} */ (this.server).addWebSocketHandler(pathname,
237
- /** @type {import('@appium/types').WSServer} */ (wss));
238
- },
239
- /**
240
- * Stops the syslog broadcasting wesocket server previously started by `mobile: startLogsBroadcast`.
241
- * If no websocket server is running, this command does nothing.
242
- * @this {XCUITestDriver}
243
- * @returns {Promise<void>}
244
- */
245
- async mobileStopLogsBroadcast() {
246
- const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
247
- if (lodash_1.default.isEmpty(await /** @type {AppiumServer} */ (this.server).getWebSocketHandlers(pathname))) {
248
- return;
249
- }
250
- this.log.debug('Stopping the system logs broadcasting web socket server');
251
- await /** @type {AppiumServer} */ (this.server).removeWebSocketHandler(pathname);
252
- },
253
- };
229
+ });
230
+ await /** @type {AppiumServer} */ (this.server).addWebSocketHandler(pathname,
231
+ /** @type {import('@appium/types').WSServer} */ (wss));
232
+ }
233
+ /**
234
+ * Stops the syslog broadcasting wesocket server previously started by `mobile: startLogsBroadcast`.
235
+ * If no websocket server is running, this command does nothing.
236
+ * @this {XCUITestDriver}
237
+ * @returns {Promise<void>}
238
+ */
239
+ async function mobileStopLogsBroadcast() {
240
+ const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
241
+ if (lodash_1.default.isEmpty(await /** @type {AppiumServer} */ (this.server).getWebSocketHandlers(pathname))) {
242
+ return;
243
+ }
244
+ this.log.debug('Stopping the system logs broadcasting web socket server');
245
+ await /** @type {AppiumServer} */ (this.server).removeWebSocketHandler(pathname);
246
+ }
254
247
  /**
255
248
  * https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
256
249
  *
@@ -269,6 +262,16 @@ function assignBiDiLogListener(logEmitter, properties) {
269
262
  logEmitter.on(srcEventName, listener);
270
263
  return [logEmitter, listener];
271
264
  }
265
+ /**
266
+ *
267
+ * @param {Object} x
268
+ * @returns {import('./types').LogEntry}
269
+ */
270
+ function nativeLogEntryToSeleniumEntry(x) {
271
+ 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());
274
+ }
272
275
  /**
273
276
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
274
277
  * @typedef {keyof typeof SUPPORTED_LOG_TYPES} XCUITestDriverLogTypes
@@ -1 +1 @@
1
- {"version":3,"file":"log.js","sourceRoot":"","sources":["../../../lib/commands/log.js"],"names":[],"mappings":";;;;;AA4SA,sDAaC;AAzTD,oDAAuB;AACvB,wDAAyB;AACzB,0CAAyD;AACzD,+DAAwD;AACxD,uEAAgE;AAChE,iEAA0D;AAC1D,4CAA2B;AAC3B,yEAAoE;AACpE,yEAAoE;AACpE,mDAAmD;AACnD,oCAAsC;AACtC,gDAAmD;AACnD,0CAAuD;AAEvD;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,EAAE,CACvC,GAAG,mCAA0B,Y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AC5E,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;;;;GAIG;AACH,SAAS,6BAA6B,CAAE,CAAC;IACvC,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;IACtC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,CAC/C,CAAC;AACJ,CAAC;AAED;;;;GAIG;AAEH;;;;;;GAMG"}
@@ -1,14 +1,11 @@
1
- declare namespace _default {
2
- /**
3
- * Simulates Low Memory warning on the given application
4
- *
5
- * @since Xcode 15
6
- * @param {string} bundleId - The bundle identifier of the target app. The app must be running
7
- * @this {XCUITestDriver}
8
- * @throws {Error} if the app is not running or is not installed
9
- */
10
- function mobileSendMemoryWarning(this: import("../driver").XCUITestDriver, bundleId: string): Promise<void>;
11
- }
12
- export default _default;
1
+ /**
2
+ * Simulates Low Memory warning on the given application
3
+ *
4
+ * @since Xcode 15
5
+ * @param {string} bundleId - The bundle identifier of the target app. The app must be running
6
+ * @this {XCUITestDriver}
7
+ * @throws {Error} if the app is not running or is not installed
8
+ */
9
+ export function mobileSendMemoryWarning(this: import("../driver").XCUITestDriver, bundleId: string): Promise<void>;
13
10
  export type XCUITestDriver = import("../driver").XCUITestDriver;
14
11
  //# sourceMappingURL=memory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../lib/commands/memory.js"],"names":[],"mappings":";IAIE;;;;;;;OAOG;IACH,qFAJW,MAAM,iBAuChB;;;6BAIU,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../lib/commands/memory.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,4FAJW,MAAM,iBAuChB;6BAGY,OAAO,WAAW,EAAE,cAAc"}
@@ -3,47 +3,46 @@ 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.mobileSendMemoryWarning = mobileSendMemoryWarning;
6
7
  const lodash_1 = __importDefault(require("lodash"));
7
8
  const driver_1 = require("appium/driver");
8
- exports.default = {
9
- /**
10
- * Simulates Low Memory warning on the given application
11
- *
12
- * @since Xcode 15
13
- * @param {string} bundleId - The bundle identifier of the target app. The app must be running
14
- * @this {XCUITestDriver}
15
- * @throws {Error} if the app is not running or is not installed
16
- */
17
- async mobileSendMemoryWarning(bundleId) {
18
- if (!this.isRealDevice()) {
19
- throw new Error('Memory warning simulation is only supported on real devices');
20
- }
21
- const device = /** @type {import('../real-device').RealDevice} */ (this.device);
22
- const appInfos = await device.devicectl.listApps(bundleId);
23
- if (lodash_1.default.isEmpty(appInfos)) {
24
- throw new driver_1.errors.InvalidArgumentError(`The application identified by ${bundleId} cannot be found on the device. Is it installed?`);
25
- }
26
- // This regexp tries to match the process name of the main bundle executable.
27
- // For example, if 'url' contains something like
28
- // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/`
29
- // and the following processes might be running:
30
- // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/Target`
31
- // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/PlugIns/WidgetExtension.appex/WidgetExtension`
32
- // then we only want to match the first one.
33
- // Unfortunately devicectl does not provide more info which would
34
- // allow to connect a bundle id to a process id.
35
- const pattern = new RegExp(`^${lodash_1.default.escapeRegExp(appInfos[0].url)}[^/]+$`);
36
- /** @type {number[]} */
37
- const pids = (await device.devicectl.listProcesses())
38
- .filter(({ executable }) => pattern.test(executable))
39
- .map(({ processIdentifier }) => processIdentifier);
40
- if (lodash_1.default.isEmpty(pids)) {
41
- throw new driver_1.errors.InvalidArgumentError(`The application identified by ${bundleId} must be running in order to simulate the Low Memory warning`);
42
- }
43
- this.log.info(`Emulating Low Memory warning for the process id ${pids[0]}, bundle id ${bundleId}`);
44
- await device.devicectl.sendMemoryWarning(pids[0]);
9
+ /**
10
+ * Simulates Low Memory warning on the given application
11
+ *
12
+ * @since Xcode 15
13
+ * @param {string} bundleId - The bundle identifier of the target app. The app must be running
14
+ * @this {XCUITestDriver}
15
+ * @throws {Error} if the app is not running or is not installed
16
+ */
17
+ async function mobileSendMemoryWarning(bundleId) {
18
+ if (!this.isRealDevice()) {
19
+ throw new Error('Memory warning simulation is only supported on real devices');
45
20
  }
46
- };
21
+ const device = /** @type {import('../real-device').RealDevice} */ (this.device);
22
+ const appInfos = await device.devicectl.listApps(bundleId);
23
+ if (lodash_1.default.isEmpty(appInfos)) {
24
+ throw new driver_1.errors.InvalidArgumentError(`The application identified by ${bundleId} cannot be found on the device. Is it installed?`);
25
+ }
26
+ // This regexp tries to match the process name of the main bundle executable.
27
+ // For example, if 'url' contains something like
28
+ // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/`
29
+ // and the following processes might be running:
30
+ // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/Target`
31
+ // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/PlugIns/WidgetExtension.appex/WidgetExtension`
32
+ // then we only want to match the first one.
33
+ // Unfortunately devicectl does not provide more info which would
34
+ // allow to connect a bundle id to a process id.
35
+ const pattern = new RegExp(`^${lodash_1.default.escapeRegExp(appInfos[0].url)}[^/]+$`);
36
+ /** @type {number[]} */
37
+ const pids = (await device.devicectl.listProcesses())
38
+ .filter(({ executable }) => pattern.test(executable))
39
+ .map(({ processIdentifier }) => processIdentifier);
40
+ if (lodash_1.default.isEmpty(pids)) {
41
+ throw new driver_1.errors.InvalidArgumentError(`The application identified by ${bundleId} must be running in order to simulate the Low Memory warning`);
42
+ }
43
+ this.log.info(`Emulating Low Memory warning for the process id ${pids[0]}, bundle id ${bundleId}`);
44
+ await device.devicectl.sendMemoryWarning(pids[0]);
45
+ }
47
46
  /**
48
47
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
49
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../lib/commands/memory.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,0CAAuC;AAEvC,kBAAe;IACb;;;;;;;OAOG;IACH,KAAK,CAAC,uBAAuB,CAAC,QAAQ;QACpC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QAED,MAAM,MAAM,GAAG,kDAAkD,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEhF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,iCAAiC,QAAQ,kDAAkD,CAC5F,CAAC;QACJ,CAAC;QAED,6EAA6E;QAC7E,gDAAgD;QAChD,uGAAuG;QAC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
- * @this {XCUITestDriver}
4
- */
5
- function back(this: import("../driver").XCUITestDriver): Promise<void>;
6
- /**
7
- * @this {XCUITestDriver}
8
- */
9
- function forward(this: import("../driver").XCUITestDriver): Promise<void>;
10
- /**
11
- * @this {XCUITestDriver}
12
- */
13
- function closeWindow(this: import("../driver").XCUITestDriver): Promise<any>;
14
- /**
15
- * Opens the given URL with the default application assigned to handle it based on the URL
16
- * scheme, or the application provided as an optional parameter
17
- *
18
- * (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
19
- *
20
- * @param {string} url - the URL to be opened, e.g. `myscheme://yolo`
21
- * @param {string} [bundleId] - the application to open the given URL with. If not provided, then
22
- * the application assigned by the operating system to handle URLs of the appropriate type
23
- * @returns {Promise<void>}
24
- * @since 4.17
25
- * @this {XCUITestDriver}
26
- */
27
- function mobileDeepLink(this: import("../driver").XCUITestDriver, url: string, bundleId?: string): Promise<void>;
28
- /**
29
- * @this {XCUITestDriver}
30
- */
31
- function nativeBack(this: import("../driver").XCUITestDriver): Promise<unknown>;
32
- }
33
- export default _default;
1
+ /**
2
+ * @this {XCUITestDriver}
3
+ */
4
+ export function back(this: import("../driver").XCUITestDriver): Promise<void>;
5
+ /**
6
+ * @this {XCUITestDriver}
7
+ */
8
+ export function forward(this: import("../driver").XCUITestDriver): Promise<void>;
9
+ /**
10
+ * @this {XCUITestDriver}
11
+ */
12
+ export function closeWindow(this: import("../driver").XCUITestDriver): Promise<any>;
13
+ /**
14
+ * Opens the given URL with the default application assigned to handle it based on the URL
15
+ * scheme, or the application provided as an optional parameter
16
+ *
17
+ * (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
18
+ *
19
+ * @param {string} url - the URL to be opened, e.g. `myscheme://yolo`
20
+ * @param {string} [bundleId] - the application to open the given URL with. If not provided, then
21
+ * the application assigned by the operating system to handle URLs of the appropriate type
22
+ * @returns {Promise<void>}
23
+ * @since 4.17
24
+ * @this {XCUITestDriver}
25
+ */
26
+ export function mobileDeepLink(this: import("../driver").XCUITestDriver, url: string, bundleId?: string): Promise<void>;
27
+ /**
28
+ * @this {XCUITestDriver}
29
+ */
30
+ export function nativeBack(this: import("../driver").XCUITestDriver): Promise<unknown>;
34
31
  export type XCUITestDriver = import("../driver").XCUITestDriver;
35
32
  export type DeepLinkOptions = {
36
33
  /**