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,660 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PythonLocatorFactory = exports.JsonlLocatorFactory = exports.JavaScriptLocatorFactory = exports.JavaLocatorFactory = exports.CSharpLocatorFactory = void 0;
7
+ exports.asLocator = asLocator;
8
+ exports.asLocators = asLocators;
9
+ var _stringUtils = require("./stringUtils");
10
+ var _selectorParser = require("./selectorParser");
11
+ /**
12
+ * Copyright (c) Microsoft Corporation.
13
+ *
14
+ * Licensed under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License.
16
+ * You may obtain a copy of the License at
17
+ *
18
+ * http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software
21
+ * distributed under the License is distributed on an "AS IS" BASIS,
22
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ * See the License for the specific language governing permissions and
24
+ * limitations under the License.
25
+ */
26
+
27
+ function asLocator(lang, selector, isFrameLocator = false) {
28
+ return asLocators(lang, selector, isFrameLocator, 1)[0];
29
+ }
30
+ function asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {
31
+ try {
32
+ return innerAsLocators(new generators[lang](preferredQuote), (0, _selectorParser.parseSelector)(selector), isFrameLocator, maxOutputSize);
33
+ } catch (e) {
34
+ // Tolerate invalid input.
35
+ return [selector];
36
+ }
37
+ }
38
+ function innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {
39
+ const parts = [...parsed.parts];
40
+ const tokens = [];
41
+ let nextBase = isFrameLocator ? 'frame-locator' : 'page';
42
+ for (let index = 0; index < parts.length; index++) {
43
+ const part = parts[index];
44
+ const base = nextBase;
45
+ nextBase = 'locator';
46
+ if (part.name === 'nth') {
47
+ if (part.body === '0') tokens.push([factory.generateLocator(base, 'first', ''), factory.generateLocator(base, 'nth', '0')]);else if (part.body === '-1') tokens.push([factory.generateLocator(base, 'last', ''), factory.generateLocator(base, 'nth', '-1')]);else tokens.push([factory.generateLocator(base, 'nth', part.body)]);
48
+ continue;
49
+ }
50
+ if (part.name === 'internal:text') {
51
+ const {
52
+ exact,
53
+ text
54
+ } = detectExact(part.body);
55
+ tokens.push([factory.generateLocator(base, 'text', text, {
56
+ exact
57
+ })]);
58
+ continue;
59
+ }
60
+ if (part.name === 'internal:has-text') {
61
+ const {
62
+ exact,
63
+ text
64
+ } = detectExact(part.body);
65
+ // There is no locator equivalent for strict has-text, leave it as is.
66
+ if (!exact) {
67
+ tokens.push([factory.generateLocator(base, 'has-text', text, {
68
+ exact
69
+ })]);
70
+ continue;
71
+ }
72
+ }
73
+ if (part.name === 'internal:has-not-text') {
74
+ const {
75
+ exact,
76
+ text
77
+ } = detectExact(part.body);
78
+ // There is no locator equivalent for strict has-not-text, leave it as is.
79
+ if (!exact) {
80
+ tokens.push([factory.generateLocator(base, 'has-not-text', text, {
81
+ exact
82
+ })]);
83
+ continue;
84
+ }
85
+ }
86
+ if (part.name === 'internal:has') {
87
+ const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
88
+ tokens.push(inners.map(inner => factory.generateLocator(base, 'has', inner)));
89
+ continue;
90
+ }
91
+ if (part.name === 'internal:has-not') {
92
+ const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
93
+ tokens.push(inners.map(inner => factory.generateLocator(base, 'hasNot', inner)));
94
+ continue;
95
+ }
96
+ if (part.name === 'internal:and') {
97
+ const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
98
+ tokens.push(inners.map(inner => factory.generateLocator(base, 'and', inner)));
99
+ continue;
100
+ }
101
+ if (part.name === 'internal:or') {
102
+ const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
103
+ tokens.push(inners.map(inner => factory.generateLocator(base, 'or', inner)));
104
+ continue;
105
+ }
106
+ if (part.name === 'internal:chain') {
107
+ const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
108
+ tokens.push(inners.map(inner => factory.generateLocator(base, 'chain', inner)));
109
+ continue;
110
+ }
111
+ if (part.name === 'internal:label') {
112
+ const {
113
+ exact,
114
+ text
115
+ } = detectExact(part.body);
116
+ tokens.push([factory.generateLocator(base, 'label', text, {
117
+ exact
118
+ })]);
119
+ continue;
120
+ }
121
+ if (part.name === 'internal:role') {
122
+ const attrSelector = (0, _selectorParser.parseAttributeSelector)(part.body, true);
123
+ const options = {
124
+ attrs: []
125
+ };
126
+ for (const attr of attrSelector.attributes) {
127
+ if (attr.name === 'name') {
128
+ options.exact = attr.caseSensitive;
129
+ options.name = attr.value;
130
+ } else {
131
+ if (attr.name === 'level' && typeof attr.value === 'string') attr.value = +attr.value;
132
+ options.attrs.push({
133
+ name: attr.name === 'include-hidden' ? 'includeHidden' : attr.name,
134
+ value: attr.value
135
+ });
136
+ }
137
+ }
138
+ tokens.push([factory.generateLocator(base, 'role', attrSelector.name, options)]);
139
+ continue;
140
+ }
141
+ if (part.name === 'internal:testid') {
142
+ const attrSelector = (0, _selectorParser.parseAttributeSelector)(part.body, true);
143
+ const {
144
+ value
145
+ } = attrSelector.attributes[0];
146
+ tokens.push([factory.generateLocator(base, 'test-id', value)]);
147
+ continue;
148
+ }
149
+ if (part.name === 'internal:attr') {
150
+ const attrSelector = (0, _selectorParser.parseAttributeSelector)(part.body, true);
151
+ const {
152
+ name,
153
+ value,
154
+ caseSensitive
155
+ } = attrSelector.attributes[0];
156
+ const text = value;
157
+ const exact = !!caseSensitive;
158
+ if (name === 'placeholder') {
159
+ tokens.push([factory.generateLocator(base, 'placeholder', text, {
160
+ exact
161
+ })]);
162
+ continue;
163
+ }
164
+ if (name === 'alt') {
165
+ tokens.push([factory.generateLocator(base, 'alt', text, {
166
+ exact
167
+ })]);
168
+ continue;
169
+ }
170
+ if (name === 'title') {
171
+ tokens.push([factory.generateLocator(base, 'title', text, {
172
+ exact
173
+ })]);
174
+ continue;
175
+ }
176
+ }
177
+ if (part.name === 'internal:control' && part.body === 'enter-frame') {
178
+ // transform last tokens from `${selector}` into `${selector}.contentFrame()` and `frameLocator(${selector})`
179
+ const lastTokens = tokens[tokens.length - 1];
180
+ const lastPart = parts[index - 1];
181
+ const transformed = lastTokens.map(token => factory.chainLocators([token, factory.generateLocator(base, 'frame', '')]));
182
+ if (['xpath', 'css'].includes(lastPart.name)) {
183
+ transformed.push(factory.generateLocator(base, 'frame-locator', (0, _selectorParser.stringifySelector)({
184
+ parts: [lastPart]
185
+ })), factory.generateLocator(base, 'frame-locator', (0, _selectorParser.stringifySelector)({
186
+ parts: [lastPart]
187
+ }, true)));
188
+ }
189
+ lastTokens.splice(0, lastTokens.length, ...transformed);
190
+ nextBase = 'frame-locator';
191
+ continue;
192
+ }
193
+ const nextPart = parts[index + 1];
194
+ const selectorPart = (0, _selectorParser.stringifySelector)({
195
+ parts: [part]
196
+ });
197
+ const locatorPart = factory.generateLocator(base, 'default', selectorPart);
198
+ if (nextPart && ['internal:has-text', 'internal:has-not-text'].includes(nextPart.name)) {
199
+ const {
200
+ exact,
201
+ text
202
+ } = detectExact(nextPart.body);
203
+ // There is no locator equivalent for strict has-text and has-not-text, leave it as is.
204
+ if (!exact) {
205
+ const nextLocatorPart = factory.generateLocator('locator', nextPart.name === 'internal:has-text' ? 'has-text' : 'has-not-text', text, {
206
+ exact
207
+ });
208
+ const options = {};
209
+ if (nextPart.name === 'internal:has-text') options.hasText = text;else options.hasNotText = text;
210
+ const combinedPart = factory.generateLocator(base, 'default', selectorPart, options);
211
+ // Two options:
212
+ // - locator('div').filter({ hasText: 'foo' })
213
+ // - locator('div', { hasText: 'foo' })
214
+ tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);
215
+ index++;
216
+ continue;
217
+ }
218
+ }
219
+
220
+ // Selectors can be prefixed with engine name, e.g. xpath=//foo
221
+ let locatorPartWithEngine;
222
+ if (['xpath', 'css'].includes(part.name)) {
223
+ const selectorPart = (0, _selectorParser.stringifySelector)({
224
+ parts: [part]
225
+ }, /* forceEngineName */true);
226
+ locatorPartWithEngine = factory.generateLocator(base, 'default', selectorPart);
227
+ }
228
+ tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));
229
+ }
230
+ return combineTokens(factory, tokens, maxOutputSize);
231
+ }
232
+ function combineTokens(factory, tokens, maxOutputSize) {
233
+ const currentTokens = tokens.map(() => '');
234
+ const result = [];
235
+ const visit = index => {
236
+ if (index === tokens.length) {
237
+ result.push(factory.chainLocators(currentTokens));
238
+ return result.length < maxOutputSize;
239
+ }
240
+ for (const taken of tokens[index]) {
241
+ currentTokens[index] = taken;
242
+ if (!visit(index + 1)) return false;
243
+ }
244
+ return true;
245
+ };
246
+ visit(0);
247
+ return result;
248
+ }
249
+ function detectExact(text) {
250
+ let exact = false;
251
+ const match = text.match(/^\/(.*)\/([igm]*)$/);
252
+ if (match) return {
253
+ text: new RegExp(match[1], match[2])
254
+ };
255
+ if (text.endsWith('"')) {
256
+ text = JSON.parse(text);
257
+ exact = true;
258
+ } else if (text.endsWith('"s')) {
259
+ text = JSON.parse(text.substring(0, text.length - 1));
260
+ exact = true;
261
+ } else if (text.endsWith('"i')) {
262
+ text = JSON.parse(text.substring(0, text.length - 1));
263
+ exact = false;
264
+ }
265
+ return {
266
+ exact,
267
+ text
268
+ };
269
+ }
270
+ class JavaScriptLocatorFactory {
271
+ constructor(preferredQuote) {
272
+ this.preferredQuote = preferredQuote;
273
+ }
274
+ generateLocator(base, kind, body, options = {}) {
275
+ switch (kind) {
276
+ case 'default':
277
+ if (options.hasText !== undefined) return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;
278
+ if (options.hasNotText !== undefined) return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;
279
+ return `locator(${this.quote(body)})`;
280
+ case 'frame-locator':
281
+ return `frameLocator(${this.quote(body)})`;
282
+ case 'frame':
283
+ return `contentFrame()`;
284
+ case 'nth':
285
+ return `nth(${body})`;
286
+ case 'first':
287
+ return `first()`;
288
+ case 'last':
289
+ return `last()`;
290
+ case 'role':
291
+ const attrs = [];
292
+ if (isRegExp(options.name)) {
293
+ attrs.push(`name: ${this.regexToSourceString(options.name)}`);
294
+ } else if (typeof options.name === 'string') {
295
+ attrs.push(`name: ${this.quote(options.name)}`);
296
+ if (options.exact) attrs.push(`exact: true`);
297
+ }
298
+ for (const {
299
+ name,
300
+ value
301
+ } of options.attrs) attrs.push(`${name}: ${typeof value === 'string' ? this.quote(value) : value}`);
302
+ const attrString = attrs.length ? `, { ${attrs.join(', ')} }` : '';
303
+ return `getByRole(${this.quote(body)}${attrString})`;
304
+ case 'has-text':
305
+ return `filter({ hasText: ${this.toHasText(body)} })`;
306
+ case 'has-not-text':
307
+ return `filter({ hasNotText: ${this.toHasText(body)} })`;
308
+ case 'has':
309
+ return `filter({ has: ${body} })`;
310
+ case 'hasNot':
311
+ return `filter({ hasNot: ${body} })`;
312
+ case 'and':
313
+ return `and(${body})`;
314
+ case 'or':
315
+ return `or(${body})`;
316
+ case 'chain':
317
+ return `locator(${body})`;
318
+ case 'test-id':
319
+ return `getByTestId(${this.toTestIdValue(body)})`;
320
+ case 'text':
321
+ return this.toCallWithExact('getByText', body, !!options.exact);
322
+ case 'alt':
323
+ return this.toCallWithExact('getByAltText', body, !!options.exact);
324
+ case 'placeholder':
325
+ return this.toCallWithExact('getByPlaceholder', body, !!options.exact);
326
+ case 'label':
327
+ return this.toCallWithExact('getByLabel', body, !!options.exact);
328
+ case 'title':
329
+ return this.toCallWithExact('getByTitle', body, !!options.exact);
330
+ default:
331
+ throw new Error('Unknown selector kind ' + kind);
332
+ }
333
+ }
334
+ chainLocators(locators) {
335
+ return locators.join('.');
336
+ }
337
+ regexToSourceString(re) {
338
+ return (0, _stringUtils.normalizeEscapedRegexQuotes)(String(re));
339
+ }
340
+ toCallWithExact(method, body, exact) {
341
+ if (isRegExp(body)) return `${method}(${this.regexToSourceString(body)})`;
342
+ return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;
343
+ }
344
+ toHasText(body) {
345
+ if (isRegExp(body)) return this.regexToSourceString(body);
346
+ return this.quote(body);
347
+ }
348
+ toTestIdValue(value) {
349
+ if (isRegExp(value)) return this.regexToSourceString(value);
350
+ return this.quote(value);
351
+ }
352
+ quote(text) {
353
+ var _this$preferredQuote;
354
+ return (0, _stringUtils.escapeWithQuotes)(text, (_this$preferredQuote = this.preferredQuote) !== null && _this$preferredQuote !== void 0 ? _this$preferredQuote : '\'');
355
+ }
356
+ }
357
+ exports.JavaScriptLocatorFactory = JavaScriptLocatorFactory;
358
+ class PythonLocatorFactory {
359
+ generateLocator(base, kind, body, options = {}) {
360
+ switch (kind) {
361
+ case 'default':
362
+ if (options.hasText !== undefined) return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;
363
+ if (options.hasNotText !== undefined) return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;
364
+ return `locator(${this.quote(body)})`;
365
+ case 'frame-locator':
366
+ return `frame_locator(${this.quote(body)})`;
367
+ case 'frame':
368
+ return `content_frame`;
369
+ case 'nth':
370
+ return `nth(${body})`;
371
+ case 'first':
372
+ return `first`;
373
+ case 'last':
374
+ return `last`;
375
+ case 'role':
376
+ const attrs = [];
377
+ if (isRegExp(options.name)) {
378
+ attrs.push(`name=${this.regexToString(options.name)}`);
379
+ } else if (typeof options.name === 'string') {
380
+ attrs.push(`name=${this.quote(options.name)}`);
381
+ if (options.exact) attrs.push(`exact=True`);
382
+ }
383
+ for (const {
384
+ name,
385
+ value
386
+ } of options.attrs) {
387
+ let valueString = typeof value === 'string' ? this.quote(value) : value;
388
+ if (typeof value === 'boolean') valueString = value ? 'True' : 'False';
389
+ attrs.push(`${(0, _stringUtils.toSnakeCase)(name)}=${valueString}`);
390
+ }
391
+ const attrString = attrs.length ? `, ${attrs.join(', ')}` : '';
392
+ return `get_by_role(${this.quote(body)}${attrString})`;
393
+ case 'has-text':
394
+ return `filter(has_text=${this.toHasText(body)})`;
395
+ case 'has-not-text':
396
+ return `filter(has_not_text=${this.toHasText(body)})`;
397
+ case 'has':
398
+ return `filter(has=${body})`;
399
+ case 'hasNot':
400
+ return `filter(has_not=${body})`;
401
+ case 'and':
402
+ return `and_(${body})`;
403
+ case 'or':
404
+ return `or_(${body})`;
405
+ case 'chain':
406
+ return `locator(${body})`;
407
+ case 'test-id':
408
+ return `get_by_test_id(${this.toTestIdValue(body)})`;
409
+ case 'text':
410
+ return this.toCallWithExact('get_by_text', body, !!options.exact);
411
+ case 'alt':
412
+ return this.toCallWithExact('get_by_alt_text', body, !!options.exact);
413
+ case 'placeholder':
414
+ return this.toCallWithExact('get_by_placeholder', body, !!options.exact);
415
+ case 'label':
416
+ return this.toCallWithExact('get_by_label', body, !!options.exact);
417
+ case 'title':
418
+ return this.toCallWithExact('get_by_title', body, !!options.exact);
419
+ default:
420
+ throw new Error('Unknown selector kind ' + kind);
421
+ }
422
+ }
423
+ chainLocators(locators) {
424
+ return locators.join('.');
425
+ }
426
+ regexToString(body) {
427
+ const suffix = body.flags.includes('i') ? ', re.IGNORECASE' : '';
428
+ return `re.compile(r"${(0, _stringUtils.normalizeEscapedRegexQuotes)(body.source).replace(/\\\//, '/').replace(/"/g, '\\"')}"${suffix})`;
429
+ }
430
+ toCallWithExact(method, body, exact) {
431
+ if (isRegExp(body)) return `${method}(${this.regexToString(body)})`;
432
+ if (exact) return `${method}(${this.quote(body)}, exact=True)`;
433
+ return `${method}(${this.quote(body)})`;
434
+ }
435
+ toHasText(body) {
436
+ if (isRegExp(body)) return this.regexToString(body);
437
+ return `${this.quote(body)}`;
438
+ }
439
+ toTestIdValue(value) {
440
+ if (isRegExp(value)) return this.regexToString(value);
441
+ return this.quote(value);
442
+ }
443
+ quote(text) {
444
+ return (0, _stringUtils.escapeWithQuotes)(text, '\"');
445
+ }
446
+ }
447
+ exports.PythonLocatorFactory = PythonLocatorFactory;
448
+ class JavaLocatorFactory {
449
+ generateLocator(base, kind, body, options = {}) {
450
+ let clazz;
451
+ switch (base) {
452
+ case 'page':
453
+ clazz = 'Page';
454
+ break;
455
+ case 'frame-locator':
456
+ clazz = 'FrameLocator';
457
+ break;
458
+ case 'locator':
459
+ clazz = 'Locator';
460
+ break;
461
+ }
462
+ switch (kind) {
463
+ case 'default':
464
+ if (options.hasText !== undefined) return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;
465
+ if (options.hasNotText !== undefined) return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;
466
+ return `locator(${this.quote(body)})`;
467
+ case 'frame-locator':
468
+ return `frameLocator(${this.quote(body)})`;
469
+ case 'frame':
470
+ return `contentFrame()`;
471
+ case 'nth':
472
+ return `nth(${body})`;
473
+ case 'first':
474
+ return `first()`;
475
+ case 'last':
476
+ return `last()`;
477
+ case 'role':
478
+ const attrs = [];
479
+ if (isRegExp(options.name)) {
480
+ attrs.push(`.setName(${this.regexToString(options.name)})`);
481
+ } else if (typeof options.name === 'string') {
482
+ attrs.push(`.setName(${this.quote(options.name)})`);
483
+ if (options.exact) attrs.push(`.setExact(true)`);
484
+ }
485
+ for (const {
486
+ name,
487
+ value
488
+ } of options.attrs) attrs.push(`.set${(0, _stringUtils.toTitleCase)(name)}(${typeof value === 'string' ? this.quote(value) : value})`);
489
+ const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join('')}` : '';
490
+ return `getByRole(AriaRole.${(0, _stringUtils.toSnakeCase)(body).toUpperCase()}${attrString})`;
491
+ case 'has-text':
492
+ return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;
493
+ case 'has-not-text':
494
+ return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;
495
+ case 'has':
496
+ return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;
497
+ case 'hasNot':
498
+ return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;
499
+ case 'and':
500
+ return `and(${body})`;
501
+ case 'or':
502
+ return `or(${body})`;
503
+ case 'chain':
504
+ return `locator(${body})`;
505
+ case 'test-id':
506
+ return `getByTestId(${this.toTestIdValue(body)})`;
507
+ case 'text':
508
+ return this.toCallWithExact(clazz, 'getByText', body, !!options.exact);
509
+ case 'alt':
510
+ return this.toCallWithExact(clazz, 'getByAltText', body, !!options.exact);
511
+ case 'placeholder':
512
+ return this.toCallWithExact(clazz, 'getByPlaceholder', body, !!options.exact);
513
+ case 'label':
514
+ return this.toCallWithExact(clazz, 'getByLabel', body, !!options.exact);
515
+ case 'title':
516
+ return this.toCallWithExact(clazz, 'getByTitle', body, !!options.exact);
517
+ default:
518
+ throw new Error('Unknown selector kind ' + kind);
519
+ }
520
+ }
521
+ chainLocators(locators) {
522
+ return locators.join('.');
523
+ }
524
+ regexToString(body) {
525
+ const suffix = body.flags.includes('i') ? ', Pattern.CASE_INSENSITIVE' : '';
526
+ return `Pattern.compile(${this.quote((0, _stringUtils.normalizeEscapedRegexQuotes)(body.source))}${suffix})`;
527
+ }
528
+ toCallWithExact(clazz, method, body, exact) {
529
+ if (isRegExp(body)) return `${method}(${this.regexToString(body)})`;
530
+ if (exact) return `${method}(${this.quote(body)}, new ${clazz}.${(0, _stringUtils.toTitleCase)(method)}Options().setExact(true))`;
531
+ return `${method}(${this.quote(body)})`;
532
+ }
533
+ toHasText(body) {
534
+ if (isRegExp(body)) return this.regexToString(body);
535
+ return this.quote(body);
536
+ }
537
+ toTestIdValue(value) {
538
+ if (isRegExp(value)) return this.regexToString(value);
539
+ return this.quote(value);
540
+ }
541
+ quote(text) {
542
+ return (0, _stringUtils.escapeWithQuotes)(text, '\"');
543
+ }
544
+ }
545
+ exports.JavaLocatorFactory = JavaLocatorFactory;
546
+ class CSharpLocatorFactory {
547
+ generateLocator(base, kind, body, options = {}) {
548
+ switch (kind) {
549
+ case 'default':
550
+ if (options.hasText !== undefined) return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;
551
+ if (options.hasNotText !== undefined) return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;
552
+ return `Locator(${this.quote(body)})`;
553
+ case 'frame-locator':
554
+ return `FrameLocator(${this.quote(body)})`;
555
+ case 'frame':
556
+ return `ContentFrame`;
557
+ case 'nth':
558
+ return `Nth(${body})`;
559
+ case 'first':
560
+ return `First`;
561
+ case 'last':
562
+ return `Last`;
563
+ case 'role':
564
+ const attrs = [];
565
+ if (isRegExp(options.name)) {
566
+ attrs.push(`NameRegex = ${this.regexToString(options.name)}`);
567
+ } else if (typeof options.name === 'string') {
568
+ attrs.push(`Name = ${this.quote(options.name)}`);
569
+ if (options.exact) attrs.push(`Exact = true`);
570
+ }
571
+ for (const {
572
+ name,
573
+ value
574
+ } of options.attrs) attrs.push(`${(0, _stringUtils.toTitleCase)(name)} = ${typeof value === 'string' ? this.quote(value) : value}`);
575
+ const attrString = attrs.length ? `, new() { ${attrs.join(', ')} }` : '';
576
+ return `GetByRole(AriaRole.${(0, _stringUtils.toTitleCase)(body)}${attrString})`;
577
+ case 'has-text':
578
+ return `Filter(new() { ${this.toHasText(body)} })`;
579
+ case 'has-not-text':
580
+ return `Filter(new() { ${this.toHasNotText(body)} })`;
581
+ case 'has':
582
+ return `Filter(new() { Has = ${body} })`;
583
+ case 'hasNot':
584
+ return `Filter(new() { HasNot = ${body} })`;
585
+ case 'and':
586
+ return `And(${body})`;
587
+ case 'or':
588
+ return `Or(${body})`;
589
+ case 'chain':
590
+ return `Locator(${body})`;
591
+ case 'test-id':
592
+ return `GetByTestId(${this.toTestIdValue(body)})`;
593
+ case 'text':
594
+ return this.toCallWithExact('GetByText', body, !!options.exact);
595
+ case 'alt':
596
+ return this.toCallWithExact('GetByAltText', body, !!options.exact);
597
+ case 'placeholder':
598
+ return this.toCallWithExact('GetByPlaceholder', body, !!options.exact);
599
+ case 'label':
600
+ return this.toCallWithExact('GetByLabel', body, !!options.exact);
601
+ case 'title':
602
+ return this.toCallWithExact('GetByTitle', body, !!options.exact);
603
+ default:
604
+ throw new Error('Unknown selector kind ' + kind);
605
+ }
606
+ }
607
+ chainLocators(locators) {
608
+ return locators.join('.');
609
+ }
610
+ regexToString(body) {
611
+ const suffix = body.flags.includes('i') ? ', RegexOptions.IgnoreCase' : '';
612
+ return `new Regex(${this.quote((0, _stringUtils.normalizeEscapedRegexQuotes)(body.source))}${suffix})`;
613
+ }
614
+ toCallWithExact(method, body, exact) {
615
+ if (isRegExp(body)) return `${method}(${this.regexToString(body)})`;
616
+ if (exact) return `${method}(${this.quote(body)}, new() { Exact = true })`;
617
+ return `${method}(${this.quote(body)})`;
618
+ }
619
+ toHasText(body) {
620
+ if (isRegExp(body)) return `HasTextRegex = ${this.regexToString(body)}`;
621
+ return `HasText = ${this.quote(body)}`;
622
+ }
623
+ toTestIdValue(value) {
624
+ if (isRegExp(value)) return this.regexToString(value);
625
+ return this.quote(value);
626
+ }
627
+ toHasNotText(body) {
628
+ if (isRegExp(body)) return `HasNotTextRegex = ${this.regexToString(body)}`;
629
+ return `HasNotText = ${this.quote(body)}`;
630
+ }
631
+ quote(text) {
632
+ return (0, _stringUtils.escapeWithQuotes)(text, '\"');
633
+ }
634
+ }
635
+ exports.CSharpLocatorFactory = CSharpLocatorFactory;
636
+ class JsonlLocatorFactory {
637
+ generateLocator(base, kind, body, options = {}) {
638
+ return JSON.stringify({
639
+ kind,
640
+ body,
641
+ options
642
+ });
643
+ }
644
+ chainLocators(locators) {
645
+ const objects = locators.map(l => JSON.parse(l));
646
+ for (let i = 0; i < objects.length - 1; ++i) objects[i].next = objects[i + 1];
647
+ return JSON.stringify(objects[0]);
648
+ }
649
+ }
650
+ exports.JsonlLocatorFactory = JsonlLocatorFactory;
651
+ const generators = {
652
+ javascript: JavaScriptLocatorFactory,
653
+ python: PythonLocatorFactory,
654
+ java: JavaLocatorFactory,
655
+ csharp: CSharpLocatorFactory,
656
+ jsonl: JsonlLocatorFactory
657
+ };
658
+ function isRegExp(obj) {
659
+ return obj instanceof RegExp;
660
+ }