easytouch-linux 1.0.6 → 1.0.7

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 (331) hide show
  1. package/.playwright/node/LICENSE +2607 -0
  2. package/.playwright/node/linux-x64/node +0 -0
  3. package/.playwright/package/README.md +3 -0
  4. package/.playwright/package/ThirdPartyNotices.txt +1602 -0
  5. package/.playwright/package/api.json +1 -0
  6. package/.playwright/package/bin/install_media_pack.ps1 +5 -0
  7. package/.playwright/package/bin/reinstall_chrome_beta_linux.sh +42 -0
  8. package/.playwright/package/bin/reinstall_chrome_beta_mac.sh +13 -0
  9. package/.playwright/package/bin/reinstall_chrome_beta_win.ps1 +24 -0
  10. package/.playwright/package/bin/reinstall_chrome_stable_linux.sh +42 -0
  11. package/.playwright/package/bin/reinstall_chrome_stable_mac.sh +12 -0
  12. package/.playwright/package/bin/reinstall_chrome_stable_win.ps1 +24 -0
  13. package/.playwright/package/bin/reinstall_msedge_beta_linux.sh +48 -0
  14. package/.playwright/package/bin/reinstall_msedge_beta_mac.sh +11 -0
  15. package/.playwright/package/bin/reinstall_msedge_beta_win.ps1 +23 -0
  16. package/.playwright/package/bin/reinstall_msedge_dev_linux.sh +48 -0
  17. package/.playwright/package/bin/reinstall_msedge_dev_mac.sh +11 -0
  18. package/.playwright/package/bin/reinstall_msedge_dev_win.ps1 +23 -0
  19. package/.playwright/package/bin/reinstall_msedge_stable_linux.sh +48 -0
  20. package/.playwright/package/bin/reinstall_msedge_stable_mac.sh +11 -0
  21. package/.playwright/package/bin/reinstall_msedge_stable_win.ps1 +24 -0
  22. package/.playwright/package/browsers.json +66 -0
  23. package/.playwright/package/cli.js +18 -0
  24. package/.playwright/package/index.d.ts +17 -0
  25. package/.playwright/package/index.js +33 -0
  26. package/.playwright/package/index.mjs +28 -0
  27. package/.playwright/package/lib/androidServerImpl.js +69 -0
  28. package/.playwright/package/lib/browserServerImpl.js +92 -0
  29. package/.playwright/package/lib/cli/driver.js +95 -0
  30. package/.playwright/package/lib/cli/program.js +583 -0
  31. package/.playwright/package/lib/cli/programWithTestStub.js +67 -0
  32. package/.playwright/package/lib/client/accessibility.js +50 -0
  33. package/.playwright/package/lib/client/android.js +473 -0
  34. package/.playwright/package/lib/client/api.js +285 -0
  35. package/.playwright/package/lib/client/artifact.js +79 -0
  36. package/.playwright/package/lib/client/browser.js +145 -0
  37. package/.playwright/package/lib/client/browserContext.js +559 -0
  38. package/.playwright/package/lib/client/browserType.js +241 -0
  39. package/.playwright/package/lib/client/cdpSession.js +53 -0
  40. package/.playwright/package/lib/client/channelOwner.js +215 -0
  41. package/.playwright/package/lib/client/clientHelper.js +57 -0
  42. package/.playwright/package/lib/client/clientInstrumentation.js +52 -0
  43. package/.playwright/package/lib/client/clock.js +68 -0
  44. package/.playwright/package/lib/client/connection.js +333 -0
  45. package/.playwright/package/lib/client/consoleMessage.js +55 -0
  46. package/.playwright/package/lib/client/coverage.js +41 -0
  47. package/.playwright/package/lib/client/dialog.js +57 -0
  48. package/.playwright/package/lib/client/download.js +62 -0
  49. package/.playwright/package/lib/client/electron.js +135 -0
  50. package/.playwright/package/lib/client/elementHandle.js +321 -0
  51. package/.playwright/package/lib/client/errors.js +77 -0
  52. package/.playwright/package/lib/client/eventEmitter.js +314 -0
  53. package/.playwright/package/lib/client/events.js +94 -0
  54. package/.playwright/package/lib/client/fetch.js +391 -0
  55. package/.playwright/package/lib/client/fileChooser.js +45 -0
  56. package/.playwright/package/lib/client/frame.js +504 -0
  57. package/.playwright/package/lib/client/harRouter.js +99 -0
  58. package/.playwright/package/lib/client/input.js +111 -0
  59. package/.playwright/package/lib/client/jsHandle.js +121 -0
  60. package/.playwright/package/lib/client/jsonPipe.js +35 -0
  61. package/.playwright/package/lib/client/localUtils.js +36 -0
  62. package/.playwright/package/lib/client/locator.js +448 -0
  63. package/.playwright/package/lib/client/network.js +769 -0
  64. package/.playwright/package/lib/client/page.js +748 -0
  65. package/.playwright/package/lib/client/playwright.js +80 -0
  66. package/.playwright/package/lib/client/selectors.js +67 -0
  67. package/.playwright/package/lib/client/stream.js +54 -0
  68. package/.playwright/package/lib/client/tracing.js +147 -0
  69. package/.playwright/package/lib/client/types.js +24 -0
  70. package/.playwright/package/lib/client/video.js +51 -0
  71. package/.playwright/package/lib/client/waiter.js +162 -0
  72. package/.playwright/package/lib/client/webError.js +37 -0
  73. package/.playwright/package/lib/client/worker.js +71 -0
  74. package/.playwright/package/lib/client/writableStream.js +54 -0
  75. package/.playwright/package/lib/common/socksProxy.js +569 -0
  76. package/.playwright/package/lib/common/timeoutSettings.js +73 -0
  77. package/.playwright/package/lib/common/types.js +5 -0
  78. package/.playwright/package/lib/generated/clockSource.js +7 -0
  79. package/.playwright/package/lib/generated/consoleApiSource.js +7 -0
  80. package/.playwright/package/lib/generated/injectedScriptSource.js +7 -0
  81. package/.playwright/package/lib/generated/pollingRecorderSource.js +7 -0
  82. package/.playwright/package/lib/generated/utilityScriptSource.js +7 -0
  83. package/.playwright/package/lib/generated/webSocketMockSource.js +7 -0
  84. package/.playwright/package/lib/image_tools/colorUtils.js +98 -0
  85. package/.playwright/package/lib/image_tools/compare.js +108 -0
  86. package/.playwright/package/lib/image_tools/imageChannel.js +70 -0
  87. package/.playwright/package/lib/image_tools/stats.js +102 -0
  88. package/.playwright/package/lib/inProcessFactory.js +56 -0
  89. package/.playwright/package/lib/inprocess.js +20 -0
  90. package/.playwright/package/lib/outofprocess.js +67 -0
  91. package/.playwright/package/lib/protocol/debug.js +27 -0
  92. package/.playwright/package/lib/protocol/serializers.js +173 -0
  93. package/.playwright/package/lib/protocol/transport.js +82 -0
  94. package/.playwright/package/lib/protocol/validator.js +2780 -0
  95. package/.playwright/package/lib/protocol/validatorPrimitives.js +139 -0
  96. package/.playwright/package/lib/remote/playwrightConnection.js +275 -0
  97. package/.playwright/package/lib/remote/playwrightServer.js +111 -0
  98. package/.playwright/package/lib/server/accessibility.js +62 -0
  99. package/.playwright/package/lib/server/android/android.js +441 -0
  100. package/.playwright/package/lib/server/android/backendAdb.js +172 -0
  101. package/.playwright/package/lib/server/artifact.js +104 -0
  102. package/.playwright/package/lib/server/bidi/bidiBrowser.js +314 -0
  103. package/.playwright/package/lib/server/bidi/bidiChromium.js +124 -0
  104. package/.playwright/package/lib/server/bidi/bidiConnection.js +204 -0
  105. package/.playwright/package/lib/server/bidi/bidiExecutionContext.js +175 -0
  106. package/.playwright/package/lib/server/bidi/bidiFirefox.js +104 -0
  107. package/.playwright/package/lib/server/bidi/bidiInput.js +160 -0
  108. package/.playwright/package/lib/server/bidi/bidiNetworkManager.js +337 -0
  109. package/.playwright/package/lib/server/bidi/bidiOverCdp.js +103 -0
  110. package/.playwright/package/lib/server/bidi/bidiPage.js +518 -0
  111. package/.playwright/package/lib/server/bidi/bidiPdf.js +140 -0
  112. package/.playwright/package/lib/server/bidi/third_party/bidiDeserializer.js +93 -0
  113. package/.playwright/package/lib/server/bidi/third_party/bidiKeyboard.js +240 -0
  114. package/.playwright/package/lib/server/bidi/third_party/bidiProtocol.js +139 -0
  115. package/.playwright/package/lib/server/bidi/third_party/bidiSerializer.js +144 -0
  116. package/.playwright/package/lib/server/bidi/third_party/firefoxPrefs.js +221 -0
  117. package/.playwright/package/lib/server/browser.js +148 -0
  118. package/.playwright/package/lib/server/browserContext.js +675 -0
  119. package/.playwright/package/lib/server/browserType.js +338 -0
  120. package/.playwright/package/lib/server/chromium/appIcon.png +0 -0
  121. package/.playwright/package/lib/server/chromium/chromium.js +354 -0
  122. package/.playwright/package/lib/server/chromium/chromiumSwitches.js +46 -0
  123. package/.playwright/package/lib/server/chromium/crAccessibility.js +237 -0
  124. package/.playwright/package/lib/server/chromium/crBrowser.js +516 -0
  125. package/.playwright/package/lib/server/chromium/crConnection.js +228 -0
  126. package/.playwright/package/lib/server/chromium/crCoverage.js +246 -0
  127. package/.playwright/package/lib/server/chromium/crDevTools.js +104 -0
  128. package/.playwright/package/lib/server/chromium/crDragDrop.js +143 -0
  129. package/.playwright/package/lib/server/chromium/crExecutionContext.js +132 -0
  130. package/.playwright/package/lib/server/chromium/crInput.js +182 -0
  131. package/.playwright/package/lib/server/chromium/crNetworkManager.js +767 -0
  132. package/.playwright/package/lib/server/chromium/crPage.js +1122 -0
  133. package/.playwright/package/lib/server/chromium/crPdf.js +153 -0
  134. package/.playwright/package/lib/server/chromium/crProtocolHelper.js +133 -0
  135. package/.playwright/package/lib/server/chromium/crServiceWorker.js +112 -0
  136. package/.playwright/package/lib/server/chromium/defaultFontFamilies.js +145 -0
  137. package/.playwright/package/lib/server/chromium/videoRecorder.js +155 -0
  138. package/.playwright/package/lib/server/clock.js +125 -0
  139. package/.playwright/package/lib/server/codegen/csharp.js +304 -0
  140. package/.playwright/package/lib/server/codegen/java.js +243 -0
  141. package/.playwright/package/lib/server/codegen/javascript.js +253 -0
  142. package/.playwright/package/lib/server/codegen/jsonl.js +47 -0
  143. package/.playwright/package/lib/server/codegen/language.js +88 -0
  144. package/.playwright/package/lib/server/codegen/languages.js +30 -0
  145. package/.playwright/package/lib/server/codegen/python.js +262 -0
  146. package/.playwright/package/lib/server/codegen/types.js +5 -0
  147. package/.playwright/package/lib/server/console.js +57 -0
  148. package/.playwright/package/lib/server/cookieStore.js +185 -0
  149. package/.playwright/package/lib/server/debugController.js +212 -0
  150. package/.playwright/package/lib/server/debugger.js +132 -0
  151. package/.playwright/package/lib/server/deviceDescriptors.js +26 -0
  152. package/.playwright/package/lib/server/deviceDescriptorsSource.json +1669 -0
  153. package/.playwright/package/lib/server/dialog.js +71 -0
  154. package/.playwright/package/lib/server/dispatchers/androidDispatcher.js +204 -0
  155. package/.playwright/package/lib/server/dispatchers/artifactDispatcher.js +118 -0
  156. package/.playwright/package/lib/server/dispatchers/browserContextDispatcher.js +357 -0
  157. package/.playwright/package/lib/server/dispatchers/browserDispatcher.js +170 -0
  158. package/.playwright/package/lib/server/dispatchers/browserTypeDispatcher.js +55 -0
  159. package/.playwright/package/lib/server/dispatchers/cdpSessionDispatcher.js +48 -0
  160. package/.playwright/package/lib/server/dispatchers/debugControllerDispatcher.js +105 -0
  161. package/.playwright/package/lib/server/dispatchers/dialogDispatcher.js +44 -0
  162. package/.playwright/package/lib/server/dispatchers/dispatcher.js +395 -0
  163. package/.playwright/package/lib/server/dispatchers/electronDispatcher.js +93 -0
  164. package/.playwright/package/lib/server/dispatchers/elementHandlerDispatcher.js +228 -0
  165. package/.playwright/package/lib/server/dispatchers/frameDispatcher.js +294 -0
  166. package/.playwright/package/lib/server/dispatchers/jsHandleDispatcher.js +97 -0
  167. package/.playwright/package/lib/server/dispatchers/jsonPipeDispatcher.js +59 -0
  168. package/.playwright/package/lib/server/dispatchers/localUtilsDispatcher.js +413 -0
  169. package/.playwright/package/lib/server/dispatchers/networkDispatchers.js +221 -0
  170. package/.playwright/package/lib/server/dispatchers/pageDispatcher.js +367 -0
  171. package/.playwright/package/lib/server/dispatchers/playwrightDispatcher.js +107 -0
  172. package/.playwright/package/lib/server/dispatchers/selectorsDispatcher.js +36 -0
  173. package/.playwright/package/lib/server/dispatchers/streamDispatcher.js +62 -0
  174. package/.playwright/package/lib/server/dispatchers/tracingDispatcher.js +64 -0
  175. package/.playwright/package/lib/server/dispatchers/webSocketRouteDispatcher.js +188 -0
  176. package/.playwright/package/lib/server/dispatchers/writableStreamDispatcher.js +58 -0
  177. package/.playwright/package/lib/server/dom.js +893 -0
  178. package/.playwright/package/lib/server/download.js +60 -0
  179. package/.playwright/package/lib/server/electron/electron.js +296 -0
  180. package/.playwright/package/lib/server/electron/loader.js +57 -0
  181. package/.playwright/package/lib/server/errors.js +68 -0
  182. package/.playwright/package/lib/server/fetch.js +663 -0
  183. package/.playwright/package/lib/server/fileChooser.js +42 -0
  184. package/.playwright/package/lib/server/fileUploadUtils.js +75 -0
  185. package/.playwright/package/lib/server/firefox/ffAccessibility.js +216 -0
  186. package/.playwright/package/lib/server/firefox/ffBrowser.js +462 -0
  187. package/.playwright/package/lib/server/firefox/ffConnection.js +168 -0
  188. package/.playwright/package/lib/server/firefox/ffExecutionContext.js +123 -0
  189. package/.playwright/package/lib/server/firefox/ffInput.js +161 -0
  190. package/.playwright/package/lib/server/firefox/ffNetworkManager.js +233 -0
  191. package/.playwright/package/lib/server/firefox/ffPage.js +544 -0
  192. package/.playwright/package/lib/server/firefox/firefox.js +99 -0
  193. package/.playwright/package/lib/server/formData.js +75 -0
  194. package/.playwright/package/lib/server/frameSelectors.js +171 -0
  195. package/.playwright/package/lib/server/frames.js +1663 -0
  196. package/.playwright/package/lib/server/har/harRecorder.js +139 -0
  197. package/.playwright/package/lib/server/har/harTracer.js +542 -0
  198. package/.playwright/package/lib/server/helper.js +103 -0
  199. package/.playwright/package/lib/server/index.js +108 -0
  200. package/.playwright/package/lib/server/input.js +309 -0
  201. package/.playwright/package/lib/server/instrumentation.js +70 -0
  202. package/.playwright/package/lib/server/isomorphic/utilityScriptSerializers.js +226 -0
  203. package/.playwright/package/lib/server/javascript.js +293 -0
  204. package/.playwright/package/lib/server/launchApp.js +91 -0
  205. package/.playwright/package/lib/server/macEditingCommands.js +139 -0
  206. package/.playwright/package/lib/server/network.js +617 -0
  207. package/.playwright/package/lib/server/page.js +863 -0
  208. package/.playwright/package/lib/server/pipeTransport.js +85 -0
  209. package/.playwright/package/lib/server/playwright.js +88 -0
  210. package/.playwright/package/lib/server/progress.js +99 -0
  211. package/.playwright/package/lib/server/protocolError.js +49 -0
  212. package/.playwright/package/lib/server/recorder/chat.js +177 -0
  213. package/.playwright/package/lib/server/recorder/contextRecorder.js +290 -0
  214. package/.playwright/package/lib/server/recorder/recorderApp.js +187 -0
  215. package/.playwright/package/lib/server/recorder/recorderCollection.js +104 -0
  216. package/.playwright/package/lib/server/recorder/recorderFrontend.js +5 -0
  217. package/.playwright/package/lib/server/recorder/recorderRunner.js +159 -0
  218. package/.playwright/package/lib/server/recorder/recorderUtils.js +89 -0
  219. package/.playwright/package/lib/server/recorder/throttledFile.js +46 -0
  220. package/.playwright/package/lib/server/recorder.js +367 -0
  221. package/.playwright/package/lib/server/registry/browserFetcher.js +168 -0
  222. package/.playwright/package/lib/server/registry/dependencies.js +322 -0
  223. package/.playwright/package/lib/server/registry/index.js +1165 -0
  224. package/.playwright/package/lib/server/registry/nativeDeps.js +496 -0
  225. package/.playwright/package/lib/server/registry/oopDownloadBrowserMain.js +138 -0
  226. package/.playwright/package/lib/server/screenshotter.js +348 -0
  227. package/.playwright/package/lib/server/selectors.js +73 -0
  228. package/.playwright/package/lib/server/socksClientCertificatesInterceptor.js +340 -0
  229. package/.playwright/package/lib/server/socksInterceptor.js +100 -0
  230. package/.playwright/package/lib/server/trace/recorder/snapshotter.js +161 -0
  231. package/.playwright/package/lib/server/trace/recorder/snapshotterInjected.js +518 -0
  232. package/.playwright/package/lib/server/trace/recorder/tracing.js +596 -0
  233. package/.playwright/package/lib/server/trace/test/inMemorySnapshotter.js +93 -0
  234. package/.playwright/package/lib/server/trace/viewer/traceViewer.js +219 -0
  235. package/.playwright/package/lib/server/transport.js +192 -0
  236. package/.playwright/package/lib/server/types.js +24 -0
  237. package/.playwright/package/lib/server/usKeyboardLayout.js +555 -0
  238. package/.playwright/package/lib/server/webkit/webkit.js +87 -0
  239. package/.playwright/package/lib/server/webkit/wkAccessibility.js +194 -0
  240. package/.playwright/package/lib/server/webkit/wkBrowser.js +329 -0
  241. package/.playwright/package/lib/server/webkit/wkConnection.js +173 -0
  242. package/.playwright/package/lib/server/webkit/wkExecutionContext.js +131 -0
  243. package/.playwright/package/lib/server/webkit/wkInput.js +179 -0
  244. package/.playwright/package/lib/server/webkit/wkInterceptableRequest.js +162 -0
  245. package/.playwright/package/lib/server/webkit/wkPage.js +1207 -0
  246. package/.playwright/package/lib/server/webkit/wkProvisionalPage.js +94 -0
  247. package/.playwright/package/lib/server/webkit/wkWorkers.js +104 -0
  248. package/.playwright/package/lib/third_party/pixelmatch.js +255 -0
  249. package/.playwright/package/lib/utils/ascii.js +31 -0
  250. package/.playwright/package/lib/utils/comparators.js +159 -0
  251. package/.playwright/package/lib/utils/crypto.js +171 -0
  252. package/.playwright/package/lib/utils/debug.js +46 -0
  253. package/.playwright/package/lib/utils/debugLogger.js +93 -0
  254. package/.playwright/package/lib/utils/env.js +49 -0
  255. package/.playwright/package/lib/utils/eventsHelper.js +38 -0
  256. package/.playwright/package/lib/utils/expectUtils.js +33 -0
  257. package/.playwright/package/lib/utils/fileUtils.js +205 -0
  258. package/.playwright/package/lib/utils/happy-eyeballs.js +194 -0
  259. package/.playwright/package/lib/utils/headers.js +52 -0
  260. package/.playwright/package/lib/utils/hostPlatform.js +145 -0
  261. package/.playwright/package/lib/utils/httpServer.js +233 -0
  262. package/.playwright/package/lib/utils/index.js +368 -0
  263. package/.playwright/package/lib/utils/isomorphic/ariaSnapshot.js +391 -0
  264. package/.playwright/package/lib/utils/isomorphic/cssParser.js +250 -0
  265. package/.playwright/package/lib/utils/isomorphic/cssTokenizer.js +979 -0
  266. package/.playwright/package/lib/utils/isomorphic/locatorGenerators.js +660 -0
  267. package/.playwright/package/lib/utils/isomorphic/locatorParser.js +185 -0
  268. package/.playwright/package/lib/utils/isomorphic/locatorUtils.js +62 -0
  269. package/.playwright/package/lib/utils/isomorphic/mimeType.js +29 -0
  270. package/.playwright/package/lib/utils/isomorphic/selectorParser.js +397 -0
  271. package/.playwright/package/lib/utils/isomorphic/stringUtils.js +169 -0
  272. package/.playwright/package/lib/utils/isomorphic/traceUtils.js +39 -0
  273. package/.playwright/package/lib/utils/isomorphic/urlMatch.js +122 -0
  274. package/.playwright/package/lib/utils/linuxUtils.js +78 -0
  275. package/.playwright/package/lib/utils/manualPromise.js +109 -0
  276. package/.playwright/package/lib/utils/multimap.js +75 -0
  277. package/.playwright/package/lib/utils/network.js +160 -0
  278. package/.playwright/package/lib/utils/processLauncher.js +248 -0
  279. package/.playwright/package/lib/utils/profiler.js +53 -0
  280. package/.playwright/package/lib/utils/rtti.js +44 -0
  281. package/.playwright/package/lib/utils/semaphore.js +51 -0
  282. package/.playwright/package/lib/utils/sequence.js +64 -0
  283. package/.playwright/package/lib/utils/spawnAsync.js +45 -0
  284. package/.playwright/package/lib/utils/stackTrace.js +134 -0
  285. package/.playwright/package/lib/utils/task.js +58 -0
  286. package/.playwright/package/lib/utils/time.js +37 -0
  287. package/.playwright/package/lib/utils/timeoutRunner.js +66 -0
  288. package/.playwright/package/lib/utils/traceUtils.js +44 -0
  289. package/.playwright/package/lib/utils/userAgent.js +105 -0
  290. package/.playwright/package/lib/utils/wsServer.js +128 -0
  291. package/.playwright/package/lib/utils/zipFile.js +75 -0
  292. package/.playwright/package/lib/utils/zones.js +69 -0
  293. package/.playwright/package/lib/utilsBundle.js +81 -0
  294. package/.playwright/package/lib/utilsBundleImpl/index.js +210 -0
  295. package/.playwright/package/lib/utilsBundleImpl/xdg-open +1066 -0
  296. package/.playwright/package/lib/vite/htmlReport/index.html +69 -0
  297. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
  298. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-k-61wZCK.js +24 -0
  299. package/.playwright/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  300. package/.playwright/package/lib/vite/recorder/assets/index-B70BEW3b.js +184 -0
  301. package/.playwright/package/lib/vite/recorder/assets/index-eHBmevrY.css +1 -0
  302. package/.playwright/package/lib/vite/recorder/index.html +29 -0
  303. package/.playwright/package/lib/vite/recorder/playwright-logo.svg +9 -0
  304. package/.playwright/package/lib/vite/traceViewer/assets/codeMirrorModule-CyuxU5C-.js +24 -0
  305. package/.playwright/package/lib/vite/traceViewer/assets/defaultSettingsView-5nVJRt0A.js +243 -0
  306. package/.playwright/package/lib/vite/traceViewer/assets/xtermModule-c-SNdYZy.js +9 -0
  307. package/.playwright/package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
  308. package/.playwright/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  309. package/.playwright/package/lib/vite/traceViewer/defaultSettingsView.2xeEXCXv.css +1 -0
  310. package/.playwright/package/lib/vite/traceViewer/index.CFOW-Ezb.css +1 -0
  311. package/.playwright/package/lib/vite/traceViewer/index.html +43 -0
  312. package/.playwright/package/lib/vite/traceViewer/index.qVn2ZnpC.js +2 -0
  313. package/.playwright/package/lib/vite/traceViewer/playwright-logo.svg +9 -0
  314. package/.playwright/package/lib/vite/traceViewer/snapshot.html +21 -0
  315. package/.playwright/package/lib/vite/traceViewer/sw.bundle.js +3 -0
  316. package/.playwright/package/lib/vite/traceViewer/uiMode.BatfzHMG.css +1 -0
  317. package/.playwright/package/lib/vite/traceViewer/uiMode.html +17 -0
  318. package/.playwright/package/lib/vite/traceViewer/uiMode.m4IPRPOd.js +5 -0
  319. package/.playwright/package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +32 -0
  320. package/.playwright/package/lib/zipBundle.js +25 -0
  321. package/.playwright/package/lib/zipBundleImpl.js +5 -0
  322. package/.playwright/package/package.json +44 -0
  323. package/.playwright/package/protocol.yml +3758 -0
  324. package/.playwright/package/types/protocol.d.ts +21868 -0
  325. package/.playwright/package/types/structs.d.ts +45 -0
  326. package/.playwright/package/types/types.d.ts +22663 -0
  327. package/README.md +6 -6
  328. package/et +0 -0
  329. package/package.json +7 -2
  330. package/playwright.ps1 +7 -0
  331. package/scripts/playwright-bridge.js +560 -0
