@limrun/appium-xcuitest-driver 10.11.0-lim.4 → 10.14.6-lim.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 (279) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/build/lib/commands/active-app-info.d.ts +4 -3
  3. package/build/lib/commands/active-app-info.d.ts.map +1 -1
  4. package/build/lib/commands/active-app-info.js +2 -3
  5. package/build/lib/commands/active-app-info.js.map +1 -1
  6. package/build/lib/commands/alert.d.ts +26 -31
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +20 -29
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +99 -76
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +83 -73
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/app-strings.d.ts +6 -7
  15. package/build/lib/commands/app-strings.d.ts.map +1 -1
  16. package/build/lib/commands/app-strings.js +3 -8
  17. package/build/lib/commands/app-strings.js.map +1 -1
  18. package/build/lib/commands/appearance.d.ts +7 -9
  19. package/build/lib/commands/appearance.d.ts.map +1 -1
  20. package/build/lib/commands/appearance.js +13 -19
  21. package/build/lib/commands/appearance.js.map +1 -1
  22. package/build/lib/commands/audit.d.ts +5 -33
  23. package/build/lib/commands/audit.d.ts.map +1 -1
  24. package/build/lib/commands/audit.js +3 -16
  25. package/build/lib/commands/audit.js.map +1 -1
  26. package/build/lib/commands/battery.d.ts +4 -4
  27. package/build/lib/commands/battery.d.ts.map +1 -1
  28. package/build/lib/commands/battery.js +3 -7
  29. package/build/lib/commands/battery.js.map +1 -1
  30. package/build/lib/commands/biometric.d.ts +12 -14
  31. package/build/lib/commands/biometric.d.ts.map +1 -1
  32. package/build/lib/commands/biometric.js +10 -19
  33. package/build/lib/commands/biometric.js.map +1 -1
  34. package/build/lib/commands/certificate.d.ts +14 -19
  35. package/build/lib/commands/certificate.d.ts.map +1 -1
  36. package/build/lib/commands/certificate.js +24 -31
  37. package/build/lib/commands/certificate.js.map +1 -1
  38. package/build/lib/commands/clipboard.d.ts +9 -11
  39. package/build/lib/commands/clipboard.d.ts.map +1 -1
  40. package/build/lib/commands/clipboard.js +8 -13
  41. package/build/lib/commands/clipboard.js.map +1 -1
  42. package/build/lib/commands/condition.d.ts +9 -72
  43. package/build/lib/commands/condition.d.ts.map +1 -1
  44. package/build/lib/commands/condition.js +5 -66
  45. package/build/lib/commands/condition.js.map +1 -1
  46. package/build/lib/commands/content-size.d.ts +16 -19
  47. package/build/lib/commands/content-size.d.ts.map +1 -1
  48. package/build/lib/commands/content-size.js +14 -22
  49. package/build/lib/commands/content-size.js.map +1 -1
  50. package/build/lib/commands/context.d.ts +130 -161
  51. package/build/lib/commands/context.d.ts.map +1 -1
  52. package/build/lib/commands/context.js +123 -108
  53. package/build/lib/commands/context.js.map +1 -1
  54. package/build/lib/commands/device-info.d.ts +13 -0
  55. package/build/lib/commands/device-info.d.ts.map +1 -0
  56. package/build/lib/commands/device-info.js +20 -0
  57. package/build/lib/commands/device-info.js.map +1 -0
  58. package/build/lib/commands/element.d.ts +83 -67
  59. package/build/lib/commands/element.d.ts.map +1 -1
  60. package/build/lib/commands/element.js +111 -134
  61. package/build/lib/commands/element.js.map +1 -1
  62. package/build/lib/commands/execute.d.ts +10 -22
  63. package/build/lib/commands/execute.d.ts.map +1 -1
  64. package/build/lib/commands/execute.js +13 -29
  65. package/build/lib/commands/execute.js.map +1 -1
  66. package/build/lib/commands/file-movement.d.ts +31 -42
  67. package/build/lib/commands/file-movement.d.ts.map +1 -1
  68. package/build/lib/commands/file-movement.js +146 -205
  69. package/build/lib/commands/file-movement.js.map +1 -1
  70. package/build/lib/commands/find.d.ts +20 -12
  71. package/build/lib/commands/find.d.ts.map +1 -1
  72. package/build/lib/commands/find.js +27 -65
  73. package/build/lib/commands/find.js.map +1 -1
  74. package/build/lib/commands/general.d.ts +84 -80
  75. package/build/lib/commands/general.d.ts.map +1 -1
  76. package/build/lib/commands/general.js +67 -54
  77. package/build/lib/commands/general.js.map +1 -1
  78. package/build/lib/commands/geolocation.d.ts +16 -36
  79. package/build/lib/commands/geolocation.d.ts.map +1 -1
  80. package/build/lib/commands/geolocation.js +8 -25
  81. package/build/lib/commands/geolocation.js.map +1 -1
  82. package/build/lib/commands/gesture.d.ts +103 -119
  83. package/build/lib/commands/gesture.d.ts.map +1 -1
  84. package/build/lib/commands/gesture.js +98 -138
  85. package/build/lib/commands/gesture.js.map +1 -1
  86. package/build/lib/commands/increase-contrast.d.ts +10 -13
  87. package/build/lib/commands/increase-contrast.d.ts.map +1 -1
  88. package/build/lib/commands/increase-contrast.js +8 -16
  89. package/build/lib/commands/increase-contrast.js.map +1 -1
  90. package/build/lib/commands/iohid.d.ts +6 -1359
  91. package/build/lib/commands/iohid.d.ts.map +1 -1
  92. package/build/lib/commands/iohid.js +5 -10
  93. package/build/lib/commands/iohid.js.map +1 -1
  94. package/build/lib/commands/keyboard.d.ts +16 -13
  95. package/build/lib/commands/keyboard.d.ts.map +1 -1
  96. package/build/lib/commands/keyboard.js +14 -18
  97. package/build/lib/commands/keyboard.js.map +1 -1
  98. package/build/lib/commands/keychains.d.ts +2 -2
  99. package/build/lib/commands/keychains.d.ts.map +1 -1
  100. package/build/lib/commands/keychains.js +1 -4
  101. package/build/lib/commands/keychains.js.map +1 -1
  102. package/build/lib/commands/localization.d.ts +7 -6
  103. package/build/lib/commands/localization.d.ts.map +1 -1
  104. package/build/lib/commands/localization.js +7 -8
  105. package/build/lib/commands/localization.js.map +1 -1
  106. package/build/lib/commands/location.d.ts +8 -11
  107. package/build/lib/commands/location.d.ts.map +1 -1
  108. package/build/lib/commands/location.js +7 -15
  109. package/build/lib/commands/location.js.map +1 -1
  110. package/build/lib/commands/lock.d.ts +6 -10
  111. package/build/lib/commands/lock.d.ts.map +1 -1
  112. package/build/lib/commands/lock.js +3 -10
  113. package/build/lib/commands/lock.js.map +1 -1
  114. package/build/lib/commands/log.d.ts +42 -44
  115. package/build/lib/commands/log.d.ts.map +1 -1
  116. package/build/lib/commands/log.js +32 -53
  117. package/build/lib/commands/log.js.map +1 -1
  118. package/build/lib/commands/memory.d.ts +4 -5
  119. package/build/lib/commands/memory.d.ts.map +1 -1
  120. package/build/lib/commands/memory.js +3 -8
  121. package/build/lib/commands/memory.js.map +1 -1
  122. package/build/lib/commands/navigation.d.ts +14 -26
  123. package/build/lib/commands/navigation.d.ts.map +1 -1
  124. package/build/lib/commands/navigation.js +22 -32
  125. package/build/lib/commands/navigation.js.map +1 -1
  126. package/build/lib/commands/notifications.d.ts +10 -10
  127. package/build/lib/commands/notifications.d.ts.map +1 -1
  128. package/build/lib/commands/notifications.js +8 -12
  129. package/build/lib/commands/notifications.js.map +1 -1
  130. package/build/lib/commands/pasteboard.d.ts +9 -10
  131. package/build/lib/commands/pasteboard.d.ts.map +1 -1
  132. package/build/lib/commands/pasteboard.js +8 -13
  133. package/build/lib/commands/pasteboard.js.map +1 -1
  134. package/build/lib/commands/pcap.d.ts +18 -38
  135. package/build/lib/commands/pcap.d.ts.map +1 -1
  136. package/build/lib/commands/pcap.js +9 -14
  137. package/build/lib/commands/pcap.js.map +1 -1
  138. package/build/lib/commands/performance.d.ts +36 -55
  139. package/build/lib/commands/performance.d.ts.map +1 -1
  140. package/build/lib/commands/performance.js +93 -86
  141. package/build/lib/commands/performance.js.map +1 -1
  142. package/build/lib/commands/permissions.d.ts +15 -17
  143. package/build/lib/commands/permissions.d.ts.map +1 -1
  144. package/build/lib/commands/permissions.js +12 -18
  145. package/build/lib/commands/permissions.js.map +1 -1
  146. package/build/lib/commands/proxy-helper.d.ts +11 -11
  147. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  148. package/build/lib/commands/proxy-helper.js +15 -24
  149. package/build/lib/commands/proxy-helper.js.map +1 -1
  150. package/build/lib/commands/record-audio.d.ts +25 -52
  151. package/build/lib/commands/record-audio.d.ts.map +1 -1
  152. package/build/lib/commands/record-audio.js +17 -19
  153. package/build/lib/commands/record-audio.js.map +1 -1
  154. package/build/lib/commands/recordscreen.d.ts +31 -62
  155. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  156. package/build/lib/commands/recordscreen.js +29 -28
  157. package/build/lib/commands/recordscreen.js.map +1 -1
  158. package/build/lib/commands/screenshots.d.ts +15 -9
  159. package/build/lib/commands/screenshots.d.ts.map +1 -1
  160. package/build/lib/commands/screenshots.js +16 -16
  161. package/build/lib/commands/screenshots.js.map +1 -1
  162. package/build/lib/commands/simctl.d.ts +16 -22
  163. package/build/lib/commands/simctl.d.ts.map +1 -1
  164. package/build/lib/commands/simctl.js +13 -17
  165. package/build/lib/commands/simctl.js.map +1 -1
  166. package/build/lib/commands/source.d.ts +10 -8
  167. package/build/lib/commands/source.d.ts.map +1 -1
  168. package/build/lib/commands/source.js +11 -14
  169. package/build/lib/commands/source.js.map +1 -1
  170. package/build/lib/commands/timeouts.d.ts +25 -32
  171. package/build/lib/commands/timeouts.d.ts.map +1 -1
  172. package/build/lib/commands/timeouts.js +19 -15
  173. package/build/lib/commands/timeouts.js.map +1 -1
  174. package/build/lib/commands/types.d.ts +80 -0
  175. package/build/lib/commands/types.d.ts.map +1 -1
  176. package/build/lib/commands/web.d.ts +199 -202
  177. package/build/lib/commands/web.d.ts.map +1 -1
  178. package/build/lib/commands/web.js +216 -175
  179. package/build/lib/commands/web.js.map +1 -1
  180. package/build/lib/commands/xctest-record-screen.d.ts +17 -47
  181. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
  182. package/build/lib/commands/xctest-record-screen.js +28 -59
  183. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  184. package/build/lib/commands/xctest.d.ts +37 -37
  185. package/build/lib/commands/xctest.d.ts.map +1 -1
  186. package/build/lib/commands/xctest.js +38 -50
  187. package/build/lib/commands/xctest.js.map +1 -1
  188. package/build/lib/desired-caps.js +1 -1
  189. package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -1
  190. package/build/lib/device/log/ios-simulator-log.js +2 -0
  191. package/build/lib/device/log/ios-simulator-log.js.map +1 -1
  192. package/build/lib/device/simulator-management.d.ts.map +1 -1
  193. package/build/lib/device/simulator-management.js +0 -2
  194. package/build/lib/device/simulator-management.js.map +1 -1
  195. package/build/lib/doctor/optional-checks.d.ts +0 -9
  196. package/build/lib/doctor/optional-checks.d.ts.map +1 -1
  197. package/build/lib/doctor/optional-checks.js +1 -30
  198. package/build/lib/doctor/optional-checks.js.map +1 -1
  199. package/build/lib/driver.d.ts +6 -5
  200. package/build/lib/driver.d.ts.map +1 -1
  201. package/build/lib/driver.js +16 -14
  202. package/build/lib/driver.js.map +1 -1
  203. package/build/lib/execute-method-map.d.ts.map +1 -1
  204. package/build/lib/execute-method-map.js +0 -9
  205. package/build/lib/execute-method-map.js.map +1 -1
  206. package/lib/commands/active-app-info.ts +15 -0
  207. package/lib/commands/alert.ts +98 -0
  208. package/lib/commands/app-management.ts +414 -0
  209. package/lib/commands/{app-strings.js → app-strings.ts} +10 -9
  210. package/lib/commands/appearance.ts +70 -0
  211. package/lib/commands/audit.ts +25 -0
  212. package/lib/commands/{battery.js → battery.ts} +10 -12
  213. package/lib/commands/biometric.ts +52 -0
  214. package/lib/commands/{certificate.js → certificate.ts} +55 -50
  215. package/lib/commands/clipboard.ts +37 -0
  216. package/lib/commands/{condition.js → condition.ts} +21 -77
  217. package/lib/commands/content-size.ts +67 -0
  218. package/lib/commands/{context.js → context.ts} +174 -146
  219. package/lib/commands/device-info.ts +24 -0
  220. package/lib/commands/element.ts +419 -0
  221. package/lib/commands/{execute.js → execute.ts} +42 -38
  222. package/lib/commands/{file-movement.js → file-movement.ts} +212 -235
  223. package/lib/commands/find.ts +277 -0
  224. package/lib/commands/{general.js → general.ts} +102 -77
  225. package/lib/commands/geolocation.ts +55 -0
  226. package/lib/commands/{gesture.js → gesture.ts} +225 -183
  227. package/lib/commands/increase-contrast.ts +49 -0
  228. package/lib/commands/{iohid.js → iohid.ts} +15 -13
  229. package/lib/commands/keyboard.ts +70 -0
  230. package/lib/commands/keychains.ts +16 -0
  231. package/lib/commands/{localization.js → localization.ts} +22 -12
  232. package/lib/commands/{location.js → location.ts} +19 -22
  233. package/lib/commands/lock.ts +43 -0
  234. package/lib/commands/{log.js → log.ts} +68 -68
  235. package/lib/commands/{memory.js → memory.ts} +9 -9
  236. package/lib/commands/{navigation.js → navigation.ts} +42 -39
  237. package/lib/commands/{notifications.js → notifications.ts} +22 -14
  238. package/lib/commands/pasteboard.ts +44 -0
  239. package/lib/commands/{pcap.js → pcap.ts} +28 -28
  240. package/lib/commands/{performance.js → performance.ts} +133 -114
  241. package/lib/commands/permissions.ts +90 -0
  242. package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
  243. package/lib/commands/{record-audio.js → record-audio.ts} +35 -33
  244. package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
  245. package/lib/commands/{screenshots.js → screenshots.ts} +27 -21
  246. package/lib/commands/simctl.ts +82 -0
  247. package/lib/commands/{source.js → source.ts} +23 -20
  248. package/lib/commands/timeouts.ts +95 -0
  249. package/lib/commands/types.ts +86 -0
  250. package/lib/commands/{web.js → web.ts} +314 -264
  251. package/lib/commands/{xctest-record-screen.js → xctest-record-screen.ts} +54 -71
  252. package/lib/commands/{xctest.js → xctest.ts} +78 -71
  253. package/lib/desired-caps.ts +1 -1
  254. package/lib/device/log/ios-simulator-log.ts +2 -0
  255. package/lib/device/simulator-management.ts +0 -2
  256. package/lib/doctor/optional-checks.ts +0 -33
  257. package/lib/driver.ts +19 -17
  258. package/lib/execute-method-map.ts +0 -9
  259. package/package.json +6 -6
  260. package/lib/commands/active-app-info.js +0 -12
  261. package/lib/commands/alert.js +0 -88
  262. package/lib/commands/app-management.js +0 -346
  263. package/lib/commands/appearance.js +0 -71
  264. package/lib/commands/audit.js +0 -31
  265. package/lib/commands/biometric.js +0 -52
  266. package/lib/commands/clipboard.js +0 -35
  267. package/lib/commands/content-size.js +0 -68
  268. package/lib/commands/deviceInfo.js +0 -27
  269. package/lib/commands/element.js +0 -423
  270. package/lib/commands/find.js +0 -205
  271. package/lib/commands/geolocation.js +0 -56
  272. package/lib/commands/increase-contrast.js +0 -50
  273. package/lib/commands/keyboard.js +0 -62
  274. package/lib/commands/keychains.js +0 -17
  275. package/lib/commands/lock.js +0 -46
  276. package/lib/commands/pasteboard.js +0 -43
  277. package/lib/commands/permissions.js +0 -85
  278. package/lib/commands/simctl.js +0 -71
  279. package/lib/commands/timeouts.js +0 -68
