appium-xcuitest-driver 12.21.0 → 12.22.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 (389) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/display.d.ts +4 -4
  3. package/build/lib/commands/display.d.ts.map +1 -1
  4. package/build/lib/commands/display.js +11 -5
  5. package/build/lib/commands/display.js.map +1 -1
  6. package/build/lib/commands/general.d.ts +2 -1
  7. package/build/lib/commands/general.d.ts.map +1 -1
  8. package/build/lib/commands/general.js +18 -1
  9. package/build/lib/commands/general.js.map +1 -1
  10. package/build/lib/commands/helpers/duo.d.ts +7 -0
  11. package/build/lib/commands/helpers/duo.d.ts.map +1 -0
  12. package/build/lib/commands/helpers/duo.js +28 -0
  13. package/build/lib/commands/helpers/duo.js.map +1 -0
  14. package/build/lib/commands/iohid.d.ts +3 -0
  15. package/build/lib/commands/iohid.d.ts.map +1 -1
  16. package/build/lib/commands/iohid.js +9 -0
  17. package/build/lib/commands/iohid.js.map +1 -1
  18. package/build/lib/commands/lock.d.ts.map +1 -1
  19. package/build/lib/commands/lock.js +38 -3
  20. package/build/lib/commands/lock.js.map +1 -1
  21. package/lib/commands/display.ts +12 -5
  22. package/lib/commands/general.ts +19 -1
  23. package/lib/commands/helpers/duo.ts +31 -0
  24. package/lib/commands/iohid.ts +9 -0
  25. package/lib/commands/lock.ts +43 -3
  26. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.d.ts +12 -0
  27. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.d.ts.map +1 -0
  28. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.js +33 -0
  29. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.js.map +1 -0
  30. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi.d.ts.map +1 -1
  31. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi.js +49 -12
  32. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi.js.map +1 -1
  33. package/node_modules/@appium/base-driver/build/lib/basedriver/driver.d.ts.map +1 -1
  34. package/node_modules/@appium/base-driver/build/lib/basedriver/driver.js +2 -0
  35. package/node_modules/@appium/base-driver/build/lib/basedriver/driver.js.map +1 -1
  36. package/node_modules/@appium/base-driver/build/lib/express/middleware.d.ts +17 -6
  37. package/node_modules/@appium/base-driver/build/lib/express/middleware.d.ts.map +1 -1
  38. package/node_modules/@appium/base-driver/build/lib/express/middleware.js +11 -7
  39. package/node_modules/@appium/base-driver/build/lib/express/middleware.js.map +1 -1
  40. package/node_modules/@appium/base-driver/build/lib/express/server.d.ts +1 -0
  41. package/node_modules/@appium/base-driver/build/lib/express/server.d.ts.map +1 -1
  42. package/node_modules/@appium/base-driver/build/lib/express/server.js +4 -3
  43. package/node_modules/@appium/base-driver/build/lib/express/server.js.map +1 -1
  44. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.d.ts +1 -2
  45. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.d.ts.map +1 -1
  46. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.js +8 -3
  47. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.js.map +1 -1
  48. package/node_modules/@appium/base-driver/lib/basedriver/commands/bidi-subscriptions.ts +36 -0
  49. package/node_modules/@appium/base-driver/lib/basedriver/commands/bidi.ts +56 -12
  50. package/node_modules/@appium/base-driver/lib/basedriver/driver.ts +2 -0
  51. package/node_modules/@appium/base-driver/lib/express/middleware.ts +32 -12
  52. package/node_modules/@appium/base-driver/lib/express/server.ts +7 -2
  53. package/node_modules/@appium/base-driver/lib/protocol/bidi-commands.ts +9 -3
  54. package/node_modules/@appium/base-driver/node_modules/axios/CHANGELOG.md +1934 -0
  55. package/node_modules/@appium/base-driver/node_modules/axios/LICENSE +7 -0
  56. package/node_modules/@appium/base-driver/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  57. package/node_modules/@appium/base-driver/node_modules/axios/README.md +2851 -0
  58. package/node_modules/@appium/base-driver/node_modules/axios/dist/axios.js +5807 -0
  59. package/node_modules/@appium/base-driver/node_modules/axios/dist/axios.min.js +5 -0
  60. package/node_modules/@appium/base-driver/node_modules/axios/dist/axios.min.js.map +1 -0
  61. package/node_modules/@appium/base-driver/node_modules/axios/dist/browser/axios.cjs +5829 -0
  62. package/node_modules/@appium/base-driver/node_modules/axios/dist/esm/axios.js +5850 -0
  63. package/node_modules/@appium/base-driver/node_modules/axios/dist/esm/axios.min.js +3 -0
  64. package/node_modules/@appium/base-driver/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  65. package/node_modules/@appium/base-driver/node_modules/axios/dist/node/axios.cjs +6808 -0
  66. package/node_modules/@appium/base-driver/node_modules/axios/index.d.cts +766 -0
  67. package/node_modules/@appium/base-driver/node_modules/axios/index.d.ts +787 -0
  68. package/node_modules/@appium/base-driver/node_modules/axios/index.js +45 -0
  69. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/README.md +36 -0
  70. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/adapters.js +132 -0
  71. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/fetch.js +696 -0
  72. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/http.js +1490 -0
  73. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/xhr.js +277 -0
  74. package/node_modules/@appium/base-driver/node_modules/axios/lib/axios.js +89 -0
  75. package/node_modules/@appium/base-driver/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  76. package/node_modules/@appium/base-driver/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  77. package/node_modules/@appium/base-driver/node_modules/axios/lib/cancel/isCancel.js +5 -0
  78. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/Axios.js +306 -0
  79. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/AxiosError.js +219 -0
  80. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
  81. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/InterceptorManager.js +171 -0
  82. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/README.md +8 -0
  83. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/buildFullPath.js +76 -0
  84. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/dispatchRequest.js +95 -0
  85. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/mergeConfig.js +174 -0
  86. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/methodList.js +17 -0
  87. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  88. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/settle.js +27 -0
  89. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/transformData.js +28 -0
  90. package/node_modules/@appium/base-driver/node_modules/axios/lib/defaults/index.js +178 -0
  91. package/node_modules/@appium/base-driver/node_modules/axios/lib/defaults/transitional.js +10 -0
  92. package/node_modules/@appium/base-driver/node_modules/axios/lib/env/README.md +3 -0
  93. package/node_modules/@appium/base-driver/node_modules/axios/lib/env/classes/FormData.js +2 -0
  94. package/node_modules/@appium/base-driver/node_modules/axios/lib/env/data.js +1 -0
  95. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
  96. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  97. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
  98. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  99. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/README.md +7 -0
  100. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  101. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/bind.js +14 -0
  102. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/buildURL.js +69 -0
  103. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/callbackify.js +18 -0
  104. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  105. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/composeSignals.js +68 -0
  106. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/cookies.js +64 -0
  107. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  108. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
  109. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
  110. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  111. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
  112. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  113. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  114. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
  115. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  116. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/null.js +2 -0
  117. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
  118. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  119. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  120. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/readBlob.js +15 -0
  121. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
  122. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  123. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
  124. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/speedometer.js +55 -0
  125. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/spread.js +28 -0
  126. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/throttle.js +45 -0
  127. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/toFormData.js +279 -0
  128. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  129. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/trackStream.js +89 -0
  130. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/validator.js +112 -0
  131. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  132. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  133. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  134. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/index.js +13 -0
  135. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/common/utils.js +52 -0
  136. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/index.js +7 -0
  137. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  138. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  139. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  140. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/index.js +37 -0
  141. package/node_modules/@appium/base-driver/node_modules/axios/lib/utils.js +1150 -0
  142. package/node_modules/@appium/base-driver/node_modules/axios/package.json +203 -0
  143. package/node_modules/@appium/base-driver/package.json +6 -6
  144. package/node_modules/@appium/support/build/lib/npm.d.ts.map +1 -1
  145. package/node_modules/@appium/support/build/lib/npm.js +2 -1
  146. package/node_modules/@appium/support/build/lib/npm.js.map +1 -1
  147. package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
  148. package/node_modules/@appium/support/build/lib/util.js +13 -1
  149. package/node_modules/@appium/support/build/lib/util.js.map +1 -1
  150. package/node_modules/@appium/support/build/lib/zip.d.ts +2 -1
  151. package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
  152. package/node_modules/@appium/support/build/lib/zip.js +193 -64
  153. package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
  154. package/node_modules/@appium/support/lib/npm.ts +2 -1
  155. package/node_modules/@appium/support/lib/util.ts +13 -1
  156. package/node_modules/@appium/support/lib/zip.ts +231 -71
  157. package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +1934 -0
  158. package/node_modules/@appium/support/node_modules/axios/LICENSE +7 -0
  159. package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  160. package/node_modules/@appium/support/node_modules/axios/README.md +2851 -0
  161. package/node_modules/@appium/support/node_modules/axios/dist/axios.js +5807 -0
  162. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +5 -0
  163. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +1 -0
  164. package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +5829 -0
  165. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +5850 -0
  166. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +3 -0
  167. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  168. package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +6808 -0
  169. package/node_modules/@appium/support/node_modules/axios/index.d.cts +766 -0
  170. package/node_modules/@appium/support/node_modules/axios/index.d.ts +787 -0
  171. package/node_modules/@appium/support/node_modules/axios/index.js +45 -0
  172. package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +36 -0
  173. package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +132 -0
  174. package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +696 -0
  175. package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +1490 -0
  176. package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +277 -0
  177. package/node_modules/@appium/support/node_modules/axios/lib/axios.js +89 -0
  178. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  179. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  180. package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +5 -0
  181. package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +306 -0
  182. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +219 -0
  183. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
  184. package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +171 -0
  185. package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +8 -0
  186. package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +76 -0
  187. package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +95 -0
  188. package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +174 -0
  189. package/node_modules/@appium/support/node_modules/axios/lib/core/methodList.js +17 -0
  190. package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  191. package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +27 -0
  192. package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +28 -0
  193. package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +178 -0
  194. package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +10 -0
  195. package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +3 -0
  196. package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +2 -0
  197. package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +1 -0
  198. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
  199. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  200. package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
  201. package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  202. package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +7 -0
  203. package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  204. package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +14 -0
  205. package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +69 -0
  206. package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +18 -0
  207. package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  208. package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +68 -0
  209. package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +64 -0
  210. package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  211. package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
  212. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
  213. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  214. package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
  215. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  216. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  217. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
  218. package/node_modules/@appium/support/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  219. package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +2 -0
  220. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
  221. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  222. package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  223. package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +15 -0
  224. package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
  225. package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  226. package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
  227. package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +55 -0
  228. package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +28 -0
  229. package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +45 -0
  230. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +279 -0
  231. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  232. package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +89 -0
  233. package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +112 -0
  234. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  235. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  236. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  237. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +13 -0
  238. package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +52 -0
  239. package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +7 -0
  240. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  241. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  242. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  243. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +37 -0
  244. package/node_modules/@appium/support/node_modules/axios/lib/utils.js +1150 -0
  245. package/node_modules/@appium/support/node_modules/axios/package.json +203 -0
  246. package/node_modules/@appium/support/package.json +6 -6
  247. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts +6 -4
  248. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts.map +1 -1
  249. package/node_modules/@appium/types/lib/commands/basedriver.ts +4 -4
  250. package/node_modules/@appium/types/package.json +2 -2
  251. package/node_modules/appium-ios-device/CHANGELOG.md +12 -0
  252. package/node_modules/appium-ios-device/README.md +1 -0
  253. package/node_modules/appium-ios-device/package.json +2 -2
  254. package/node_modules/appium-ios-remotexpc/CHANGELOG.md +7 -0
  255. package/node_modules/appium-ios-remotexpc/build/src/services/ios/testmanagerd/xcuitest.d.ts +5 -1
  256. package/node_modules/appium-ios-remotexpc/build/src/services/ios/testmanagerd/xcuitest.d.ts.map +1 -1
  257. package/node_modules/appium-ios-remotexpc/build/src/services/ios/testmanagerd/xcuitest.js +23 -15
  258. package/node_modules/appium-ios-remotexpc/build/src/services/ios/testmanagerd/xcuitest.js.map +1 -1
  259. package/node_modules/appium-ios-remotexpc/package.json +2 -2
  260. package/node_modules/appium-ios-remotexpc/src/services/ios/testmanagerd/xcuitest.ts +26 -21
  261. package/node_modules/appium-webdriveragent/CHANGELOG.md +8 -0
  262. package/node_modules/appium-webdriveragent/README.md +1 -1
  263. package/node_modules/appium-webdriveragent/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +1 -1
  264. package/node_modules/appium-webdriveragent/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +5 -1
  265. package/node_modules/appium-webdriveragent/WebDriverAgentLib/Info.plist +2 -2
  266. package/node_modules/appium-webdriveragent/WebDriverAgentTests/IntegrationTests/FBElementAttributeTests.m +44 -0
  267. package/node_modules/appium-webdriveragent/package.json +2 -2
  268. package/node_modules/axios/README.md +41 -106
  269. package/node_modules/axios/dist/axios.js +931 -278
  270. package/node_modules/axios/dist/axios.min.js +2 -2
  271. package/node_modules/axios/dist/axios.min.js.map +1 -1
  272. package/node_modules/axios/dist/browser/axios.cjs +948 -268
  273. package/node_modules/axios/dist/esm/axios.js +948 -268
  274. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  275. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  276. package/node_modules/axios/dist/node/axios.cjs +925 -242
  277. package/node_modules/axios/index.d.cts +20 -1
  278. package/node_modules/axios/index.d.ts +18 -1
  279. package/node_modules/axios/lib/adapters/fetch.js +73 -20
  280. package/node_modules/axios/lib/adapters/http.js +145 -26
  281. package/node_modules/axios/lib/adapters/xhr.js +120 -13
  282. package/node_modules/axios/lib/core/Axios.js +67 -12
  283. package/node_modules/axios/lib/core/AxiosError.js +59 -0
  284. package/node_modules/axios/lib/core/AxiosHeaders.js +17 -4
  285. package/node_modules/axios/lib/core/InterceptorManager.js +13 -2
  286. package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
  287. package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
  288. package/node_modules/axios/lib/core/dispatchRequest.js +20 -0
  289. package/node_modules/axios/lib/core/mergeConfig.js +183 -120
  290. package/node_modules/axios/lib/defaults/transitional.js +1 -0
  291. package/node_modules/axios/lib/env/data.js +1 -1
  292. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
  293. package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -1
  294. package/node_modules/axios/lib/helpers/composeSignals.js +6 -3
  295. package/node_modules/axios/lib/helpers/cookies.js +30 -6
  296. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +34 -7
  297. package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
  298. package/node_modules/axios/lib/helpers/formDataToJSON.js +25 -1
  299. package/node_modules/axios/lib/helpers/fromDataURI.js +8 -2
  300. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
  301. package/node_modules/axios/lib/helpers/parseHeaders.js +2 -1
  302. package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
  303. package/node_modules/axios/lib/helpers/resolveConfig.js +16 -3
  304. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +16 -1
  305. package/node_modules/axios/lib/utils.js +61 -10
  306. package/node_modules/axios/package.json +1 -2
  307. package/node_modules/body-parser/README.md +17 -13
  308. package/node_modules/body-parser/lib/read.js +74 -57
  309. package/node_modules/body-parser/lib/types/json.js +11 -11
  310. package/node_modules/body-parser/lib/types/urlencoded.js +5 -5
  311. package/node_modules/body-parser/lib/utils.js +0 -15
  312. package/node_modules/body-parser/package.json +7 -12
  313. package/node_modules/qs/.editorconfig +1 -1
  314. package/node_modules/qs/CHANGELOG.md +45 -22
  315. package/node_modules/qs/README.md +26 -1
  316. package/node_modules/qs/dist/qs.js +27 -27
  317. package/node_modules/qs/eslint.config.mjs +61 -50
  318. package/node_modules/qs/lib/formats.js +7 -2
  319. package/node_modules/qs/lib/parse.js +13 -6
  320. package/node_modules/qs/lib/stringify.js +5 -3
  321. package/node_modules/qs/lib/utils.js +15 -7
  322. package/node_modules/qs/package.json +6 -6
  323. package/node_modules/qs/test/parse.js +266 -2
  324. package/node_modules/qs/test/stringify.js +222 -0
  325. package/node_modules/qs/test/utils.js +61 -3
  326. package/node_modules/shell-quote/README.md +37 -4
  327. package/node_modules/shell-quote/package.json +10 -6
  328. package/node_modules/shell-quote/parse.d.ts +1 -1
  329. package/node_modules/shell-quote/parse.js +63 -11
  330. package/node_modules/shell-quote/quote.d.ts +2 -1
  331. package/node_modules/shell-quote/quote.js +23 -3
  332. package/node_modules/uuid/package.json +17 -17
  333. package/package.json +5 -5
  334. package/node_modules/@appium/base-driver/node_modules/asyncbox/LICENSE +0 -203
  335. package/node_modules/@appium/base-driver/node_modules/asyncbox/README.md +0 -215
  336. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
  337. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
  338. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -311
  339. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
  340. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.d.ts +0 -84
  341. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +0 -1
  342. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.js +0 -3
  343. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.js.map +0 -1
  344. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/package.json +0 -3
  345. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
  346. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
  347. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -298
  348. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
  349. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.d.ts +0 -84
  350. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.d.ts.map +0 -1
  351. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.js +0 -2
  352. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.js.map +0 -1
  353. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/package.json +0 -3
  354. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/asyncbox.ts +0 -382
  355. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/types.ts +0 -88
  356. package/node_modules/@appium/base-driver/node_modules/asyncbox/package.json +0 -74
  357. package/node_modules/@appium/support/node_modules/asyncbox/LICENSE +0 -203
  358. package/node_modules/@appium/support/node_modules/asyncbox/README.md +0 -215
  359. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
  360. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
  361. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -311
  362. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
  363. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts +0 -84
  364. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +0 -1
  365. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js +0 -3
  366. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js.map +0 -1
  367. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/package.json +0 -3
  368. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
  369. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
  370. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -298
  371. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
  372. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts +0 -84
  373. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts.map +0 -1
  374. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js +0 -2
  375. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js.map +0 -1
  376. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/package.json +0 -3
  377. package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncbox.ts +0 -382
  378. package/node_modules/@appium/support/node_modules/asyncbox/lib/types.ts +0 -88
  379. package/node_modules/@appium/support/node_modules/asyncbox/package.json +0 -74
  380. package/node_modules/shell-quote/.nycrc +0 -14
  381. package/node_modules/shell-quote/eslint.config.mjs +0 -29
  382. package/node_modules/shell-quote/security.md +0 -11
  383. package/node_modules/shell-quote/test/comment.js +0 -16
  384. package/node_modules/shell-quote/test/env.js +0 -52
  385. package/node_modules/shell-quote/test/env_fn.js +0 -21
  386. package/node_modules/shell-quote/test/op.js +0 -102
  387. package/node_modules/shell-quote/test/parse.js +0 -149
  388. package/node_modules/shell-quote/test/quote.js +0 -145
  389. package/node_modules/shell-quote/test/set.js +0 -31
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [12.22.1](https://github.com/appium/appium-xcuitest-driver/compare/v12.22.0...v12.22.1) (2026-10-28)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * release to bump the dependency for shell quote ([6d988f1](https://github.com/appium/appium-xcuitest-driver/commit/6d988f1df3a6388545458bc55da75efb5309fb30))
6
+
7
+ ## [12.22.0](https://github.com/appium/appium-xcuitest-driver/compare/v12.21.0...v12.22.0) (2026-10-27)
8
+
9
+ ### Features
10
+
11
+ * route Duo simulator HID controls through the host ([#3077](https://github.com/appium/appium-xcuitest-driver/issues/3077)) ([32dae67](https://github.com/appium/appium-xcuitest-driver/commit/32dae673c5b93bdee2fc5c3fe57a45c02a0295b2))
12
+
1
13
  ## [12.21.0](https://github.com/appium/appium-xcuitest-driver/compare/v12.20.0...v12.21.0) (2026-10-26)
2
14
 
3
15
  ### Features
@@ -36,13 +36,13 @@ export declare function getDevicePixelRatio(this: XCUITestDriver): Promise<numbe
36
36
  * Reads the current hinge angle in degrees, including changes made outside WDA.
37
37
  * Requires a WDA build with GET /wda/device/hingeAngle support.
38
38
  * WDA checks platform, hinge and CoreMotion availability and waits up to five seconds for a valid reading.
39
- * Physical Duo behavior is unverified. A reading may reflect an intermediate angle during folding.
39
+ * A reading may reflect an intermediate angle during folding.
40
40
  */
41
41
  export declare function mobileGetSimulatedHingeAngle(this: XCUITestDriver): Promise<number>;
42
42
  /**
43
- * Requests a simulated hinge angle on an iOS device with an available hinge.
44
- * Requires a WDA build with /wda/device/hingeAngle support; WDA validates the angle and checks availability at runtime.
45
- * Tested only on the Duo simulator. Physical Duo behavior is unverified.
43
+ * Requests a simulated hinge angle through the host CoreSimulator HID service.
44
+ * Requires an iPhone Duo Simulator on Xcode 27+; CoreSimulator identifies the device type.
45
+ * WDA supplies hinge angle readings.
46
46
  * The transition completes asynchronously. Select currentDisplayId separately.
47
47
  *
48
48
  * @param angle - Degrees from 0 (closed) to 180 (fully open), inclusive.
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../lib/commands/display.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAiB,MAAM,YAAY,CAAC;AAElF;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAe7E;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAcrF;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9E;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG/E;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAExF;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErG"}
1
+ {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../../lib/commands/display.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAiB,MAAM,YAAY,CAAC;AAElF;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAe7E;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAcrF;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9E;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG/E;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAExF;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrG"}
@@ -1,3 +1,5 @@
1
+ import { errors } from 'appium/driver.js';
2
+ import { getDuoSimulator, withDuoArgumentErrors } from './helpers/duo.js';
1
3
  /**
2
4
  * Retrieves the viewport dimensions.
3
5
  *
@@ -70,20 +72,24 @@ export async function getDevicePixelRatio() {
70
72
  * Reads the current hinge angle in degrees, including changes made outside WDA.
71
73
  * Requires a WDA build with GET /wda/device/hingeAngle support.
72
74
  * WDA checks platform, hinge and CoreMotion availability and waits up to five seconds for a valid reading.
73
- * Physical Duo behavior is unverified. A reading may reflect an intermediate angle during folding.
75
+ * A reading may reflect an intermediate angle during folding.
74
76
  */
75
77
  export async function mobileGetSimulatedHingeAngle() {
76
78
  return await this.proxyCommand('/wda/device/hingeAngle', 'GET');
77
79
  }
78
80
  /**
79
- * Requests a simulated hinge angle on an iOS device with an available hinge.
80
- * Requires a WDA build with /wda/device/hingeAngle support; WDA validates the angle and checks availability at runtime.
81
- * Tested only on the Duo simulator. Physical Duo behavior is unverified.
81
+ * Requests a simulated hinge angle through the host CoreSimulator HID service.
82
+ * Requires an iPhone Duo Simulator on Xcode 27+; CoreSimulator identifies the device type.
83
+ * WDA supplies hinge angle readings.
82
84
  * The transition completes asynchronously. Select currentDisplayId separately.
83
85
  *
84
86
  * @param angle - Degrees from 0 (closed) to 180 (fully open), inclusive.
85
87
  */
86
88
  export async function mobileSetSimulatedHingeAngle(angle) {
87
- await this.proxyCommand('/wda/device/hingeAngle', 'POST', { angle });
89
+ const simulator = await getDuoSimulator(this);
90
+ if (!simulator) {
91
+ throw new errors.UnsupportedOperationError('Setting the hinge angle requires an iPhone Duo Simulator on Xcode 27+');
92
+ }
93
+ await withDuoArgumentErrors(() => simulator.setSimulatedHingeAngle(angle));
88
94
  }
89
95
  //# sourceMappingURL=display.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"display.js","sourceRoot":"","sources":["../../../lib/commands/display.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,2EAA2E;IAC3E,0CAA0C;IAC1C,MAAM,EAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IACtE,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IACjE,MAAM,IAAI,GAAG,UAAU,IAAI,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IAExD,2EAA2E;IAC3E,qEAAqE;IACrE,OAAO;Q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AAM,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,MAAM,CAAC,yBAAyB,CAAC,uEAAuE,CAAC,CAAC;IACtH,CAAC;IACD,MAAM,qBAAqB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7E,CAAC"}
@@ -77,7 +77,8 @@ export declare function mobileGetPressableButtons(this: XCUITestDriver): Promise
77
77
  *
78
78
  * This executes different methods based on the platform:
79
79
  *
80
- * - iOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
80
+ * - Duo simulator Home and volume buttons: host CoreSimulator HID.
81
+ * - Other iOS buttons/devices: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
81
82
  * - tvOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627475-pressbutton) or [`pressButton:forDuration:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627476-pressbutton)
82
83
  *
83
84
  * Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
@@ -1 +1 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../lib/commands/general.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAC,UAAU,EAAE,oBAAoB,EAAC,MAAM,YAAY,CAAC;AAIjE;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/E;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/F;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc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AAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzF"}
@@ -1,9 +1,16 @@
1
1
  import { errors } from 'appium/driver.js';
2
2
  import dayjs from 'dayjs';
3
3
  import utc from 'dayjs/plugin/utc.js';
4
+ import { getDuoSimulator, withDuoArgumentErrors } from './helpers/duo.js';
5
+ import { HIDPageEvent, HIDUsageConsumerEvent } from './hid-event.js';
4
6
  dayjs.extend(utc);
5
7
  import { LockdownClient } from '../device/lockdown-client.js';
6
8
  const DATETIME_FORMAT_ISO8601 = 'YYYY-MM-DDTHH:mm:ssZ';
9
+ const DUO_BUTTON_USAGES = new Map([
10
+ ['home', HIDUsageConsumerEvent.kHIDUsage_Csmr_Menu],
11
+ ['volumeup', HIDUsageConsumerEvent.kHIDUsage_Csmr_VolumeIncrement],
12
+ ['volumedown', HIDUsageConsumerEvent.kHIDUsage_Csmr_VolumeDecrement],
13
+ ]);
7
14
  /**
8
15
  * Trigger a touch/fingerprint match or match failure.
9
16
  *
@@ -141,7 +148,8 @@ export async function mobileGetPressableButtons() {
141
148
  *
142
149
  * This executes different methods based on the platform:
143
150
  *
144
- * - iOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
151
+ * - Duo simulator Home and volume buttons: host CoreSimulator HID.
152
+ * - Other iOS buttons/devices: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
145
153
  * - tvOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627475-pressbutton) or [`pressButton:forDuration:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627476-pressbutton)
146
154
  *
147
155
  * Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
@@ -156,6 +164,15 @@ export async function mobilePressButton(name, durationSeconds) {
156
164
  if (durationSeconds != null && typeof durationSeconds !== 'number') {
157
165
  throw new errors.InvalidArgumentError('durationSeconds should be a number');
158
166
  }
167
+ const simulator = await getDuoSimulator(this);
168
+ if (simulator) {
169
+ const usage = DUO_BUTTON_USAGES.get(name.toLowerCase());
170
+ if (usage === undefined) {
171
+ throw new errors.UnsupportedOperationError(`Button '${name}' has no supported Duo simulator HID mapping`);
172
+ }
173
+ // Preserve iOS pressButton semantics: durationSeconds is a tvOS-only option.
174
+ return await withDuoArgumentErrors(() => simulator.pressHidButton(HIDPageEvent.kHIDPage_Consumer, usage));
175
+ }
159
176
  return await this.proxyCommand('/wda/pressButton', 'POST', { name, duration: durationSeconds });
160
177
  }
161
178
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"general.js","sourceRoot":"","sources":["../../../lib/commands/general.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,qBAAqB,CAAC;AAEtC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAElB,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAI5D,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAuB,KAAK,GAAG,IAAI;IAC9D,MAAM,IAAI,CAAC,wBAAwB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAuB,SAAS,GAAG,IAAI;IAC9E,MAAM,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAuB,MAAM,GAAG,uBAAuB;IACxF,MAAM,cAAc,GAAG,CAAC,YAAoB,EAAE,SAAiB,EAAU,EAAE;QACzE,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC;QACnD,OAAO,WAAW,CAAC,SAA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M,KAAK,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACxD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,MAAM,CAAC,yBAAyB,CAAC,WAAW,IAAI,8CAA8C,CAAC,CAAC;QAC5G,CAAC;QACD,6EAA6E;QAC7E,OAAO,MAAM,qBAAqB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,YAAY,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5G,CAAC;IACD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAC,CAAC,CAAC;AAChG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAuB,IAAY;IACxE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,MAAM,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Simulator, SupportsDuo } from 'appium-ios-simulator';
2
+ import type { XCUITestDriver } from '../../driver.js';
3
+ /** Select Duo controls by device type, not hinge or multiple-display capability. */
4
+ export declare function getDuoSimulator(driver: XCUITestDriver): Promise<(Simulator & SupportsDuo) | undefined>;
5
+ /** Translate native argument validation at the simulator command boundary. */
6
+ export declare function withDuoArgumentErrors(command: () => Promise<void>): Promise<void>;
7
+ //# sourceMappingURL=duo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duo.d.ts","sourceRoot":"","sources":["../../../../lib/commands/helpers/duo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAGjE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAEpD,oFAAoF;AACpF,wBAAsB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,SAAS,GAAG,WAAW,CAAC,GAAG,SAAS,CAAC,CAY5G;AAED,8EAA8E;AAC9E,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CASvF"}
@@ -0,0 +1,28 @@
1
+ import { errors } from 'appium/driver.js';
2
+ /** Select Duo controls by device type, not hinge or multiple-display capability. */
3
+ export async function getDuoSimulator(driver) {
4
+ if (!driver.isSimulator() || ['tvos', 'watchos'].includes(String(driver.opts.platformName).toLowerCase())) {
5
+ return undefined;
6
+ }
7
+ const simulator = driver.device;
8
+ if (typeof simulator.isDuo !== 'function' || !(await simulator.isDuo())) {
9
+ return undefined;
10
+ }
11
+ if (typeof simulator.setSimulatedHingeAngle !== 'function') {
12
+ return undefined;
13
+ }
14
+ return simulator;
15
+ }
16
+ /** Translate native argument validation at the simulator command boundary. */
17
+ export async function withDuoArgumentErrors(command) {
18
+ try {
19
+ await command();
20
+ }
21
+ catch (err) {
22
+ if (err instanceof TypeError) {
23
+ throw new errors.InvalidArgumentError(err.message);
24
+ }
25
+ throw err;
26
+ }
27
+ }
28
+ //# sourceMappingURL=duo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duo.js","sourceRoot":"","sources":["../../../../lib/commands/helpers/duo.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAIxC,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAsB;IAC1D,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAC1G,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAmB,CAAC;IAC7C,IAAI,OAAO,SAAS,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;QACxE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,OAAO,SAAS,CAAC,sBAAsB,KAAK,UAAU,EAAE,CAAC;QAC3D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,SAAoC,CAAC;AAC9C,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAA4B;IACtE,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,MAAM,CAAC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -4,6 +4,9 @@ import { HIDPageEvent } from './hid-event.js';
4
4
  /**
5
5
  * Emulates triggering of the given low-level IO HID device event.
6
6
  *
7
+ * Duo simulators use host CoreSimulator HID with native argument validation.
8
+ * Other devices use WDA/XCTest. Completion does not guarantee that the event was applied.
9
+ *
7
10
  * Popular constants:
8
11
  * - `kHIDPage_Consumer` = `0x0C`
9
12
  * - `kHIDUsage_Csmr_VolumeIncrement` = `0xE9` (Volume Up)
@@ -1 +1 @@
1
- {"version":3,"file":"iohid.d.ts","sourceRoot":"","sources":["../../../lib/commands/iohid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAC,cAAc,EAAC,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AM,GAC3B,OAAO,CAAC,IAAI,CAAC,CAyCf"}
@@ -1,10 +1,14 @@
1
1
  import { errors } from 'appium/driver.js';
2
2
  import { HidIndigoClient } from '../device/hid-indigo-client.js';
3
+ import { getDuoSimulator, withDuoArgumentErrors } from './helpers/duo.js';
3
4
  import { requireRealDevice } from './helpers/index.js';
4
5
  import { HIDUsageEvent, HIDPageEvent } from './hid-event.js';
5
6
  /**
6
7
  * Emulates triggering of the given low-level IO HID device event.
7
8
  *
9
+ * Duo simulators use host CoreSimulator HID with native argument validation.
10
+ * Other devices use WDA/XCTest. Completion does not guarantee that the event was applied.
11
+ *
8
12
  * Popular constants:
9
13
  * - `kHIDPage_Consumer` = `0x0C`
10
14
  * - `kHIDUsage_Csmr_VolumeIncrement` = `0xE9` (Volume Up)
@@ -18,6 +22,11 @@ import { HIDUsageEvent, HIDPageEvent } from './hid-event.js';
18
22
  * @param durationSeconds - The event duration in float seconds (XCTest uses `0.005` for a single press event)
19
23
  */
20
24
  export async function mobilePerformIoHidEvent(page, usage, durationSeconds) {
25
+ const simulator = await getDuoSimulator(this);
26
+ if (simulator) {
27
+ const duration = typeof durationSeconds === 'string' ? parseFloat(durationSeconds) : durationSeconds;
28
+ return await withDuoArgumentErrors(() => simulator.pressHidButton(page, usage, duration));
29
+ }
21
30
  if (!isHIDPageEvent(page)) {
22
31
  throw new errors.InvalidArgumentError(`'page' argument must be a valid HIDPageEvent identifier`);
23
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"iohid.js","sourceRoot":"","sources":["../../../lib/commands/iohid.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE3D;;;;;;;;;;;;;;GAcG;AACH,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,QAAQ,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,IAAI,aAAa,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,KAAU;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,IAAI,YAAY,CAAC;AAC/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/commands/lock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAazF;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAErE"}
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/commands/lock.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAIjD;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAazF;AAED;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAErE"}
@@ -1,4 +1,8 @@
1
1
  import { setTimeout as delay } from 'node:timers/promises';
2
+ import { errors } from 'appium/driver.js';
3
+ import { waitForCondition } from 'asyncbox';
4
+ import { getDuoSimulator } from './helpers/duo.js';
5
+ import { HIDPageEvent, HIDUsageConsumerEvent } from './hid-event.js';
2
6
  /**
3
7
  * Lock the device (and optionally unlock the device after a certain amount of time)
4
8
  *
@@ -6,7 +10,7 @@ import { setTimeout as delay } from 'node:timers/promises';
6
10
  * @defaultValue 0
7
11
  */
8
12
  export async function lock(seconds) {
9
- await this.proxyCommand('/wda/lock', 'POST');
13
+ await setLocked(this, true);
10
14
  if (isNaN(Number(seconds))) {
11
15
  return;
12
16
  }
@@ -15,13 +19,13 @@ export async function lock(seconds) {
15
19
  return;
16
20
  }
17
21
  await delay(floatSeconds * 1000);
18
- await this.proxyCommand('/wda/unlock', 'POST');
22
+ await this.unlock();
19
23
  }
20
24
  /**
21
25
  * Unlock the device
22
26
  */
23
27
  export async function unlock() {
24
- await this.proxyCommand('/wda/unlock', 'POST');
28
+ await setLocked(this, false);
25
29
  }
26
30
  /**
27
31
  * Determine whether the device is locked
@@ -31,4 +35,35 @@ export async function unlock() {
31
35
  export async function isLocked() {
32
36
  return await this.proxyCommand('/wda/locked', 'GET');
33
37
  }
38
+ async function setLocked(driver, locked) {
39
+ const simulator = await getDuoSimulator(driver);
40
+ if (!simulator) {
41
+ await driver.proxyCommand(locked ? '/wda/lock' : '/wda/unlock', 'POST');
42
+ return;
43
+ }
44
+ if ((await driver.isLocked()) === locked) {
45
+ return;
46
+ }
47
+ await simulator.pressHidButton(HIDPageEvent.kHIDPage_Consumer, locked ? HIDUsageConsumerEvent.kHIDUsage_Csmr_Power : HIDUsageConsumerEvent.kHIDUsage_Csmr_Menu);
48
+ const timeoutError = new errors.UnknownError(`Timed out waiting for the simulator to ${locked ? 'lock' : 'unlock'}`);
49
+ const waitForState = async (waitMs) => await waitForCondition(async () => (await driver.isLocked()) === locked, {
50
+ waitMs,
51
+ intervalMs: 100,
52
+ error: timeoutError,
53
+ });
54
+ if (!locked) {
55
+ try {
56
+ await waitForState(1000);
57
+ return;
58
+ }
59
+ catch (err) {
60
+ if (err !== timeoutError) {
61
+ throw err;
62
+ }
63
+ }
64
+ // A sleeping device may need a second Home press after waking.
65
+ await simulator.pressHidButton(HIDPageEvent.kHIDPage_Consumer, HIDUsageConsumerEvent.kHIDUsage_Csmr_Menu);
66
+ }
67
+ await waitForState(locked ? 5000 : 4000);
68
+ }
34
69
  //# sourceMappingURL=lock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../lib/commands/lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,KAAK,EAAC,MAAM,sBAAsB,CAAC;AAIzD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAuB,OAAyB;IACxE,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO;IACT,CAAC;IAED,MAAM,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACjC,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACjD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,CAAC,CAAC;IAC5G,CAAC;IACD,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC"}
@@ -1,4 +1,7 @@
1
+ import {errors} from 'appium/driver.js';
2
+
1
3
  import type {XCUITestDriver} from '../driver.js';
4
+ import {getDuoSimulator, withDuoArgumentErrors} from './helpers/duo.js';
2
5
  import type {Viewport, ScreenInfo, DisplayInfo, WDADisplayInfo} from './types.js';
3
6
 
4
7
  /**
@@ -79,20 +82,24 @@ export async function getDevicePixelRatio(this: XCUITestDriver): Promise<number>
79
82
  * Reads the current hinge angle in degrees, including changes made outside WDA.
80
83
  * Requires a WDA build with GET /wda/device/hingeAngle support.
81
84
  * WDA checks platform, hinge and CoreMotion availability and waits up to five seconds for a valid reading.
82
- * Physical Duo behavior is unverified. A reading may reflect an intermediate angle during folding.
85
+ * A reading may reflect an intermediate angle during folding.
83
86
  */
84
87
  export async function mobileGetSimulatedHingeAngle(this: XCUITestDriver): Promise<number> {
85
88
  return await this.proxyCommand('/wda/device/hingeAngle', 'GET');
86
89
  }
87
90
 
88
91
  /**
89
- * Requests a simulated hinge angle on an iOS device with an available hinge.
90
- * Requires a WDA build with /wda/device/hingeAngle support; WDA validates the angle and checks availability at runtime.
91
- * Tested only on the Duo simulator. Physical Duo behavior is unverified.
92
+ * Requests a simulated hinge angle through the host CoreSimulator HID service.
93
+ * Requires an iPhone Duo Simulator on Xcode 27+; CoreSimulator identifies the device type.
94
+ * WDA supplies hinge angle readings.
92
95
  * The transition completes asynchronously. Select currentDisplayId separately.
93
96
  *
94
97
  * @param angle - Degrees from 0 (closed) to 180 (fully open), inclusive.
95
98
  */
96
99
  export async function mobileSetSimulatedHingeAngle(this: XCUITestDriver, angle: number): Promise<void> {
97
- await this.proxyCommand('/wda/device/hingeAngle', 'POST', {angle});
100
+ const simulator = await getDuoSimulator(this);
101
+ if (!simulator) {
102
+ throw new errors.UnsupportedOperationError('Setting the hinge angle requires an iPhone Duo Simulator on Xcode 27+');
103
+ }
104
+ await withDuoArgumentErrors(() => simulator.setSimulatedHingeAngle(angle));
98
105
  }
@@ -3,6 +3,9 @@ import {errors} from 'appium/driver.js';
3
3
  import dayjs from 'dayjs';
4
4
  import utc from 'dayjs/plugin/utc.js';
5
5
 
6
+ import {getDuoSimulator, withDuoArgumentErrors} from './helpers/duo.js';
7
+ import {HIDPageEvent, HIDUsageConsumerEvent} from './hid-event.js';
8
+
6
9
  dayjs.extend(utc);
7
10
 
8
11
  import {LockdownClient} from '../device/lockdown-client.js';
@@ -10,6 +13,11 @@ import type {XCUITestDriver} from '../driver.js';
10
13
  import type {ButtonName, PressableButtonsInfo} from './types.js';
11
14
 
12
15
  const DATETIME_FORMAT_ISO8601 = 'YYYY-MM-DDTHH:mm:ssZ';
16
+ const DUO_BUTTON_USAGES = new Map<string, HIDUsageConsumerEvent>([
17
+ ['home', HIDUsageConsumerEvent.kHIDUsage_Csmr_Menu],
18
+ ['volumeup', HIDUsageConsumerEvent.kHIDUsage_Csmr_VolumeIncrement],
19
+ ['volumedown', HIDUsageConsumerEvent.kHIDUsage_Csmr_VolumeDecrement],
20
+ ]);
13
21
 
14
22
  /**
15
23
  * Trigger a touch/fingerprint match or match failure.
@@ -164,7 +172,8 @@ export async function mobileGetPressableButtons(this: XCUITestDriver): Promise<P
164
172
  *
165
173
  * This executes different methods based on the platform:
166
174
  *
167
- * - iOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
175
+ * - Duo simulator Home and volume buttons: host CoreSimulator HID.
176
+ * - Other iOS buttons/devices: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuidevice/1619052-pressbutton)
168
177
  * - tvOS: [`pressButton:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627475-pressbutton) or [`pressButton:forDuration:`](https://developer.apple.com/documentation/xctest/xcuiremote/1627476-pressbutton)
169
178
  *
170
179
  * Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
@@ -183,6 +192,15 @@ export async function mobilePressButton(
183
192
  if (durationSeconds != null && typeof durationSeconds !== 'number') {
184
193
  throw new errors.InvalidArgumentError('durationSeconds should be a number');
185
194
  }
195
+ const simulator = await getDuoSimulator(this);
196
+ if (simulator) {
197
+ const usage = DUO_BUTTON_USAGES.get(name.toLowerCase());
198
+ if (usage === undefined) {
199
+ throw new errors.UnsupportedOperationError(`Button '${name}' has no supported Duo simulator HID mapping`);
200
+ }
201
+ // Preserve iOS pressButton semantics: durationSeconds is a tvOS-only option.
202
+ return await withDuoArgumentErrors(() => simulator.pressHidButton(HIDPageEvent.kHIDPage_Consumer, usage));
203
+ }
186
204
  return await this.proxyCommand('/wda/pressButton', 'POST', {name, duration: durationSeconds});
187
205
  }
188
206
 
@@ -0,0 +1,31 @@
1
+ import type {Simulator, SupportsDuo} from 'appium-ios-simulator';
2
+ import {errors} from 'appium/driver.js';
3
+
4
+ import type {XCUITestDriver} from '../../driver.js';
5
+
6
+ /** Select Duo controls by device type, not hinge or multiple-display capability. */
7
+ export async function getDuoSimulator(driver: XCUITestDriver): Promise<(Simulator & SupportsDuo) | undefined> {
8
+ if (!driver.isSimulator() || ['tvos', 'watchos'].includes(String(driver.opts.platformName).toLowerCase())) {
9
+ return undefined;
10
+ }
11
+ const simulator = driver.device as Simulator;
12
+ if (typeof simulator.isDuo !== 'function' || !(await simulator.isDuo())) {
13
+ return undefined;
14
+ }
15
+ if (typeof simulator.setSimulatedHingeAngle !== 'function') {
16
+ return undefined;
17
+ }
18
+ return simulator as Simulator & SupportsDuo;
19
+ }
20
+
21
+ /** Translate native argument validation at the simulator command boundary. */
22
+ export async function withDuoArgumentErrors(command: () => Promise<void>): Promise<void> {
23
+ try {
24
+ await command();
25
+ } catch (err) {
26
+ if (err instanceof TypeError) {
27
+ throw new errors.InvalidArgumentError(err.message);
28
+ }
29
+ throw err;
30
+ }
31
+ }
@@ -3,12 +3,16 @@ import {errors} from 'appium/driver.js';
3
3
 
4
4
  import {HidIndigoClient} from '../device/hid-indigo-client.js';
5
5
  import type {XCUITestDriver} from '../driver.js';
6
+ import {getDuoSimulator, withDuoArgumentErrors} from './helpers/duo.js';
6
7
  import {requireRealDevice} from './helpers/index.js';
7
8
  import {HIDUsageEvent, HIDPageEvent} from './hid-event.js';
8
9
 
9
10
  /**
10
11
  * Emulates triggering of the given low-level IO HID device event.
11
12
  *
13
+ * Duo simulators use host CoreSimulator HID with native argument validation.
14
+ * Other devices use WDA/XCTest. Completion does not guarantee that the event was applied.
15
+ *
12
16
  * Popular constants:
13
17
  * - `kHIDPage_Consumer` = `0x0C`
14
18
  * - `kHIDUsage_Csmr_VolumeIncrement` = `0xE9` (Volume Up)
@@ -27,6 +31,11 @@ export async function mobilePerformIoHidEvent(
27
31
  usage: number,
28
32
  durationSeconds: number | string,
29
33
  ): Promise<void> {
34
+ const simulator = await getDuoSimulator(this);
35
+ if (simulator) {
36
+ const duration = typeof durationSeconds === 'string' ? parseFloat(durationSeconds) : durationSeconds;
37
+ return await withDuoArgumentErrors(() => simulator.pressHidButton(page, usage, duration));
38
+ }
30
39
  if (!isHIDPageEvent(page)) {
31
40
  throw new errors.InvalidArgumentError(`'page' argument must be a valid HIDPageEvent identifier`);
32
41
  }
@@ -1,6 +1,11 @@
1
1
  import {setTimeout as delay} from 'node:timers/promises';
2
2
 
3
+ import {errors} from 'appium/driver.js';
4
+ import {waitForCondition} from 'asyncbox';
5
+
3
6
  import type {XCUITestDriver} from '../driver.js';
7
+ import {getDuoSimulator} from './helpers/duo.js';
8
+ import {HIDPageEvent, HIDUsageConsumerEvent} from './hid-event.js';
4
9
 
5
10
  /**
6
11
  * Lock the device (and optionally unlock the device after a certain amount of time)
@@ -9,7 +14,7 @@ import type {XCUITestDriver} from '../driver.js';
9
14
  * @defaultValue 0
10
15
  */
11
16
  export async function lock(this: XCUITestDriver, seconds?: number | string): Promise<void> {
12
- await this.proxyCommand('/wda/lock', 'POST');
17
+ await setLocked(this, true);
13
18
  if (isNaN(Number(seconds))) {
14
19
  return;
15
20
  }
@@ -20,14 +25,14 @@ export async function lock(this: XCUITestDriver, seconds?: number | string): Pro
20
25
  }
21
26
 
22
27
  await delay(floatSeconds * 1000);
23
- await this.proxyCommand('/wda/unlock', 'POST');
28
+ await this.unlock();
24
29
  }
25
30
 
26
31
  /**
27
32
  * Unlock the device
28
33
  */
29
34
  export async function unlock(this: XCUITestDriver): Promise<void> {
30
- await this.proxyCommand('/wda/unlock', 'POST');
35
+ await setLocked(this, false);
31
36
  }
32
37
 
33
38
  /**
@@ -38,3 +43,38 @@ export async function unlock(this: XCUITestDriver): Promise<void> {
38
43
  export async function isLocked(this: XCUITestDriver): Promise<boolean> {
39
44
  return await this.proxyCommand<any, boolean>('/wda/locked', 'GET');
40
45
  }
46
+
47
+ async function setLocked(driver: XCUITestDriver, locked: boolean): Promise<void> {
48
+ const simulator = await getDuoSimulator(driver);
49
+ if (!simulator) {
50
+ await driver.proxyCommand(locked ? '/wda/lock' : '/wda/unlock', 'POST');
51
+ return;
52
+ }
53
+ if ((await driver.isLocked()) === locked) {
54
+ return;
55
+ }
56
+ await simulator.pressHidButton(
57
+ HIDPageEvent.kHIDPage_Consumer,
58
+ locked ? HIDUsageConsumerEvent.kHIDUsage_Csmr_Power : HIDUsageConsumerEvent.kHIDUsage_Csmr_Menu,
59
+ );
60
+ const timeoutError = new errors.UnknownError(`Timed out waiting for the simulator to ${locked ? 'lock' : 'unlock'}`);
61
+ const waitForState = async (waitMs: number) =>
62
+ await waitForCondition(async () => (await driver.isLocked()) === locked, {
63
+ waitMs,
64
+ intervalMs: 100,
65
+ error: timeoutError,
66
+ });
67
+ if (!locked) {
68
+ try {
69
+ await waitForState(1000);
70
+ return;
71
+ } catch (err) {
72
+ if (err !== timeoutError) {
73
+ throw err;
74
+ }
75
+ }
76
+ // A sleeping device may need a second Home press after waking.
77
+ await simulator.pressHidButton(HIDPageEvent.kHIDPage_Consumer, HIDUsageConsumerEvent.kHIDUsage_Csmr_Menu);
78
+ }
79
+ await waitForState(locked ? 5000 : 4000);
80
+ }
@@ -0,0 +1,12 @@
1
+ type BidiSubscriptionDriver = {
2
+ bidiEventSubs: Record<string, string[]>;
3
+ };
4
+ type Subscriptions = Map<string, Map<string, string[]>>;
5
+ /** Get (or lazily create) the subscription registry of the given driver */
6
+ export declare function getSubscriptions(driver: object): Subscriptions;
7
+ /** Recompute `bidiEventSubs` as the union of all registered subscriptions */
8
+ export declare function refreshEventSubscriptions(driver: BidiSubscriptionDriver): void;
9
+ /** Forget all subscriptions, e.g. when the session ends */
10
+ export declare function clearBidiSubscriptions(driver: BidiSubscriptionDriver): void;
11
+ export {};
12
+ //# sourceMappingURL=bidi-subscriptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bidi-subscriptions.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/bidi-subscriptions.ts"],"names":[],"mappings":"AAEA,KAAK,sBAAsB,GAAG;IAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAC,CAAC;AAGxE,KAAK,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAIxD,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAO9D;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAS9E;AAED,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAG3E"}