easytouch-linux 1.0.7 → 1.0.18

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 (337) hide show
  1. package/LICENSE.txt +201 -0
  2. package/README.md +33 -314
  3. package/SKILL.md +366 -0
  4. package/bin/arm64/et +0 -0
  5. package/bin/et.js +60 -0
  6. package/bin/x64/et +0 -0
  7. package/package.json +19 -37
  8. package/.playwright/node/LICENSE +0 -2607
  9. package/.playwright/node/linux-x64/node +0 -0
  10. package/.playwright/package/README.md +0 -3
  11. package/.playwright/package/ThirdPartyNotices.txt +0 -1602
  12. package/.playwright/package/api.json +0 -1
  13. package/.playwright/package/bin/install_media_pack.ps1 +0 -5
  14. package/.playwright/package/bin/reinstall_chrome_beta_linux.sh +0 -42
  15. package/.playwright/package/bin/reinstall_chrome_beta_mac.sh +0 -13
  16. package/.playwright/package/bin/reinstall_chrome_beta_win.ps1 +0 -24
  17. package/.playwright/package/bin/reinstall_chrome_stable_linux.sh +0 -42
  18. package/.playwright/package/bin/reinstall_chrome_stable_mac.sh +0 -12
  19. package/.playwright/package/bin/reinstall_chrome_stable_win.ps1 +0 -24
  20. package/.playwright/package/bin/reinstall_msedge_beta_linux.sh +0 -48
  21. package/.playwright/package/bin/reinstall_msedge_beta_mac.sh +0 -11
  22. package/.playwright/package/bin/reinstall_msedge_beta_win.ps1 +0 -23
  23. package/.playwright/package/bin/reinstall_msedge_dev_linux.sh +0 -48
  24. package/.playwright/package/bin/reinstall_msedge_dev_mac.sh +0 -11
  25. package/.playwright/package/bin/reinstall_msedge_dev_win.ps1 +0 -23
  26. package/.playwright/package/bin/reinstall_msedge_stable_linux.sh +0 -48
  27. package/.playwright/package/bin/reinstall_msedge_stable_mac.sh +0 -11
  28. package/.playwright/package/bin/reinstall_msedge_stable_win.ps1 +0 -24
  29. package/.playwright/package/browsers.json +0 -66
  30. package/.playwright/package/cli.js +0 -18
  31. package/.playwright/package/index.d.ts +0 -17
  32. package/.playwright/package/index.js +0 -33
  33. package/.playwright/package/index.mjs +0 -28
  34. package/.playwright/package/lib/androidServerImpl.js +0 -69
  35. package/.playwright/package/lib/browserServerImpl.js +0 -92
  36. package/.playwright/package/lib/cli/driver.js +0 -95
  37. package/.playwright/package/lib/cli/program.js +0 -583
  38. package/.playwright/package/lib/cli/programWithTestStub.js +0 -67
  39. package/.playwright/package/lib/client/accessibility.js +0 -50
  40. package/.playwright/package/lib/client/android.js +0 -473
  41. package/.playwright/package/lib/client/api.js +0 -285
  42. package/.playwright/package/lib/client/artifact.js +0 -79
  43. package/.playwright/package/lib/client/browser.js +0 -145
  44. package/.playwright/package/lib/client/browserContext.js +0 -559
  45. package/.playwright/package/lib/client/browserType.js +0 -241
  46. package/.playwright/package/lib/client/cdpSession.js +0 -53
  47. package/.playwright/package/lib/client/channelOwner.js +0 -215
  48. package/.playwright/package/lib/client/clientHelper.js +0 -57
  49. package/.playwright/package/lib/client/clientInstrumentation.js +0 -52
  50. package/.playwright/package/lib/client/clock.js +0 -68
  51. package/.playwright/package/lib/client/connection.js +0 -333
  52. package/.playwright/package/lib/client/consoleMessage.js +0 -55
  53. package/.playwright/package/lib/client/coverage.js +0 -41
  54. package/.playwright/package/lib/client/dialog.js +0 -57
  55. package/.playwright/package/lib/client/download.js +0 -62
  56. package/.playwright/package/lib/client/electron.js +0 -135
  57. package/.playwright/package/lib/client/elementHandle.js +0 -321
  58. package/.playwright/package/lib/client/errors.js +0 -77
  59. package/.playwright/package/lib/client/eventEmitter.js +0 -314
  60. package/.playwright/package/lib/client/events.js +0 -94
  61. package/.playwright/package/lib/client/fetch.js +0 -391
  62. package/.playwright/package/lib/client/fileChooser.js +0 -45
  63. package/.playwright/package/lib/client/frame.js +0 -504
  64. package/.playwright/package/lib/client/harRouter.js +0 -99
  65. package/.playwright/package/lib/client/input.js +0 -111
  66. package/.playwright/package/lib/client/jsHandle.js +0 -121
  67. package/.playwright/package/lib/client/jsonPipe.js +0 -35
  68. package/.playwright/package/lib/client/localUtils.js +0 -36
  69. package/.playwright/package/lib/client/locator.js +0 -448
  70. package/.playwright/package/lib/client/network.js +0 -769
  71. package/.playwright/package/lib/client/page.js +0 -748
  72. package/.playwright/package/lib/client/playwright.js +0 -80
  73. package/.playwright/package/lib/client/selectors.js +0 -67
  74. package/.playwright/package/lib/client/stream.js +0 -54
  75. package/.playwright/package/lib/client/tracing.js +0 -147
  76. package/.playwright/package/lib/client/types.js +0 -24
  77. package/.playwright/package/lib/client/video.js +0 -51
  78. package/.playwright/package/lib/client/waiter.js +0 -162
  79. package/.playwright/package/lib/client/webError.js +0 -37
  80. package/.playwright/package/lib/client/worker.js +0 -71
  81. package/.playwright/package/lib/client/writableStream.js +0 -54
  82. package/.playwright/package/lib/common/socksProxy.js +0 -569
  83. package/.playwright/package/lib/common/timeoutSettings.js +0 -73
  84. package/.playwright/package/lib/common/types.js +0 -5
  85. package/.playwright/package/lib/generated/clockSource.js +0 -7
  86. package/.playwright/package/lib/generated/consoleApiSource.js +0 -7
  87. package/.playwright/package/lib/generated/injectedScriptSource.js +0 -7
  88. package/.playwright/package/lib/generated/pollingRecorderSource.js +0 -7
  89. package/.playwright/package/lib/generated/utilityScriptSource.js +0 -7
  90. package/.playwright/package/lib/generated/webSocketMockSource.js +0 -7
  91. package/.playwright/package/lib/image_tools/colorUtils.js +0 -98
  92. package/.playwright/package/lib/image_tools/compare.js +0 -108
  93. package/.playwright/package/lib/image_tools/imageChannel.js +0 -70
  94. package/.playwright/package/lib/image_tools/stats.js +0 -102
  95. package/.playwright/package/lib/inProcessFactory.js +0 -56
  96. package/.playwright/package/lib/inprocess.js +0 -20
  97. package/.playwright/package/lib/outofprocess.js +0 -67
  98. package/.playwright/package/lib/protocol/debug.js +0 -27
  99. package/.playwright/package/lib/protocol/serializers.js +0 -173
  100. package/.playwright/package/lib/protocol/transport.js +0 -82
  101. package/.playwright/package/lib/protocol/validator.js +0 -2780
  102. package/.playwright/package/lib/protocol/validatorPrimitives.js +0 -139
  103. package/.playwright/package/lib/remote/playwrightConnection.js +0 -275
  104. package/.playwright/package/lib/remote/playwrightServer.js +0 -111
  105. package/.playwright/package/lib/server/accessibility.js +0 -62
  106. package/.playwright/package/lib/server/android/android.js +0 -441
  107. package/.playwright/package/lib/server/android/backendAdb.js +0 -172
  108. package/.playwright/package/lib/server/artifact.js +0 -104
  109. package/.playwright/package/lib/server/bidi/bidiBrowser.js +0 -314
  110. package/.playwright/package/lib/server/bidi/bidiChromium.js +0 -124
  111. package/.playwright/package/lib/server/bidi/bidiConnection.js +0 -204
  112. package/.playwright/package/lib/server/bidi/bidiExecutionContext.js +0 -175
  113. package/.playwright/package/lib/server/bidi/bidiFirefox.js +0 -104
  114. package/.playwright/package/lib/server/bidi/bidiInput.js +0 -160
  115. package/.playwright/package/lib/server/bidi/bidiNetworkManager.js +0 -337
  116. package/.playwright/package/lib/server/bidi/bidiOverCdp.js +0 -103
  117. package/.playwright/package/lib/server/bidi/bidiPage.js +0 -518
  118. package/.playwright/package/lib/server/bidi/bidiPdf.js +0 -140
  119. package/.playwright/package/lib/server/bidi/third_party/bidiDeserializer.js +0 -93
  120. package/.playwright/package/lib/server/bidi/third_party/bidiKeyboard.js +0 -240
  121. package/.playwright/package/lib/server/bidi/third_party/bidiProtocol.js +0 -139
  122. package/.playwright/package/lib/server/bidi/third_party/bidiSerializer.js +0 -144
  123. package/.playwright/package/lib/server/bidi/third_party/firefoxPrefs.js +0 -221
  124. package/.playwright/package/lib/server/browser.js +0 -148
  125. package/.playwright/package/lib/server/browserContext.js +0 -675
  126. package/.playwright/package/lib/server/browserType.js +0 -338
  127. package/.playwright/package/lib/server/chromium/appIcon.png +0 -0
  128. package/.playwright/package/lib/server/chromium/chromium.js +0 -354
  129. package/.playwright/package/lib/server/chromium/chromiumSwitches.js +0 -46
  130. package/.playwright/package/lib/server/chromium/crAccessibility.js +0 -237
  131. package/.playwright/package/lib/server/chromium/crBrowser.js +0 -516
  132. package/.playwright/package/lib/server/chromium/crConnection.js +0 -228
  133. package/.playwright/package/lib/server/chromium/crCoverage.js +0 -246
  134. package/.playwright/package/lib/server/chromium/crDevTools.js +0 -104
  135. package/.playwright/package/lib/server/chromium/crDragDrop.js +0 -143
  136. package/.playwright/package/lib/server/chromium/crExecutionContext.js +0 -132
  137. package/.playwright/package/lib/server/chromium/crInput.js +0 -182
  138. package/.playwright/package/lib/server/chromium/crNetworkManager.js +0 -767
  139. package/.playwright/package/lib/server/chromium/crPage.js +0 -1122
  140. package/.playwright/package/lib/server/chromium/crPdf.js +0 -153
  141. package/.playwright/package/lib/server/chromium/crProtocolHelper.js +0 -133
  142. package/.playwright/package/lib/server/chromium/crServiceWorker.js +0 -112
  143. package/.playwright/package/lib/server/chromium/defaultFontFamilies.js +0 -145
  144. package/.playwright/package/lib/server/chromium/videoRecorder.js +0 -155
  145. package/.playwright/package/lib/server/clock.js +0 -125
  146. package/.playwright/package/lib/server/codegen/csharp.js +0 -304
  147. package/.playwright/package/lib/server/codegen/java.js +0 -243
  148. package/.playwright/package/lib/server/codegen/javascript.js +0 -253
  149. package/.playwright/package/lib/server/codegen/jsonl.js +0 -47
  150. package/.playwright/package/lib/server/codegen/language.js +0 -88
  151. package/.playwright/package/lib/server/codegen/languages.js +0 -30
  152. package/.playwright/package/lib/server/codegen/python.js +0 -262
  153. package/.playwright/package/lib/server/codegen/types.js +0 -5
  154. package/.playwright/package/lib/server/console.js +0 -57
  155. package/.playwright/package/lib/server/cookieStore.js +0 -185
  156. package/.playwright/package/lib/server/debugController.js +0 -212
  157. package/.playwright/package/lib/server/debugger.js +0 -132
  158. package/.playwright/package/lib/server/deviceDescriptors.js +0 -26
  159. package/.playwright/package/lib/server/deviceDescriptorsSource.json +0 -1669
  160. package/.playwright/package/lib/server/dialog.js +0 -71
  161. package/.playwright/package/lib/server/dispatchers/androidDispatcher.js +0 -204
  162. package/.playwright/package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  163. package/.playwright/package/lib/server/dispatchers/browserContextDispatcher.js +0 -357
  164. package/.playwright/package/lib/server/dispatchers/browserDispatcher.js +0 -170
  165. package/.playwright/package/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
  166. package/.playwright/package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -48
  167. package/.playwright/package/lib/server/dispatchers/debugControllerDispatcher.js +0 -105
  168. package/.playwright/package/lib/server/dispatchers/dialogDispatcher.js +0 -44
  169. package/.playwright/package/lib/server/dispatchers/dispatcher.js +0 -395
  170. package/.playwright/package/lib/server/dispatchers/electronDispatcher.js +0 -93
  171. package/.playwright/package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -228
  172. package/.playwright/package/lib/server/dispatchers/frameDispatcher.js +0 -294
  173. package/.playwright/package/lib/server/dispatchers/jsHandleDispatcher.js +0 -97
  174. package/.playwright/package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -59
  175. package/.playwright/package/lib/server/dispatchers/localUtilsDispatcher.js +0 -413
  176. package/.playwright/package/lib/server/dispatchers/networkDispatchers.js +0 -221
  177. package/.playwright/package/lib/server/dispatchers/pageDispatcher.js +0 -367
  178. package/.playwright/package/lib/server/dispatchers/playwrightDispatcher.js +0 -107
  179. package/.playwright/package/lib/server/dispatchers/selectorsDispatcher.js +0 -36
  180. package/.playwright/package/lib/server/dispatchers/streamDispatcher.js +0 -62
  181. package/.playwright/package/lib/server/dispatchers/tracingDispatcher.js +0 -64
  182. package/.playwright/package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -188
  183. package/.playwright/package/lib/server/dispatchers/writableStreamDispatcher.js +0 -58
  184. package/.playwright/package/lib/server/dom.js +0 -893
  185. package/.playwright/package/lib/server/download.js +0 -60
  186. package/.playwright/package/lib/server/electron/electron.js +0 -296
  187. package/.playwright/package/lib/server/electron/loader.js +0 -57
  188. package/.playwright/package/lib/server/errors.js +0 -68
  189. package/.playwright/package/lib/server/fetch.js +0 -663
  190. package/.playwright/package/lib/server/fileChooser.js +0 -42
  191. package/.playwright/package/lib/server/fileUploadUtils.js +0 -75
  192. package/.playwright/package/lib/server/firefox/ffAccessibility.js +0 -216
  193. package/.playwright/package/lib/server/firefox/ffBrowser.js +0 -462
  194. package/.playwright/package/lib/server/firefox/ffConnection.js +0 -168
  195. package/.playwright/package/lib/server/firefox/ffExecutionContext.js +0 -123
  196. package/.playwright/package/lib/server/firefox/ffInput.js +0 -161
  197. package/.playwright/package/lib/server/firefox/ffNetworkManager.js +0 -233
  198. package/.playwright/package/lib/server/firefox/ffPage.js +0 -544
  199. package/.playwright/package/lib/server/firefox/firefox.js +0 -99
  200. package/.playwright/package/lib/server/formData.js +0 -75
  201. package/.playwright/package/lib/server/frameSelectors.js +0 -171
  202. package/.playwright/package/lib/server/frames.js +0 -1663
  203. package/.playwright/package/lib/server/har/harRecorder.js +0 -139
  204. package/.playwright/package/lib/server/har/harTracer.js +0 -542
  205. package/.playwright/package/lib/server/helper.js +0 -103
  206. package/.playwright/package/lib/server/index.js +0 -108
  207. package/.playwright/package/lib/server/input.js +0 -309
  208. package/.playwright/package/lib/server/instrumentation.js +0 -70
  209. package/.playwright/package/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
  210. package/.playwright/package/lib/server/javascript.js +0 -293
  211. package/.playwright/package/lib/server/launchApp.js +0 -91
  212. package/.playwright/package/lib/server/macEditingCommands.js +0 -139
  213. package/.playwright/package/lib/server/network.js +0 -617
  214. package/.playwright/package/lib/server/page.js +0 -863
  215. package/.playwright/package/lib/server/pipeTransport.js +0 -85
  216. package/.playwright/package/lib/server/playwright.js +0 -88
  217. package/.playwright/package/lib/server/progress.js +0 -99
  218. package/.playwright/package/lib/server/protocolError.js +0 -49
  219. package/.playwright/package/lib/server/recorder/chat.js +0 -177
  220. package/.playwright/package/lib/server/recorder/contextRecorder.js +0 -290
  221. package/.playwright/package/lib/server/recorder/recorderApp.js +0 -187
  222. package/.playwright/package/lib/server/recorder/recorderCollection.js +0 -104
  223. package/.playwright/package/lib/server/recorder/recorderFrontend.js +0 -5
  224. package/.playwright/package/lib/server/recorder/recorderRunner.js +0 -159
  225. package/.playwright/package/lib/server/recorder/recorderUtils.js +0 -89
  226. package/.playwright/package/lib/server/recorder/throttledFile.js +0 -46
  227. package/.playwright/package/lib/server/recorder.js +0 -367
  228. package/.playwright/package/lib/server/registry/browserFetcher.js +0 -168
  229. package/.playwright/package/lib/server/registry/dependencies.js +0 -322
  230. package/.playwright/package/lib/server/registry/index.js +0 -1165
  231. package/.playwright/package/lib/server/registry/nativeDeps.js +0 -496
  232. package/.playwright/package/lib/server/registry/oopDownloadBrowserMain.js +0 -138
  233. package/.playwright/package/lib/server/screenshotter.js +0 -348
  234. package/.playwright/package/lib/server/selectors.js +0 -73
  235. package/.playwright/package/lib/server/socksClientCertificatesInterceptor.js +0 -340
  236. package/.playwright/package/lib/server/socksInterceptor.js +0 -100
  237. package/.playwright/package/lib/server/trace/recorder/snapshotter.js +0 -161
  238. package/.playwright/package/lib/server/trace/recorder/snapshotterInjected.js +0 -518
  239. package/.playwright/package/lib/server/trace/recorder/tracing.js +0 -596
  240. package/.playwright/package/lib/server/trace/test/inMemorySnapshotter.js +0 -93
  241. package/.playwright/package/lib/server/trace/viewer/traceViewer.js +0 -219
  242. package/.playwright/package/lib/server/transport.js +0 -192
  243. package/.playwright/package/lib/server/types.js +0 -24
  244. package/.playwright/package/lib/server/usKeyboardLayout.js +0 -555
  245. package/.playwright/package/lib/server/webkit/webkit.js +0 -87
  246. package/.playwright/package/lib/server/webkit/wkAccessibility.js +0 -194
  247. package/.playwright/package/lib/server/webkit/wkBrowser.js +0 -329
  248. package/.playwright/package/lib/server/webkit/wkConnection.js +0 -173
  249. package/.playwright/package/lib/server/webkit/wkExecutionContext.js +0 -131
  250. package/.playwright/package/lib/server/webkit/wkInput.js +0 -179
  251. package/.playwright/package/lib/server/webkit/wkInterceptableRequest.js +0 -162
  252. package/.playwright/package/lib/server/webkit/wkPage.js +0 -1207
  253. package/.playwright/package/lib/server/webkit/wkProvisionalPage.js +0 -94
  254. package/.playwright/package/lib/server/webkit/wkWorkers.js +0 -104
  255. package/.playwright/package/lib/third_party/pixelmatch.js +0 -255
  256. package/.playwright/package/lib/utils/ascii.js +0 -31
  257. package/.playwright/package/lib/utils/comparators.js +0 -159
  258. package/.playwright/package/lib/utils/crypto.js +0 -171
  259. package/.playwright/package/lib/utils/debug.js +0 -46
  260. package/.playwright/package/lib/utils/debugLogger.js +0 -93
  261. package/.playwright/package/lib/utils/env.js +0 -49
  262. package/.playwright/package/lib/utils/eventsHelper.js +0 -38
  263. package/.playwright/package/lib/utils/expectUtils.js +0 -33
  264. package/.playwright/package/lib/utils/fileUtils.js +0 -205
  265. package/.playwright/package/lib/utils/happy-eyeballs.js +0 -194
  266. package/.playwright/package/lib/utils/headers.js +0 -52
  267. package/.playwright/package/lib/utils/hostPlatform.js +0 -145
  268. package/.playwright/package/lib/utils/httpServer.js +0 -233
  269. package/.playwright/package/lib/utils/index.js +0 -368
  270. package/.playwright/package/lib/utils/isomorphic/ariaSnapshot.js +0 -391
  271. package/.playwright/package/lib/utils/isomorphic/cssParser.js +0 -250
  272. package/.playwright/package/lib/utils/isomorphic/cssTokenizer.js +0 -979
  273. package/.playwright/package/lib/utils/isomorphic/locatorGenerators.js +0 -660
  274. package/.playwright/package/lib/utils/isomorphic/locatorParser.js +0 -185
  275. package/.playwright/package/lib/utils/isomorphic/locatorUtils.js +0 -62
  276. package/.playwright/package/lib/utils/isomorphic/mimeType.js +0 -29
  277. package/.playwright/package/lib/utils/isomorphic/selectorParser.js +0 -397
  278. package/.playwright/package/lib/utils/isomorphic/stringUtils.js +0 -169
  279. package/.playwright/package/lib/utils/isomorphic/traceUtils.js +0 -39
  280. package/.playwright/package/lib/utils/isomorphic/urlMatch.js +0 -122
  281. package/.playwright/package/lib/utils/linuxUtils.js +0 -78
  282. package/.playwright/package/lib/utils/manualPromise.js +0 -109
  283. package/.playwright/package/lib/utils/multimap.js +0 -75
  284. package/.playwright/package/lib/utils/network.js +0 -160
  285. package/.playwright/package/lib/utils/processLauncher.js +0 -248
  286. package/.playwright/package/lib/utils/profiler.js +0 -53
  287. package/.playwright/package/lib/utils/rtti.js +0 -44
  288. package/.playwright/package/lib/utils/semaphore.js +0 -51
  289. package/.playwright/package/lib/utils/sequence.js +0 -64
  290. package/.playwright/package/lib/utils/spawnAsync.js +0 -45
  291. package/.playwright/package/lib/utils/stackTrace.js +0 -134
  292. package/.playwright/package/lib/utils/task.js +0 -58
  293. package/.playwright/package/lib/utils/time.js +0 -37
  294. package/.playwright/package/lib/utils/timeoutRunner.js +0 -66
  295. package/.playwright/package/lib/utils/traceUtils.js +0 -44
  296. package/.playwright/package/lib/utils/userAgent.js +0 -105
  297. package/.playwright/package/lib/utils/wsServer.js +0 -128
  298. package/.playwright/package/lib/utils/zipFile.js +0 -75
  299. package/.playwright/package/lib/utils/zones.js +0 -69
  300. package/.playwright/package/lib/utilsBundle.js +0 -81
  301. package/.playwright/package/lib/utilsBundleImpl/index.js +0 -210
  302. package/.playwright/package/lib/utilsBundleImpl/xdg-open +0 -1066
  303. package/.playwright/package/lib/vite/htmlReport/index.html +0 -69
  304. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +0 -1
  305. package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-k-61wZCK.js +0 -24
  306. package/.playwright/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  307. package/.playwright/package/lib/vite/recorder/assets/index-B70BEW3b.js +0 -184
  308. package/.playwright/package/lib/vite/recorder/assets/index-eHBmevrY.css +0 -1
  309. package/.playwright/package/lib/vite/recorder/index.html +0 -29
  310. package/.playwright/package/lib/vite/recorder/playwright-logo.svg +0 -9
  311. package/.playwright/package/lib/vite/traceViewer/assets/codeMirrorModule-CyuxU5C-.js +0 -24
  312. package/.playwright/package/lib/vite/traceViewer/assets/defaultSettingsView-5nVJRt0A.js +0 -243
  313. package/.playwright/package/lib/vite/traceViewer/assets/xtermModule-c-SNdYZy.js +0 -9
  314. package/.playwright/package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +0 -1
  315. package/.playwright/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  316. package/.playwright/package/lib/vite/traceViewer/defaultSettingsView.2xeEXCXv.css +0 -1
  317. package/.playwright/package/lib/vite/traceViewer/index.CFOW-Ezb.css +0 -1
  318. package/.playwright/package/lib/vite/traceViewer/index.html +0 -43
  319. package/.playwright/package/lib/vite/traceViewer/index.qVn2ZnpC.js +0 -2
  320. package/.playwright/package/lib/vite/traceViewer/playwright-logo.svg +0 -9
  321. package/.playwright/package/lib/vite/traceViewer/snapshot.html +0 -21
  322. package/.playwright/package/lib/vite/traceViewer/sw.bundle.js +0 -3
  323. package/.playwright/package/lib/vite/traceViewer/uiMode.BatfzHMG.css +0 -1
  324. package/.playwright/package/lib/vite/traceViewer/uiMode.html +0 -17
  325. package/.playwright/package/lib/vite/traceViewer/uiMode.m4IPRPOd.js +0 -5
  326. package/.playwright/package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +0 -32
  327. package/.playwright/package/lib/zipBundle.js +0 -25
  328. package/.playwright/package/lib/zipBundleImpl.js +0 -5
  329. package/.playwright/package/package.json +0 -44
  330. package/.playwright/package/protocol.yml +0 -3758
  331. package/.playwright/package/types/protocol.d.ts +0 -21868
  332. package/.playwright/package/types/structs.d.ts +0 -45
  333. package/.playwright/package/types/types.d.ts +0 -22663
  334. package/et +0 -0
  335. package/install.js +0 -19
  336. package/playwright.ps1 +0 -7
  337. package/scripts/playwright-bridge.js +0 -560
@@ -1,893 +0,0 @@
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';