@@ -1,12 +1,16 @@
1
1
  import _ from 'lodash';
2
2
  import js2xml from 'js2xmlparser2';
3
+ import type {XCUITestDriver} from '../driver';
4
+ import type {SourceFormat} from './types';
3
5
 
4
6
  const APPIUM_AUT_TAG = 'AppiumAUT';
5
7
 
6
8
  /**
7
- * @this {XCUITestDriver}
9
+ * Retrieves the page source of the current application.
10
+ *
11
+ * @returns The page source as XML or HTML string
8
12
  */
9
- export async function getPageSource() {
13
+ export async function getPageSource(this: XCUITestDriver): Promise<string> {
10
14
  if (this.isWebContext()) {
11
15
  const script = 'return document.documentElement.outerHTML';
12
16
  return await this.executeAtom('execute_script', [script, []]);
@@ -28,14 +32,17 @@ export async function getPageSource() {
28
32
  /**
29
33
  * Retrieve the source tree of the current page in XML or JSON format.
30
34
  *
31
- * @param {import('./types').SourceFormat} format - Page tree source representation format.
32
- * @param {string} [excludedAttributes] A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
35
+ * @param format - Page tree source representation format.
36
+ * @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
33
37
  * @privateRemarks Why isn't `excludedAttributes` an array?
34
- * @returns {Promise<string>} The source tree of the current page in the given format.
35
- * @this {XCUITestDriver}
38
+ * @returns The source tree of the current page in the given format.
36
39
  */
37
- export async function mobileGetSource(format = 'xml', excludedAttributes) {
38
- const paramsMap = {
40
+ export async function mobileGetSource(
41
+ this: XCUITestDriver,
42
+ format: SourceFormat = 'xml',
43
+ excludedAttributes?: string,
44
+ ): Promise<string> {
45
+ const paramsMap: Record<string, string> = {
39
46
  format,
40
47
  scope: APPIUM_AUT_TAG,
41
48
  };
@@ -45,7 +52,7 @@ export async function mobileGetSource(format = 'xml', excludedAttributes) {
45
52
  const query = Object.entries(paramsMap)
46
53
  .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
47
54
  .join('&');
48
- return /** @type {string} */ (await this.proxyCommand(`/source?${query}`, 'GET'));
55
+ return await this.proxyCommand(`/source?${query}`, 'GET') as string;
49
56
  }
50
57
 
51
58
  /**
@@ -76,15 +83,14 @@ export async function mobileGetSource(format = 'xml', excludedAttributes) {
76
83
  * rawIdentifier: null }
77
84
  * ```
78
85
  */
79
- function getTreeForXML(srcTree) {
80
- function getTree(element, elementIndex, parentPath) {
81
- let curPath = `${parentPath}/${elementIndex}`;
82
- let rect = element.rect || {};
86
+ function getTreeForXML(srcTree: any): any {
87
+ function getTree(element: any, elementIndex: number, parentPath: string): any {
88
+ const curPath = `${parentPath}/${elementIndex}`;
89
+ const rect = element.rect || {};
83
90
  /**
84
91
  * @privateRemarks I don't even want to try to type this right now
85
- * @type {any}
86
92
  */
87
- let subtree = {
93
+ const subtree: any = {
88
94
  '@': {
89
95
  type: `XCUIElementType${element.type}`,
90
96
  enabled: parseInt(element.isEnabled, 10) === 1,
@@ -114,11 +120,11 @@ function getTreeForXML(srcTree) {
114
120
  [`XCUIElementType${element.type}`]: subtree,
115
121
  };
116
122
  }
117
- let tree = getTree(srcTree, 0, '');
123
+ const tree = getTree(srcTree, 0, '');
118
124
  return tree;
119
125
  }
120
126
 
121
- function getSourceXml(jsonSource) {
127
+ function getSourceXml(jsonSource: any): string {
122
128
  return js2xml('AppiumAUT', jsonSource, {
123
129
  wrapArray: {enabled: false, elementName: 'element'},
124
130
  declaration: {include: true},
@@ -126,6 +132,3 @@ function getSourceXml(jsonSource) {
126
132
  });
127
133
  }
128
134
 
129
- /**
130
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
131
- */
@@ -0,0 +1,95 @@
1
+ import type {XCUITestDriver} from '../driver';
2
+
3
+ /**
4
+ * Sets the page load timeout using W3C protocol.
5
+ *
6
+ * @param ms - Timeout in milliseconds
7
+ */
8
+ export async function pageLoadTimeoutW3C(
9
+ this: XCUITestDriver,
10
+ ms: number,
11
+ ): Promise<void> {
12
+ await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
13
+ }
14
+
15
+ /**
16
+ * Sets the page load timeout using MJSONWP protocol.
17
+ *
18
+ * @param ms - Timeout in milliseconds
19
+ */
20
+ export async function pageLoadTimeoutMJSONWP(
21
+ this: XCUITestDriver,
22
+ ms: number,
23
+ ): Promise<void> {
24
+ await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
25
+ }
26
+
27
+ /**
28
+ * Sets the async script timeout using W3C protocol.
29
+ *
30
+ * @param ms - Timeout in milliseconds
31
+ */
32
+ export async function scriptTimeoutW3C(
33
+ this: XCUITestDriver,
34
+ ms: number,
35
+ ): Promise<void> {
36
+ // XXX: this is synchronous
37
+ await this.setAsyncScriptTimeout(this.parseTimeoutArgument(ms));
38
+ }
39
+
40
+ /**
41
+ * Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
42
+ *
43
+ * @param ms - The timeout in milliseconds
44
+ * @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
45
+ */
46
+ export async function scriptTimeoutMJSONWP(
47
+ this: XCUITestDriver,
48
+ ms: number,
49
+ ): Promise<void> {
50
+ await this.asyncScriptTimeout(ms);
51
+ }
52
+
53
+ /**
54
+ * Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
55
+ *
56
+ * @param ms - The timeout in milliseconds
57
+ * @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
58
+ */
59
+ export async function asyncScriptTimeout(
60
+ this: XCUITestDriver,
61
+ ms: number,
62
+ ): Promise<void> {
63
+ await this.scriptTimeoutW3C(ms);
64
+ }
65
+
66
+ /**
67
+ * Sets the page load timeout.
68
+ *
69
+ * @param ms - Timeout in milliseconds
70
+ */
71
+ export function setPageLoadTimeout(
72
+ this: XCUITestDriver,
73
+ ms: number,
74
+ ): void {
75
+ ms = parseInt(String(ms), 10);
76
+ this.pageLoadMs = ms;
77
+ if (this._remote) {
78
+ this.remote.pageLoadMs = ms;
79
+ }
80
+ this.log.debug(`Set page load timeout to ${ms}ms`);
81
+ }
82
+
83
+ /**
84
+ * Sets the async script timeout.
85
+ *
86
+ * @param ms - Timeout in milliseconds
87
+ */
88
+ export function setAsyncScriptTimeout(
89
+ this: XCUITestDriver,
90
+ ms: number,
91
+ ): void {
92
+ this.asyncWaitMs = ms;
93
+ this.log.debug(`Set async script timeout to ${ms}ms`);
94
+ }
95
+
@@ -334,6 +334,29 @@ export interface ProcessArguments {
334
334
  args: string[];
335
335
  }
336
336
 
337
+ /**
338
+ * Accessibility audit item returned by the audit command.
339
+ */
340
+ export interface AccessibilityAuditItem {
341
+ /**
342
+ * The detailed description of the found accessibility issue.
343
+ */
344
+ detailedDescription: string;
345
+ /**
346
+ * The compact description of the found accessibility issue.
347
+ */
348
+ compactDescription: string;
349
+ /**
350
+ * The name of the audit type this issue belongs to. Could be
351
+ * a number if the type name is unknown.
352
+ */
353
+ auditType: string | number;
354
+ /**
355
+ * The description of the element this issue was found for.
356
+ */
357
+ element: string;
358
+ }
359
+
337
360
  /**
338
361
  * Pressable button names; used by the {@linkcode XCUITest.mobilePressButton mobile: pressButton} command.
339
362
  */
@@ -646,3 +669,66 @@ export interface LogEntry {
646
669
  }
647
670
 
648
671
  export type LogListener = (logEntry: LogEntry) => any;
672
+
673
+ /**
674
+ * Condition inducer profile configuration
675
+ */
676
+ export interface Profile {
677
+ name: string;
678
+ /** The property is profileID used in {@linkcode XCUITestDriver.enableConditionInducer} */
679
+ identifier: string;
680
+ /** Configuration details */
681
+ description: string;
682
+ }
683
+
684
+ /**
685
+ * We can use the returned data to determine whether the Condition is enabled and the currently enabled configuration information
686
+ */
687
+ export interface Condition {
688
+ profiles: Profile[];
689
+ /** The property is conditionID used in {@linkcode XCUITestDriver.enableConditionInducer} */
690
+ identifier: string;
691
+ profilesSorted: boolean;
692
+ isDestructive: boolean;
693
+ isInternal: boolean;
694
+ /** `true` if this condition identifier is enabled */
695
+ isActive: boolean;
696
+ /** Enabled profiles identifier */
697
+ activeProfile: string;
698
+ }
699
+
700
+ /**
701
+ * Information about an XCTest screen recording session
702
+ */
703
+ export interface XcTestScreenRecordingInfo {
704
+ /** Unique identifier of the video being recorded */
705
+ uuid: string;
706
+ /** FPS value */
707
+ fps: number;
708
+ /** Video codec, where 0 is h264 */
709
+ codec: number;
710
+ /** The timestamp when the screen recording has started in float Unix seconds */
711
+ startedAt: number;
712
+ }
713
+
714
+ /**
715
+ * XCTest screen recording result with payload
716
+ */
717
+ export interface XcTestScreenRecording extends XcTestScreenRecordingInfo {
718
+ /**
719
+ * Base64-encoded content of the recorded media file if `remotePath` parameter is empty or null or an empty string otherwise.
720
+ * The media is expected to a be a valid QuickTime movie (.mov).
721
+ */
722
+ payload: string;
723
+ }
724
+
725
+ /**
726
+ * Options for AudioRecorder
727
+ */
728
+ export interface AudioRecorderOptions {
729
+ audioSource: string;
730
+ audioCodec: string;
731
+ audioBitrate: string;
732
+ audioChannels: number;
733
+ audioRate: number;
734
+ }