@@ -0,0 +1,893 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NonRecoverableDOMError = exports.FrameExecutionContext = exports.ElementHandle = void 0;
7
+ exports.assertDone = assertDone;
8
+ exports.isNonRecoverableDOMError = isNonRecoverableDOMError;
9
+ exports.kUnableToAdoptErrorMessage = void 0;
10
+ exports.throwElementIsNotAttached = throwElementIsNotAttached;
11
+ exports.throwRetargetableDOMError = throwRetargetableDOMError;
12
+ var _fs = _interopRequireDefault(require("fs"));
13
+ var injectedScriptSource = _interopRequireWildcard(require("../generated/injectedScriptSource"));
14
+ var _protocolError = require("./protocolError");
15
+ var js = _interopRequireWildcard(require("./javascript"));
16
+ var _progress = require("./progress");
17
+ var _utils = require("../utils");
18
+ var _fileUploadUtils = require("./fileUploadUtils");
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+ /**
23
+ * Copyright (c) Microsoft Corporation.
24
+ *
25
+ * Licensed under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License.
27
+ * You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software
32
+ * distributed under the License is distributed on an "AS IS" BASIS,
33
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ * See the License for the specific language governing permissions and
35
+ * limitations under the License.
36
+ */
37
+
38
+ class NonRecoverableDOMError extends Error {}
39
+ exports.NonRecoverableDOMError = NonRecoverableDOMError;
40
+ function isNonRecoverableDOMError(error) {
41
+ return error instanceof NonRecoverableDOMError;
42
+ }
43
+ class FrameExecutionContext extends js.ExecutionContext {
44
+ constructor(delegate, frame, world) {
45
+ super(frame, delegate, world || 'content-script');
46
+ this.frame = void 0;
47
+ this._injectedScriptPromise = void 0;
48
+ this.world = void 0;
49
+ this.frame = frame;
50
+ this.world = world;
51
+ }
52
+ adoptIfNeeded(handle) {
53
+ if (handle instanceof ElementHandle && handle._context !== this) return this.frame._page._delegate.adoptElementHandle(handle, this);
54
+ return null;
55
+ }
56
+ async evaluate(pageFunction, arg) {
57
+ return js.evaluate(this, true /* returnByValue */, pageFunction, arg);
58
+ }
59
+ async evaluateHandle(pageFunction, arg) {
60
+ return js.evaluate(this, false /* returnByValue */, pageFunction, arg);
61
+ }
62
+ async evaluateExpression(expression, options, arg) {
63
+ return js.evaluateExpression(this, expression, {
64
+ ...options,
65
+ returnByValue: true
66
+ }, arg);
67
+ }
68
+ async evaluateExpressionHandle(expression, options, arg) {
69
+ return js.evaluateExpression(this, expression, {
70
+ ...options,
71
+ returnByValue: false
72
+ }, arg);
73
+ }
74
+ createHandle(remoteObject) {
75
+ if (this.frame._page._delegate.isElementHandle(remoteObject)) return new ElementHandle(this, remoteObject.objectId);
76
+ return super.createHandle(remoteObject);
77
+ }
78
+ injectedScript() {
79
+ if (!this._injectedScriptPromise) {
80
+ const custom = [];
81
+ const selectorsRegistry = this.frame._page.context().selectors();
82
+ for (const [name, {
83
+ source
84
+ }] of selectorsRegistry._engines) custom.push(`{ name: '${name}', engine: (${source}) }`);
85
+ const sdkLanguage = this.frame.attribution.playwright.options.sdkLanguage;
86
+ const source = `
87
+ (() => {
88
+ const module = {};
89
+ ${injectedScriptSource.source}
90
+ return new (module.exports.InjectedScript())(
91
+ globalThis,
92
+ ${(0, _utils.isUnderTest)()},
93
+ "${sdkLanguage}",
94
+ ${JSON.stringify(selectorsRegistry.testIdAttributeName())},
95
+ ${this.frame._page._delegate.rafCountForStablePosition()},
96
+ "${this.frame._page._browserContext._browser.options.name}",
97
+ [${custom.join(',\n')}]
98
+ );
99
+ })();
100
+ `;
101
+ this._injectedScriptPromise = this.rawEvaluateHandle(source).then(objectId => new js.JSHandle(this, 'object', 'InjectedScript', objectId));
102
+ }
103
+ return this._injectedScriptPromise;
104
+ }
105
+ }
106
+ exports.FrameExecutionContext = FrameExecutionContext;
107
+ class ElementHandle extends js.JSHandle {
108
+ constructor(context, objectId) {
109
+ super(context, 'node', undefined, objectId);
110
+ this.__elementhandle = true;
111
+ this._page = void 0;
112
+ this._frame = void 0;
113
+ this._page = context.frame._page;
114
+ this._frame = context.frame;
115
+ this._initializePreview().catch(e => {});
116
+ }
117
+ async _initializePreview() {
118
+ const utility = await this._context.injectedScript();
119
+ this._setPreview(await utility.evaluate((injected, e) => 'JSHandle@' + injected.previewNode(e), this));
120
+ }
121
+ asElement() {
122
+ return this;
123
+ }
124
+ async evaluateInUtility(pageFunction, arg) {
125
+ try {
126
+ const utility = await this._frame._utilityContext();
127
+ return await utility.evaluate(pageFunction, [await utility.injectedScript(), this, arg]);
128
+ } catch (e) {
129
+ if (js.isJavaScriptErrorInEvaluate(e) || (0, _protocolError.isSessionClosedError)(e)) throw e;
130
+ return 'error:notconnected';
131
+ }
132
+ }
133
+ async evaluateHandleInUtility(pageFunction, arg) {
134
+ try {
135
+ const utility = await this._frame._utilityContext();
136
+ return await utility.evaluateHandle(pageFunction, [await utility.injectedScript(), this, arg]);
137
+ } catch (e) {
138
+ if (js.isJavaScriptErrorInEvaluate(e) || (0, _protocolError.isSessionClosedError)(e)) throw e;
139
+ return 'error:notconnected';
140
+ }
141
+ }
142
+ async ownerFrame() {
143
+ const frameId = await this._page._delegate.getOwnerFrame(this);
144
+ if (!frameId) return null;
145
+ const frame = this._page._frameManager.frame(frameId);
146
+ if (frame) return frame;
147
+ for (const page of this._page._browserContext.pages()) {
148
+ const frame = page._frameManager.frame(frameId);
149
+ if (frame) return frame;
150
+ }
151
+ return null;
152
+ }
153
+ async isIframeElement() {
154
+ return this.evaluateInUtility(([injected, node]) => node && (node.nodeName === 'IFRAME' || node.nodeName === 'FRAME'), {});
155
+ }
156
+ async contentFrame() {
157
+ const isFrameElement = throwRetargetableDOMError(await this.isIframeElement());
158
+ if (!isFrameElement) return null;
159
+ return this._page._delegate.getContentFrame(this);
160
+ }
161
+ async getAttribute(metadata, name) {
162
+ return this._frame.getAttribute(metadata, ':scope', name, {}, this);
163
+ }
164
+ async inputValue(metadata) {
165
+ return this._frame.inputValue(metadata, ':scope', {}, this);
166
+ }
167
+ async textContent(metadata) {
168
+ return this._frame.textContent(metadata, ':scope', {}, this);
169
+ }
170
+ async innerText(metadata) {
171
+ return this._frame.innerText(metadata, ':scope', {}, this);
172
+ }
173
+ async innerHTML(metadata) {
174
+ return this._frame.innerHTML(metadata, ':scope', {}, this);
175
+ }
176
+ async dispatchEvent(metadata, type, eventInit = {}) {
177
+ return this._frame.dispatchEvent(metadata, ':scope', type, eventInit, {}, this);
178
+ }
179
+ async _scrollRectIntoViewIfNeeded(rect) {
180
+ return await this._page._delegate.scrollRectIntoViewIfNeeded(this, rect);
181
+ }
182
+ async _waitAndScrollIntoViewIfNeeded(progress, waitForVisible) {
183
+ const result = await this._retryAction(progress, 'scroll into view', async () => {
184
+ progress.log(` waiting for element to be stable`);
185
+ const waitResult = await this.evaluateInUtility(async ([injected, node, {
186
+ waitForVisible
187
+ }]) => {
188
+ return await injected.checkElementStates(node, waitForVisible ? ['visible', 'stable'] : ['stable']);
189
+ }, {
190
+ waitForVisible
191
+ });
192
+ if (waitResult) return waitResult;
193
+ return await this._scrollRectIntoViewIfNeeded();
194
+ }, {});
195
+ assertDone(throwRetargetableDOMError(result));
196
+ }
197
+ async scrollIntoViewIfNeeded(metadata, options = {}) {
198
+ const controller = new _progress.ProgressController(metadata, this);
199
+ return controller.run(progress => this._waitAndScrollIntoViewIfNeeded(progress, false /* waitForVisible */), this._page._timeoutSettings.timeout(options));
200
+ }
201
+ async _clickablePoint() {
202
+ const intersectQuadWithViewport = quad => {
203
+ return quad.map(point => ({
204
+ x: Math.min(Math.max(point.x, 0), metrics.width),
205
+ y: Math.min(Math.max(point.y, 0), metrics.height)
206
+ }));
207
+ };
208
+ const computeQuadArea = quad => {
209
+ // Compute sum of all directed areas of adjacent triangles
210
+ // https://en.wikipedia.org/wiki/Polygon#Simple_polygons
211
+ let area = 0;
212
+ for (let i = 0; i < quad.length; ++i) {
213
+ const p1 = quad[i];
214
+ const p2 = quad[(i + 1) % quad.length];
215
+ area += (p1.x * p2.y - p2.x * p1.y) / 2;
216
+ }
217
+ return Math.abs(area);
218
+ };
219
+ const [quads, metrics] = await Promise.all([this._page._delegate.getContentQuads(this), this._page.mainFrame()._utilityContext().then(utility => utility.evaluate(() => ({
220
+ width: innerWidth,
221
+ height: innerHeight
222
+ })))]);
223
+ if (quads === 'error:notconnected') return quads;
224
+ if (!quads || !quads.length) return 'error:notvisible';
225
+
226
+ // Allow 1x1 elements. Compensate for rounding errors by comparing with 0.99 instead.
227
+ const filtered = quads.map(quad => intersectQuadWithViewport(quad)).filter(quad => computeQuadArea(quad) > 0.99);
228
+ if (!filtered.length) return 'error:notinviewport';
229
+ if (this._page._browserContext._browser.options.name === 'firefox') {
230
+ // Firefox internally uses integer coordinates, so 8.x is converted to 8 or 9 when clicking.
231
+ //
232
+ // This does not work nicely for small elements. For example, 1x1 square with corners
233
+ // (8;8) and (9;9) is targeted when clicking at (8;8) but not when clicking at (9;9).
234
+ // So, clicking at (8.x;8.y) will sometimes click at (9;9) and miss the target.
235
+ //
236
+ // Therefore, we try to find an integer point within a quad to make sure we click inside the element.
237
+ for (const quad of filtered) {
238
+ const integerPoint = findIntegerPointInsideQuad(quad);
239
+ if (integerPoint) return integerPoint;
240
+ }
241
+ }
242
+ // Return the middle point of the first quad.
243
+ return quadMiddlePoint(filtered[0]);
244
+ }
245
+ async _offsetPoint(offset) {
246
+ const [box, border] = await Promise.all([this.boundingBox(), this.evaluateInUtility(([injected, node]) => injected.getElementBorderWidth(node), {}).catch(e => {})]);
247
+ if (!box || !border) return 'error:notvisible';
248
+ if (border === 'error:notconnected') return border;
249
+ // Make point relative to the padding box to align with offsetX/offsetY.
250
+ return {
251
+ x: box.x + border.left + offset.x,
252
+ y: box.y + border.top + offset.y
253
+ };
254
+ }
255
+ async _retryAction(progress, actionName, action, options) {
256
+ let retry = 0;
257
+ // We progressively wait longer between retries, up to 500ms.
258
+ const waitTime = [0, 20, 100, 100, 500];
259
+ while (progress.isRunning()) {
260
+ if (retry) {
261
+ progress.log(`retrying ${actionName} action${options.trial ? ' (trial run)' : ''}`);
262
+ const timeout = waitTime[Math.min(retry - 1, waitTime.length - 1)];
263
+ if (timeout) {
264
+ progress.log(` waiting ${timeout}ms`);
265
+ const result = await this.evaluateInUtility(([injected, node, timeout]) => new Promise(f => setTimeout(f, timeout)), timeout);
266
+ if (result === 'error:notconnected') return result;
267
+ }
268
+ } else {
269
+ progress.log(`attempting ${actionName} action${options.trial ? ' (trial run)' : ''}`);
270
+ }
271
+ if (!options.skipActionPreChecks && !options.force) await this._frame._page.performActionPreChecks(progress);
272
+ const result = await action(retry);
273
+ ++retry;
274
+ if (result === 'error:notvisible') {
275
+ if (options.force) throw new NonRecoverableDOMError('Element is not visible');
276
+ progress.log(' element is not visible');
277
+ continue;
278
+ }
279
+ if (result === 'error:notinviewport') {
280
+ if (options.force) throw new NonRecoverableDOMError('Element is outside of the viewport');
281
+ progress.log(' element is outside of the viewport');
282
+ continue;
283
+ }
284
+ if (result === 'error:optionsnotfound') {
285
+ progress.log(' did not find some options');
286
+ continue;
287
+ }
288
+ if (typeof result === 'object' && 'hitTargetDescription' in result) {
289
+ progress.log(` ${result.hitTargetDescription} intercepts pointer events`);
290
+ continue;
291
+ }
292
+ if (typeof result === 'object' && 'missingState' in result) {
293
+ progress.log(` element is not ${result.missingState}`);
294
+ continue;
295
+ }
296
+ return result;
297
+ }
298
+ return 'done';
299
+ }
300
+ async _retryPointerAction(progress, actionName, waitForEnabled, action, options) {
301
+ // Note: do not perform locator handlers checkpoint to avoid moving the mouse in the middle of a drag operation.
302
+ const skipActionPreChecks = actionName === 'move and up';
303
+ return await this._retryAction(progress, actionName, async retry => {
304
+ // By default, we scroll with protocol method to reveal the action point.
305
+ // However, that might not work to scroll from under position:sticky elements
306
+ // that overlay the target element. To fight this, we cycle through different
307
+ // scroll alignments. This works in most scenarios.
308
+ const scrollOptions = [undefined, {
309
+ block: 'end',
310
+ inline: 'end'
311
+ }, {
312
+ block: 'center',
313
+ inline: 'center'
314
+ }, {
315
+ block: 'start',
316
+ inline: 'start'
317
+ }];
318
+ const forceScrollOptions = scrollOptions[retry % scrollOptions.length];
319
+ return await this._performPointerAction(progress, actionName, waitForEnabled, action, forceScrollOptions, options);
320
+ }, {
321
+ ...options,
322
+ skipActionPreChecks
323
+ });
324
+ }
325
+ async _performPointerAction(progress, actionName, waitForEnabled, action, forceScrollOptions, options) {
326
+ const {
327
+ force = false,
328
+ position
329
+ } = options;
330
+ const doScrollIntoView = async () => {
331
+ if (forceScrollOptions) {
332
+ return await this.evaluateInUtility(([injected, node, options]) => {
333
+ if (node.nodeType === 1 /* Node.ELEMENT_NODE */) node.scrollIntoView(options);
334
+ return 'done';
335
+ }, forceScrollOptions);
336
+ }
337
+ return await this._scrollRectIntoViewIfNeeded(position ? {
338
+ x: position.x,
339
+ y: position.y,
340
+ width: 0,
341
+ height: 0
342
+ } : undefined);
343
+ };
344
+ if (this._frame.parentFrame()) {
345
+ // Best-effort scroll to make sure any iframes containing this element are scrolled
346
+ // into view and visible, so they are not throttled.
347
+ // See https://github.com/microsoft/playwright/issues/27196 for an example.
348
+ progress.throwIfAborted(); // Avoid action that has side-effects.
349
+ await doScrollIntoView().catch(() => {});
350
+ }
351
+ if (options.__testHookBeforeStable) await options.__testHookBeforeStable();
352
+ if (!force) {
353
+ const elementStates = waitForEnabled ? ['visible', 'enabled', 'stable'] : ['visible', 'stable'];
354
+ progress.log(` waiting for element to be ${waitForEnabled ? 'visible, enabled and stable' : 'visible and stable'}`);
355
+ const result = await this.evaluateInUtility(async ([injected, node, {
356
+ elementStates
357
+ }]) => {
358
+ return await injected.checkElementStates(node, elementStates);
359
+ }, {
360
+ elementStates
361
+ });
362
+ if (result) return result;
363
+ progress.log(` element is ${waitForEnabled ? 'visible, enabled and stable' : 'visible and stable'}`);
364
+ }
365
+ if (options.__testHookAfterStable) await options.__testHookAfterStable();
366
+ progress.log(' scrolling into view if needed');
367
+ progress.throwIfAborted(); // Avoid action that has side-effects.
368
+ const scrolled = await doScrollIntoView();
369
+ if (scrolled !== 'done') return scrolled;
370
+ progress.log(' done scrolling');
371
+ const maybePoint = position ? await this._offsetPoint(position) : await this._clickablePoint();
372
+ if (typeof maybePoint === 'string') return maybePoint;
373
+ const point = roundPoint(maybePoint);
374
+ progress.metadata.point = point;
375
+ await this.instrumentation.onBeforeInputAction(this, progress.metadata);
376
+ let hitTargetInterceptionHandle;
377
+ if (force) {
378
+ progress.log(` forcing action`);
379
+ } else {
380
+ if (options.__testHookBeforeHitTarget) await options.__testHookBeforeHitTarget();
381
+ const frameCheckResult = await this._checkFrameIsHitTarget(point);
382
+ if (frameCheckResult === 'error:notconnected' || 'hitTargetDescription' in frameCheckResult) return frameCheckResult;
383
+ const hitPoint = frameCheckResult.framePoint;
384
+ const actionType = actionName === 'move and up' ? 'drag' : actionName === 'hover' || actionName === 'tap' ? actionName : 'mouse';
385
+ const handle = await this.evaluateHandleInUtility(([injected, node, {
386
+ actionType,
387
+ hitPoint,
388
+ trial
389
+ }]) => injected.setupHitTargetInterceptor(node, actionType, hitPoint, trial), {
390
+ actionType,
391
+ hitPoint,
392
+ trial: !!options.trial
393
+ });
394
+ if (handle === 'error:notconnected') return handle;
395
+ if (!handle._objectId) {
396
+ const error = handle.rawValue();
397
+ if (error === 'error:notconnected') return error;
398
+ return {
399
+ hitTargetDescription: error
400
+ };
401
+ }
402
+ hitTargetInterceptionHandle = handle;
403
+ progress.cleanupWhenAborted(() => {
404
+ // Do not await here, just in case the renderer is stuck (e.g. on alert)
405
+ // and we won't be able to cleanup.
406
+ hitTargetInterceptionHandle.evaluate(h => h.stop()).catch(e => {});
407
+ hitTargetInterceptionHandle.dispose();
408
+ });
409
+ }
410
+ const actionResult = await this._page._frameManager.waitForSignalsCreatedBy(progress, options.waitAfter === true, async () => {
411
+ if (options.__testHookBeforePointerAction) await options.__testHookBeforePointerAction();
412
+ progress.throwIfAborted(); // Avoid action that has side-effects.
413
+ let restoreModifiers;
414
+ if (options && options.modifiers) restoreModifiers = await this._page.keyboard.ensureModifiers(options.modifiers);
415
+ progress.log(` performing ${actionName} action`);
416
+ await action(point);
417
+ if (restoreModifiers) await this._page.keyboard.ensureModifiers(restoreModifiers);
418
+ if (hitTargetInterceptionHandle) {
419
+ const stopHitTargetInterception = this._frame.raceAgainstEvaluationStallingEvents(() => {
420
+ return hitTargetInterceptionHandle.evaluate(h => h.stop());
421
+ }).catch(e => 'done').finally(() => {
422
+ var _hitTargetInterceptio;
423
+ (_hitTargetInterceptio = hitTargetInterceptionHandle) === null || _hitTargetInterceptio === void 0 || _hitTargetInterceptio.dispose();
424
+ });
425
+ if (options.waitAfter !== false) {
426
+ // When noWaitAfter is passed, we do not want to accidentally stall on
427
+ // non-committed navigation blocking the evaluate.
428
+ const hitTargetResult = await stopHitTargetInterception;
429
+ if (hitTargetResult !== 'done') return hitTargetResult;
430
+ }
431
+ }
432
+ progress.log(` ${options.trial ? 'trial ' : ''}${actionName} action done`);
433
+ progress.log(' waiting for scheduled navigations to finish');
434
+ if (options.__testHookAfterPointerAction) await options.__testHookAfterPointerAction();
435
+ return 'done';
436
+ });
437
+ if (actionResult !== 'done') return actionResult;
438
+ progress.log(' navigations have finished');
439
+ return 'done';
440
+ }
441
+ async _markAsTargetElement(metadata) {
442
+ if (!metadata.id) return;
443
+ await this.evaluateInUtility(([injected, node, callId]) => {
444
+ if (node.nodeType === 1 /* Node.ELEMENT_NODE */) injected.markTargetElements(new Set([node]), callId);
445
+ }, metadata.id);
446
+ }
447
+ async hover(metadata, options) {
448
+ const controller = new _progress.ProgressController(metadata, this);
449
+ return controller.run(async progress => {
450
+ await this._markAsTargetElement(metadata);
451
+ const result = await this._hover(progress, options);
452
+ return assertDone(throwRetargetableDOMError(result));
453
+ }, this._page._timeoutSettings.timeout(options));
454
+ }
455
+ _hover(progress, options) {
456
+ return this._retryPointerAction(progress, 'hover', false /* waitForEnabled */, point => this._page.mouse.move(point.x, point.y), {
457
+ ...options,
458
+ waitAfter: 'disabled'
459
+ });
460
+ }
461
+ async click(metadata, options = {}) {
462
+ const controller = new _progress.ProgressController(metadata, this);
463
+ return controller.run(async progress => {
464
+ await this._markAsTargetElement(metadata);
465
+ const result = await this._click(progress, {
466
+ ...options,
467
+ waitAfter: !options.noWaitAfter
468
+ });
469
+ return assertDone(throwRetargetableDOMError(result));
470
+ }, this._page._timeoutSettings.timeout(options));
471
+ }
472
+ _click(progress, options) {
473
+ return this._retryPointerAction(progress, 'click', true /* waitForEnabled */, point => this._page.mouse.click(point.x, point.y, options), options);
474
+ }
475
+ async dblclick(metadata, options) {
476
+ const controller = new _progress.ProgressController(metadata, this);
477
+ return controller.run(async progress => {
478
+ await this._markAsTargetElement(metadata);
479
+ const result = await this._dblclick(progress, options);
480
+ return assertDone(throwRetargetableDOMError(result));
481
+ }, this._page._timeoutSettings.timeout(options));
482
+ }
483
+ _dblclick(progress, options) {
484
+ return this._retryPointerAction(progress, 'dblclick', true /* waitForEnabled */, point => this._page.mouse.dblclick(point.x, point.y, options), {
485
+ ...options,
486
+ waitAfter: 'disabled'
487
+ });
488
+ }
489
+ async tap(metadata, options = {}) {
490
+ const controller = new _progress.ProgressController(metadata, this);
491
+ return controller.run(async progress => {
492
+ await this._markAsTargetElement(metadata);
493
+ const result = await this._tap(progress, options);
494
+ return assertDone(throwRetargetableDOMError(result));
495
+ }, this._page._timeoutSettings.timeout(options));
496
+ }
497
+ _tap(progress, options) {
498
+ return this._retryPointerAction(progress, 'tap', true /* waitForEnabled */, point => this._page.touchscreen.tap(point.x, point.y), {
499
+ ...options,
500
+ waitAfter: 'disabled'
501
+ });
502
+ }
503
+ async selectOption(metadata, elements, values, options) {
504
+ const controller = new _progress.ProgressController(metadata, this);
505
+ return controller.run(async progress => {
506
+ await this._markAsTargetElement(metadata);
507
+ const result = await this._selectOption(progress, elements, values, options);
508
+ return throwRetargetableDOMError(result);
509
+ }, this._page._timeoutSettings.timeout(options));
510
+ }
511
+ async _selectOption(progress, elements, values, options) {
512
+ let resultingOptions = [];
513
+ await this._retryAction(progress, 'select option', async () => {
514
+ await this.instrumentation.onBeforeInputAction(this, progress.metadata);
515
+ if (!options.force) progress.log(` waiting for element to be visible and enabled`);
516
+ const optionsToSelect = [...elements, ...values];
517
+ const result = await this.evaluateInUtility(async ([injected, node, {
518
+ optionsToSelect,
519
+ force
520
+ }]) => {
521
+ if (!force) {
522
+ const checkResult = await injected.checkElementStates(node, ['visible', 'enabled']);
523
+ if (checkResult) return checkResult;
524
+ }
525
+ return injected.selectOptions(node, optionsToSelect);
526
+ }, {
527
+ optionsToSelect,
528
+ force: options.force
529
+ });
530
+ if (Array.isArray(result)) {
531
+ progress.log(' selected specified option(s)');
532
+ resultingOptions = result;
533
+ return 'done';
534
+ }
535
+ return result;
536
+ }, options);
537
+ return resultingOptions;
538
+ }
539
+ async fill(metadata, value, options = {}) {
540
+ const controller = new _progress.ProgressController(metadata, this);
541
+ return controller.run(async progress => {
542
+ await this._markAsTargetElement(metadata);
543
+ const result = await this._fill(progress, value, options);
544
+ assertDone(throwRetargetableDOMError(result));
545
+ }, this._page._timeoutSettings.timeout(options));
546
+ }
547
+ async _fill(progress, value, options) {
548
+ progress.log(` fill("${value}")`);
549
+ return await this._retryAction(progress, 'fill', async () => {
550
+ await this.instrumentation.onBeforeInputAction(this, progress.metadata);
551
+ if (!options.force) progress.log(' waiting for element to be visible, enabled and editable');
552
+ const result = await this.evaluateInUtility(async ([injected, node, {
553
+ value,
554
+ force
555
+ }]) => {
556
+ if (!force) {
557
+ const checkResult = await injected.checkElementStates(node, ['visible', 'enabled', 'editable']);
558
+ if (checkResult) return checkResult;
559
+ }
560
+ return injected.fill(node, value);
561
+ }, {
562
+ value,
563
+ force: options.force
564
+ });
565
+ progress.throwIfAborted(); // Avoid action that has side-effects.
566
+ if (result === 'needsinput') {
567
+ if (value) await this._page.keyboard.insertText(value);else await this._page.keyboard.press('Delete');
568
+ return 'done';
569
+ } else {
570
+ return result;
571
+ }
572
+ }, options);
573
+ }
574
+ async selectText(metadata, options = {}) {
575
+ const controller = new _progress.ProgressController(metadata, this);
576
+ return controller.run(async progress => {
577
+ const result = await this._retryAction(progress, 'selectText', async () => {
578
+ if (!options.force) progress.log(' waiting for element to be visible');
579
+ return await this.evaluateInUtility(async ([injected, node, {
580
+ force
581
+ }]) => {
582
+ if (!force) {
583
+ const checkResult = await injected.checkElementStates(node, ['visible']);
584
+ if (checkResult) return checkResult;
585
+ }
586
+ return injected.selectText(node);
587
+ }, {
588
+ force: options.force
589
+ });
590
+ }, options);
591
+ assertDone(throwRetargetableDOMError(result));
592
+ }, this._page._timeoutSettings.timeout(options));
593
+ }
594
+ async setInputFiles(metadata, params) {
595
+ const inputFileItems = await (0, _fileUploadUtils.prepareFilesForUpload)(this._frame, params);
596
+ const controller = new _progress.ProgressController(metadata, this);
597
+ return controller.run(async progress => {
598
+ await this._markAsTargetElement(metadata);
599
+ const result = await this._setInputFiles(progress, inputFileItems);
600
+ return assertDone(throwRetargetableDOMError(result));
601
+ }, this._page._timeoutSettings.timeout(params));
602
+ }
603
+ async _setInputFiles(progress, items) {
604
+ const {
605
+ filePayloads,
606
+ localPaths,
607
+ localDirectory
608
+ } = items;
609
+ const multiple = filePayloads && filePayloads.length > 1 || localPaths && localPaths.length > 1;
610
+ const result = await this.evaluateHandleInUtility(([injected, node, {
611
+ multiple,
612
+ directoryUpload
613
+ }]) => {
614
+ const element = injected.retarget(node, 'follow-label');
615
+ if (!element) return;
616
+ if (element.tagName !== 'INPUT') throw injected.createStacklessError('Node is not an HTMLInputElement');
617
+ const inputElement = element;
618
+ if (multiple && !inputElement.multiple && !inputElement.webkitdirectory) throw injected.createStacklessError('Non-multiple file input can only accept single file');
619
+ if (directoryUpload && !inputElement.webkitdirectory) throw injected.createStacklessError('File input does not support directories, pass individual files instead');
620
+ if (!directoryUpload && inputElement.webkitdirectory) throw injected.createStacklessError('[webkitdirectory] input requires passing a path to a directory');
621
+ return inputElement;
622
+ }, {
623
+ multiple,
624
+ directoryUpload: !!localDirectory
625
+ });
626
+ if (result === 'error:notconnected' || !result.asElement()) return 'error:notconnected';
627
+ const retargeted = result.asElement();
628
+ await this.instrumentation.onBeforeInputAction(this, progress.metadata);
629
+ progress.throwIfAborted(); // Avoid action that has side-effects.
630
+ if (localPaths || localDirectory) {
631
+ const localPathsOrDirectory = localDirectory ? [localDirectory] : localPaths;
632
+ await Promise.all(localPathsOrDirectory.map(localPath => _fs.default.promises.access(localPath, _fs.default.constants.F_OK)));
633
+ // Browsers traverse the given directory asynchronously and we want to ensure all files are uploaded.
634
+ const waitForInputEvent = localDirectory ? this.evaluate(node => new Promise(fulfill => {
635
+ node.addEventListener('input', fulfill, {
636
+ once: true
637
+ });
638
+ })).catch(() => {}) : Promise.resolve();
639
+ await this._page._delegate.setInputFilePaths(retargeted, localPathsOrDirectory);
640
+ await waitForInputEvent;
641
+ } else {
642
+ await this._page._delegate.setInputFiles(retargeted, filePayloads);
643
+ }
644
+ return 'done';
645
+ }
646
+ async focus(metadata) {
647
+ const controller = new _progress.ProgressController(metadata, this);
648
+ await controller.run(async progress => {
649
+ await this._markAsTargetElement(metadata);
650
+ const result = await this._focus(progress);
651
+ return assertDone(throwRetargetableDOMError(result));
652
+ }, 0);
653
+ }
654
+ async _focus(progress, resetSelectionIfNotFocused) {
655
+ progress.throwIfAborted(); // Avoid action that has side-effects.
656
+ return await this.evaluateInUtility(([injected, node, resetSelectionIfNotFocused]) => injected.focusNode(node, resetSelectionIfNotFocused), resetSelectionIfNotFocused);
657
+ }
658
+ async _blur(progress) {
659
+ progress.throwIfAborted(); // Avoid action that has side-effects.
660
+ return await this.evaluateInUtility(([injected, node]) => injected.blurNode(node), {});
661
+ }
662
+ async type(metadata, text, options) {
663
+ const controller = new _progress.ProgressController(metadata, this);
664
+ return controller.run(async progress => {
665
+ await this._markAsTargetElement(metadata);
666
+ const result = await this._type(progress, text, options);
667
+ return assertDone(throwRetargetableDOMError(result));
668
+ }, this._page._timeoutSettings.timeout(options));
669
+ }
670
+ async _type(progress, text, options) {
671
+ progress.log(`elementHandle.type("${text}")`);
672
+ await this.instrumentation.onBeforeInputAction(this, progress.metadata);
673
+ const result = await this._focus(progress, true /* resetSelectionIfNotFocused */);
674
+ if (result !== 'done') return result;
675
+ progress.throwIfAborted(); // Avoid action that has side-effects.
676
+ await this._page.keyboard.type(text, options);
677
+ return 'done';
678
+ }
679
+ async press(metadata, key, options) {
680
+ const controller = new _progress.ProgressController(metadata, this);
681
+ return controller.run(async progress => {
682
+ await this._markAsTargetElement(metadata);
683
+ const result = await this._press(progress, key, options);
684
+ return assertDone(throwRetargetableDOMError(result));
685
+ }, this._page._timeoutSettings.timeout(options));
686
+ }
687
+ async _press(progress, key, options) {
688
+ progress.log(`elementHandle.press("${key}")`);
689
+ await this.instrumentation.onBeforeInputAction(this, progress.metadata);
690
+ return this._page._frameManager.waitForSignalsCreatedBy(progress, !options.noWaitAfter, async () => {
691
+ const result = await this._focus(progress, true /* resetSelectionIfNotFocused */);
692
+ if (result !== 'done') return result;
693
+ progress.throwIfAborted(); // Avoid action that has side-effects.
694
+ await this._page.keyboard.press(key, options);
695
+ return 'done';
696
+ });
697
+ }
698
+ async check(metadata, options) {
699
+ const controller = new _progress.ProgressController(metadata, this);
700
+ return controller.run(async progress => {
701
+ const result = await this._setChecked(progress, true, options);
702
+ return assertDone(throwRetargetableDOMError(result));
703
+ }, this._page._timeoutSettings.timeout(options));
704
+ }
705
+ async uncheck(metadata, options) {
706
+ const controller = new _progress.ProgressController(metadata, this);
707
+ return controller.run(async progress => {
708
+ const result = await this._setChecked(progress, false, options);
709
+ return assertDone(throwRetargetableDOMError(result));
710
+ }, this._page._timeoutSettings.timeout(options));
711
+ }
712
+ async _setChecked(progress, state, options) {
713
+ const isChecked = async () => {
714
+ const result = await this.evaluateInUtility(([injected, node]) => injected.elementState(node, 'checked'), {});
715
+ if (result === 'error:notconnected' || result.received === 'error:notconnected') throwElementIsNotAttached();
716
+ return result.matches;
717
+ };
718
+ await this._markAsTargetElement(progress.metadata);
719
+ if ((await isChecked()) === state) return 'done';
720
+ const result = await this._click(progress, {
721
+ ...options,
722
+ waitAfter: 'disabled'
723
+ });
724
+ if (result !== 'done') return result;
725
+ if (options.trial) return 'done';
726
+ if ((await isChecked()) !== state) throw new NonRecoverableDOMError('Clicking the checkbox did not change its state');
727
+ return 'done';
728
+ }
729
+ async boundingBox() {
730
+ return this._page._delegate.getBoundingBox(this);
731
+ }
732
+ async ariaSnapshot() {
733
+ return await this.evaluateInUtility(([injected, element]) => injected.ariaSnapshot(element), {});
734
+ }
735
+ async screenshot(metadata, options = {}) {
736
+ const controller = new _progress.ProgressController(metadata, this);
737
+ return controller.run(progress => this._page._screenshotter.screenshotElement(progress, this, options), this._page._timeoutSettings.timeout(options));
738
+ }
739
+ async querySelector(selector, options) {
740
+ return this._frame.selectors.query(selector, options, this);
741
+ }
742
+ async querySelectorAll(selector) {
743
+ return this._frame.selectors.queryAll(selector, this);
744
+ }
745
+ async evalOnSelector(selector, strict, expression, isFunction, arg) {
746
+ return this._frame.evalOnSelector(selector, strict, expression, isFunction, arg, this);
747
+ }
748
+ async evalOnSelectorAll(selector, expression, isFunction, arg) {
749
+ return this._frame.evalOnSelectorAll(selector, expression, isFunction, arg, this);
750
+ }
751
+ async isVisible(metadata) {
752
+ return this._frame.isVisible(metadata, ':scope', {}, this);
753
+ }
754
+ async isHidden(metadata) {
755
+ return this._frame.isHidden(metadata, ':scope', {}, this);
756
+ }
757
+ async isEnabled(metadata) {
758
+ return this._frame.isEnabled(metadata, ':scope', {}, this);
759
+ }
760
+ async isDisabled(metadata) {
761
+ return this._frame.isDisabled(metadata, ':scope', {}, this);
762
+ }
763
+ async isEditable(metadata) {
764
+ return this._frame.isEditable(metadata, ':scope', {}, this);
765
+ }
766
+ async isChecked(metadata) {
767
+ return this._frame.isChecked(metadata, ':scope', {}, this);
768
+ }
769
+ async waitForElementState(metadata, state, options = {}) {
770
+ const controller = new _progress.ProgressController(metadata, this);
771
+ return controller.run(async progress => {
772
+ const actionName = `wait for ${state}`;
773
+ const result = await this._retryAction(progress, actionName, async () => {
774
+ return await this.evaluateInUtility(async ([injected, node, state]) => {
775
+ return (await injected.checkElementStates(node, [state])) || 'done';
776
+ }, state);
777
+ }, {});
778
+ assertDone(throwRetargetableDOMError(result));
779
+ }, this._page._timeoutSettings.timeout(options));
780
+ }
781
+ async waitForSelector(metadata, selector, options = {}) {
782
+ return this._frame.waitForSelector(metadata, selector, options, this);
783
+ }
784
+ async _adoptTo(context) {
785
+ if (this._context !== context) {
786
+ const adopted = await this._page._delegate.adoptElementHandle(this, context);
787
+ this.dispose();
788
+ return adopted;
789
+ }
790
+ return this;
791
+ }
792
+ async _checkFrameIsHitTarget(point) {
793
+ let frame = this._frame;
794
+ const data = [];
795
+ while (frame.parentFrame()) {
796
+ const frameElement = await frame.frameElement();
797
+ const box = await frameElement.boundingBox();
798
+ const style = await frameElement.evaluateInUtility(([injected, iframe]) => injected.describeIFrameStyle(iframe), {}).catch(e => 'error:notconnected');
799
+ if (!box || style === 'error:notconnected') return 'error:notconnected';
800
+ if (style === 'transformed') {
801
+ // We cannot translate coordinates when iframe has any transform applied.
802
+ // The best we can do right now is to skip the hitPoint check,
803
+ // and solely rely on the event interceptor.
804
+ return {
805
+ framePoint: undefined
806
+ };
807
+ }
808
+ // Translate from viewport coordinates to frame coordinates.
809
+ const pointInFrame = {
810
+ x: point.x - box.x - style.left,
811
+ y: point.y - box.y - style.top
812
+ };
813
+ data.push({
814
+ frame,
815
+ frameElement,
816
+ pointInFrame
817
+ });
818
+ frame = frame.parentFrame();
819
+ }
820
+ // Add main frame.
821
+ data.push({
822
+ frame,
823
+ frameElement: null,
824
+ pointInFrame: point
825
+ });
826
+ for (let i = data.length - 1; i > 0; i--) {
827
+ const element = data[i - 1].frameElement;
828
+ const point = data[i].pointInFrame;
829
+ // Hit target in the parent frame should hit the child frame element.
830
+ const hitTargetResult = await element.evaluateInUtility(([injected, element, hitPoint]) => {
831
+ return injected.expectHitTarget(hitPoint, element);
832
+ }, point);
833
+ if (hitTargetResult !== 'done') return hitTargetResult;
834
+ }
835
+ return {
836
+ framePoint: data[0].pointInFrame
837
+ };
838
+ }
839
+ }
840
+ exports.ElementHandle = ElementHandle;
841
+ function throwRetargetableDOMError(result) {
842
+ if (result === 'error:notconnected') throwElementIsNotAttached();
843
+ return result;
844
+ }
845
+ function throwElementIsNotAttached() {
846
+ throw new Error('Element is not attached to the DOM');
847
+ }
848
+ function assertDone(result) {
849
+ // This function converts 'done' to void and ensures typescript catches unhandled errors.
850
+ }
851
+ function roundPoint(point) {
852
+ return {
853
+ x: (point.x * 100 | 0) / 100,
854
+ y: (point.y * 100 | 0) / 100
855
+ };
856
+ }
857
+ function quadMiddlePoint(quad) {
858
+ const result = {
859
+ x: 0,
860
+ y: 0
861
+ };
862
+ for (const point of quad) {
863
+ result.x += point.x / 4;
864
+ result.y += point.y / 4;
865
+ }
866
+ return result;
867
+ }
868
+ function triangleArea(p1, p2, p3) {
869
+ return Math.abs(p1.x * (p2.y - p3.y) + p2.x * (p3.y - p1.y) + p3.x * (p1.y - p2.y)) / 2;
870
+ }
871
+ function isPointInsideQuad(point, quad) {
872
+ const area1 = triangleArea(point, quad[0], quad[1]) + triangleArea(point, quad[1], quad[2]) + triangleArea(point, quad[2], quad[3]) + triangleArea(point, quad[3], quad[0]);
873
+ const area2 = triangleArea(quad[0], quad[1], quad[2]) + triangleArea(quad[1], quad[2], quad[3]);
874
+ // Check that point is inside the quad.
875
+ if (Math.abs(area1 - area2) > 0.1) return false;
876
+ // Check that point is not on the right/bottom edge, because clicking
877
+ // there does not actually click the element.
878
+ return point.x < Math.max(quad[0].x, quad[1].x, quad[2].x, quad[3].x) && point.y < Math.max(quad[0].y, quad[1].y, quad[2].y, quad[3].y);
879
+ }
880
+ function findIntegerPointInsideQuad(quad) {
881
+ // Try all four rounding directions of the middle point.
882
+ const point = quadMiddlePoint(quad);
883
+ point.x = Math.floor(point.x);
884
+ point.y = Math.floor(point.y);
885
+ if (isPointInsideQuad(point, quad)) return point;
886
+ point.x += 1;
887
+ if (isPointInsideQuad(point, quad)) return point;
888
+ point.y += 1;
889
+ if (isPointInsideQuad(point, quad)) return point;
890
+ point.x -= 1;
891
+ if (isPointInsideQuad(point, quad)) return point;
892
+ }
893
+ const kUnableToAdoptErrorMessage = exports.kUnableToAdoptErrorMessage = 'Unable to adopt element handle from a different document';