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,243 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.JavaLanguageGenerator = void 0;
7
- var _language = require("./language");
8
- var _deviceDescriptors = require("../deviceDescriptors");
9
- var _javascript = require("./javascript");
10
- var _utils = require("../../utils");
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
- class JavaLanguageGenerator {
28
- constructor(mode) {
29
- this.id = void 0;
30
- this.groupName = 'Java';
31
- this.name = void 0;
32
- this.highlighter = 'java';
33
- this._mode = void 0;
34
- if (mode === 'library') {
35
- this.name = 'Library';
36
- this.id = 'java';
37
- } else if (mode === 'junit') {
38
- this.name = 'JUnit';
39
- this.id = 'java-junit';
40
- } else {
41
- throw new Error(`Unknown Java language mode: ${mode}`);
42
- }
43
- this._mode = mode;
44
- }
45
- generateAction(actionInContext) {
46
- const action = actionInContext.action;
47
- const pageAlias = actionInContext.frame.pageAlias;
48
- const offset = this._mode === 'junit' ? 4 : 6;
49
- const formatter = new _javascript.JavaScriptFormatter(offset);
50
- if (this._mode !== 'library' && (action.name === 'openPage' || action.name === 'closePage')) return '';
51
- if (action.name === 'openPage') {
52
- formatter.add(`Page ${pageAlias} = context.newPage();`);
53
- if (action.url && action.url !== 'about:blank' && action.url !== 'chrome://newtab/') formatter.add(`${pageAlias}.navigate(${quote(action.url)});`);
54
- return formatter.format();
55
- }
56
- const locators = actionInContext.frame.framePath.map(selector => `.${this._asLocator(selector, false)}.contentFrame()`);
57
- const subject = `${pageAlias}${locators.join('')}`;
58
- const signals = (0, _language.toSignalMap)(action);
59
- if (signals.dialog) {
60
- formatter.add(` ${pageAlias}.onceDialog(dialog -> {
61
- System.out.println(String.format("Dialog message: %s", dialog.message()));
62
- dialog.dismiss();
63
- });`);
64
- }
65
- let code = this._generateActionCall(subject, actionInContext, !!actionInContext.frame.framePath.length);
66
- if (signals.popup) {
67
- code = `Page ${signals.popup.popupAlias} = ${pageAlias}.waitForPopup(() -> {
68
- ${code}
69
- });`;
70
- }
71
- if (signals.download) {
72
- code = `Download download${signals.download.downloadAlias} = ${pageAlias}.waitForDownload(() -> {
73
- ${code}
74
- });`;
75
- }
76
- formatter.add(code);
77
- return formatter.format();
78
- }
79
- _generateActionCall(subject, actionInContext, inFrameLocator) {
80
- const action = actionInContext.action;
81
- switch (action.name) {
82
- case 'openPage':
83
- throw Error('Not reached');
84
- case 'closePage':
85
- return `${subject}.close();`;
86
- case 'click':
87
- {
88
- let method = 'click';
89
- if (action.clickCount === 2) method = 'dblclick';
90
- const options = (0, _language.toClickOptionsForSourceCode)(action);
91
- const optionsText = formatClickOptions(options);
92
- return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.${method}(${optionsText});`;
93
- }
94
- case 'check':
95
- return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.check();`;
96
- case 'uncheck':
97
- return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.uncheck();`;
98
- case 'fill':
99
- return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.fill(${quote(action.text)});`;
100
- case 'setInputFiles':
101
- return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.setInputFiles(${formatPath(action.files.length === 1 ? action.files[0] : action.files)});`;
102
- case 'press':
103
- {
104
- const modifiers = (0, _language.toKeyboardModifiers)(action.modifiers);
105
- const shortcut = [...modifiers, action.key].join('+');
106
- return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.press(${quote(shortcut)});`;
107
- }
108
- case 'navigate':
109
- return `${subject}.navigate(${quote(action.url)});`;
110
- case 'select':
111
- return `${subject}.${this._asLocator(action.selector, inFrameLocator)}.selectOption(${formatSelectOption(action.options.length === 1 ? action.options[0] : action.options)});`;
112
- case 'assertText':
113
- return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).${action.substring ? 'containsText' : 'hasText'}(${quote(action.text)});`;
114
- case 'assertChecked':
115
- return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)})${action.checked ? '' : '.not()'}.isChecked();`;
116
- case 'assertVisible':
117
- return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).isVisible();`;
118
- case 'assertValue':
119
- {
120
- const assertion = action.value ? `hasValue(${quote(action.value)})` : `isEmpty()`;
121
- return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).${assertion};`;
122
- }
123
- case 'assertSnapshot':
124
- return `assertThat(${subject}.${this._asLocator(action.selector, inFrameLocator)}).matchesAriaSnapshot(${quote(action.snapshot)});`;
125
- }
126
- }
127
- _asLocator(selector, inFrameLocator) {
128
- return (0, _utils.asLocator)('java', selector, inFrameLocator);
129
- }
130
- generateHeader(options) {
131
- const formatter = new _javascript.JavaScriptFormatter();
132
- if (this._mode === 'junit') {
133
- formatter.add(`
134
- import com.microsoft.playwright.junit.UsePlaywright;
135
- import com.microsoft.playwright.Page;
136
- import com.microsoft.playwright.options.*;
137
-
138
- ${options.contextOptions.recordHar ? `import java.nio.file.Paths;\n` : ''}import org.junit.jupiter.api.*;
139
- import static com.microsoft.playwright.assertions.PlaywrightAssertions.*;
140
-
141
- @UsePlaywright
142
- public class TestExample {
143
- @Test
144
- void test(Page page) {`);
145
- if (options.contextOptions.recordHar) {
146
- const url = options.contextOptions.recordHar.urlFilter;
147
- const recordHarOptions = typeof url === 'string' ? `, new Page.RouteFromHAROptions()
148
- .setUrl(${quote(url)})` : '';
149
- formatter.add(` page.routeFromHAR(Paths.get(${quote(options.contextOptions.recordHar.path)})${recordHarOptions});`);
150
- }
151
- return formatter.format();
152
- }
153
- formatter.add(`
154
- import com.microsoft.playwright.*;
155
- import com.microsoft.playwright.options.*;
156
- import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
157
- ${options.contextOptions.recordHar ? `import java.nio.file.Paths;\n` : ''}import java.util.*;
158
-
159
- public class Example {
160
- public static void main(String[] args) {
161
- try (Playwright playwright = Playwright.create()) {
162
- Browser browser = playwright.${options.browserName}().launch(${formatLaunchOptions(options.launchOptions)});
163
- BrowserContext context = browser.newContext(${formatContextOptions(options.contextOptions, options.deviceName)});`);
164
- if (options.contextOptions.recordHar) {
165
- const url = options.contextOptions.recordHar.urlFilter;
166
- const recordHarOptions = typeof url === 'string' ? `, new BrowserContext.RouteFromHAROptions()
167
- .setUrl(${quote(url)})` : '';
168
- formatter.add(` context.routeFromHAR(Paths.get(${quote(options.contextOptions.recordHar.path)})${recordHarOptions});`);
169
- }
170
- return formatter.format();
171
- }
172
- generateFooter(saveStorage) {
173
- const storageStateLine = saveStorage ? `\n context.storageState(new BrowserContext.StorageStateOptions().setPath(${quote(saveStorage)}));\n` : '';
174
- if (this._mode === 'junit') {
175
- return `${storageStateLine} }
176
- }`;
177
- }
178
- return `${storageStateLine} }
179
- }
180
- }`;
181
- }
182
- }
183
- exports.JavaLanguageGenerator = JavaLanguageGenerator;
184
- function formatPath(files) {
185
- if (Array.isArray(files)) {
186
- if (files.length === 0) return 'new Path[0]';
187
- return `new Path[] {${files.map(s => 'Paths.get(' + quote(s) + ')').join(', ')}}`;
188
- }
189
- return `Paths.get(${quote(files)})`;
190
- }
191
- function formatSelectOption(options) {
192
- if (Array.isArray(options)) {
193
- if (options.length === 0) return 'new String[0]';
194
- return `new String[] {${options.map(s => quote(s)).join(', ')}}`;
195
- }
196
- return quote(options);
197
- }
198
- function formatLaunchOptions(options) {
199
- const lines = [];
200
- if (!Object.keys(options).filter(key => options[key] !== undefined).length) return '';
201
- lines.push('new BrowserType.LaunchOptions()');
202
- if (options.channel) lines.push(` .setChannel(${quote(options.channel)})`);
203
- if (typeof options.headless === 'boolean') lines.push(` .setHeadless(false)`);
204
- return lines.join('\n');
205
- }
206
- function formatContextOptions(contextOptions, deviceName) {
207
- const lines = [];
208
- if (!Object.keys(contextOptions).length && !deviceName) return '';
209
- const device = deviceName ? _deviceDescriptors.deviceDescriptors[deviceName] : {};
210
- const options = {
211
- ...device,
212
- ...contextOptions
213
- };
214
- lines.push('new Browser.NewContextOptions()');
215
- if (options.acceptDownloads) lines.push(` .setAcceptDownloads(true)`);
216
- if (options.bypassCSP) lines.push(` .setBypassCSP(true)`);
217
- if (options.colorScheme) lines.push(` .setColorScheme(ColorScheme.${options.colorScheme.toUpperCase()})`);
218
- if (options.deviceScaleFactor) lines.push(` .setDeviceScaleFactor(${options.deviceScaleFactor})`);
219
- if (options.geolocation) lines.push(` .setGeolocation(${options.geolocation.latitude}, ${options.geolocation.longitude})`);
220
- if (options.hasTouch) lines.push(` .setHasTouch(${options.hasTouch})`);
221
- if (options.isMobile) lines.push(` .setIsMobile(${options.isMobile})`);
222
- if (options.locale) lines.push(` .setLocale(${quote(options.locale)})`);
223
- if (options.proxy) lines.push(` .setProxy(new Proxy(${quote(options.proxy.server)}))`);
224
- if (options.serviceWorkers) lines.push(` .setServiceWorkers(ServiceWorkerPolicy.${options.serviceWorkers.toUpperCase()})`);
225
- if (options.storageState) lines.push(` .setStorageStatePath(Paths.get(${quote(options.storageState)}))`);
226
- if (options.timezoneId) lines.push(` .setTimezoneId(${quote(options.timezoneId)})`);
227
- if (options.userAgent) lines.push(` .setUserAgent(${quote(options.userAgent)})`);
228
- if (options.viewport) lines.push(` .setViewportSize(${options.viewport.width}, ${options.viewport.height})`);
229
- return lines.join('\n');
230
- }
231
- function formatClickOptions(options) {
232
- const lines = [];
233
- if (options.button) lines.push(` .setButton(MouseButton.${options.button.toUpperCase()})`);
234
- if (options.modifiers) lines.push(` .setModifiers(Arrays.asList(${options.modifiers.map(m => `KeyboardModifier.${m.toUpperCase()}`).join(', ')}))`);
235
- if (options.clickCount) lines.push(` .setClickCount(${options.clickCount})`);
236
- if (options.position) lines.push(` .setPosition(${options.position.x}, ${options.position.y})`);
237
- if (!lines.length) return '';
238
- lines.unshift(`new Locator.ClickOptions()`);
239
- return lines.join('\n');
240
- }
241
- function quote(text) {
242
- return (0, _utils.escapeWithQuotes)(text, '\"');
243
- }
@@ -1,253 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.JavaScriptLanguageGenerator = exports.JavaScriptFormatter = void 0;
7
- exports.quoteMultiline = quoteMultiline;
8
- var _language = require("./language");
9
- var _deviceDescriptors = require("../deviceDescriptors");
10
- var _utils = require("../../utils");
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
- class JavaScriptLanguageGenerator {
28
- constructor(isTest) {
29
- this.id = void 0;
30
- this.groupName = 'Node.js';
31
- this.name = void 0;
32
- this.highlighter = 'javascript';
33
- this._isTest = void 0;
34
- this.id = isTest ? 'playwright-test' : 'javascript';
35
- this.name = isTest ? 'Test Runner' : 'Library';
36
- this._isTest = isTest;
37
- }
38
- generateAction(actionInContext) {
39
- const action = actionInContext.action;
40
- if (this._isTest && (action.name === 'openPage' || action.name === 'closePage')) return '';
41
- const pageAlias = actionInContext.frame.pageAlias;
42
- const formatter = new JavaScriptFormatter(2);
43
- if (action.name === 'openPage') {
44
- formatter.add(`const ${pageAlias} = await context.newPage();`);
45
- if (action.url && action.url !== 'about:blank' && action.url !== 'chrome://newtab/') formatter.add(`await ${pageAlias}.goto(${quote(action.url)});`);
46
- return formatter.format();
47
- }
48
- const locators = actionInContext.frame.framePath.map(selector => `.${this._asLocator(selector)}.contentFrame()`);
49
- const subject = `${pageAlias}${locators.join('')}`;
50
- const signals = (0, _language.toSignalMap)(action);
51
- if (signals.dialog) {
52
- formatter.add(` ${pageAlias}.once('dialog', dialog => {
53
- console.log(\`Dialog message: $\{dialog.message()}\`);
54
- dialog.dismiss().catch(() => {});
55
- });`);
56
- }
57
- if (signals.popup) formatter.add(`const ${signals.popup.popupAlias}Promise = ${pageAlias}.waitForEvent('popup');`);
58
- if (signals.download) formatter.add(`const download${signals.download.downloadAlias}Promise = ${pageAlias}.waitForEvent('download');`);
59
- formatter.add(wrapWithStep(actionInContext.description, this._generateActionCall(subject, actionInContext)));
60
- if (signals.popup) formatter.add(`const ${signals.popup.popupAlias} = await ${signals.popup.popupAlias}Promise;`);
61
- if (signals.download) formatter.add(`const download${signals.download.downloadAlias} = await download${signals.download.downloadAlias}Promise;`);
62
- return formatter.format();
63
- }
64
- _generateActionCall(subject, actionInContext) {
65
- const action = actionInContext.action;
66
- switch (action.name) {
67
- case 'openPage':
68
- throw Error('Not reached');
69
- case 'closePage':
70
- return `await ${subject}.close();`;
71
- case 'click':
72
- {
73
- let method = 'click';
74
- if (action.clickCount === 2) method = 'dblclick';
75
- const options = (0, _language.toClickOptionsForSourceCode)(action);
76
- const optionsString = formatOptions(options, false);
77
- return `await ${subject}.${this._asLocator(action.selector)}.${method}(${optionsString});`;
78
- }
79
- case 'check':
80
- return `await ${subject}.${this._asLocator(action.selector)}.check();`;
81
- case 'uncheck':
82
- return `await ${subject}.${this._asLocator(action.selector)}.uncheck();`;
83
- case 'fill':
84
- return `await ${subject}.${this._asLocator(action.selector)}.fill(${quote(action.text)});`;
85
- case 'setInputFiles':
86
- return `await ${subject}.${this._asLocator(action.selector)}.setInputFiles(${formatObject(action.files.length === 1 ? action.files[0] : action.files)});`;
87
- case 'press':
88
- {
89
- const modifiers = (0, _language.toKeyboardModifiers)(action.modifiers);
90
- const shortcut = [...modifiers, action.key].join('+');
91
- return `await ${subject}.${this._asLocator(action.selector)}.press(${quote(shortcut)});`;
92
- }
93
- case 'navigate':
94
- return `await ${subject}.goto(${quote(action.url)});`;
95
- case 'select':
96
- return `await ${subject}.${this._asLocator(action.selector)}.selectOption(${formatObject(action.options.length === 1 ? action.options[0] : action.options)});`;
97
- case 'assertText':
98
- return `${this._isTest ? '' : '// '}await expect(${subject}.${this._asLocator(action.selector)}).${action.substring ? 'toContainText' : 'toHaveText'}(${quote(action.text)});`;
99
- case 'assertChecked':
100
- return `${this._isTest ? '' : '// '}await expect(${subject}.${this._asLocator(action.selector)})${action.checked ? '' : '.not'}.toBeChecked();`;
101
- case 'assertVisible':
102
- return `${this._isTest ? '' : '// '}await expect(${subject}.${this._asLocator(action.selector)}).toBeVisible();`;
103
- case 'assertValue':
104
- {
105
- const assertion = action.value ? `toHaveValue(${quote(action.value)})` : `toBeEmpty()`;
106
- return `${this._isTest ? '' : '// '}await expect(${subject}.${this._asLocator(action.selector)}).${assertion};`;
107
- }
108
- case 'assertSnapshot':
109
- {
110
- const commentIfNeeded = this._isTest ? '' : '// ';
111
- return `${commentIfNeeded}await expect(${subject}.${this._asLocator(action.selector)}).toMatchAriaSnapshot(${quoteMultiline(action.snapshot, `${commentIfNeeded} `)});`;
112
- }
113
- }
114
- }
115
- _asLocator(selector) {
116
- return (0, _utils.asLocator)('javascript', selector);
117
- }
118
- generateHeader(options) {
119
- if (this._isTest) return this.generateTestHeader(options);
120
- return this.generateStandaloneHeader(options);
121
- }
122
- generateFooter(saveStorage) {
123
- if (this._isTest) return this.generateTestFooter(saveStorage);
124
- return this.generateStandaloneFooter(saveStorage);
125
- }
126
- generateTestHeader(options) {
127
- const formatter = new JavaScriptFormatter();
128
- const useText = formatContextOptions(options.contextOptions, options.deviceName, this._isTest);
129
- formatter.add(`
130
- import { test, expect${options.deviceName ? ', devices' : ''} } from '@playwright/test';
131
- ${useText ? '\ntest.use(' + useText + ');\n' : ''}
132
- test('test', async ({ page }) => {`);
133
- if (options.contextOptions.recordHar) {
134
- const url = options.contextOptions.recordHar.urlFilter;
135
- formatter.add(` await page.routeFromHAR(${quote(options.contextOptions.recordHar.path)}${url ? `, ${formatOptions({
136
- url
137
- }, false)}` : ''});`);
138
- }
139
- return formatter.format();
140
- }
141
- generateTestFooter(saveStorage) {
142
- return `});`;
143
- }
144
- generateStandaloneHeader(options) {
145
- const formatter = new JavaScriptFormatter();
146
- formatter.add(`
147
- const { ${options.browserName}${options.deviceName ? ', devices' : ''} } = require('playwright');
148
-
149
- (async () => {
150
- const browser = await ${options.browserName}.launch(${formatObjectOrVoid(options.launchOptions)});
151
- const context = await browser.newContext(${formatContextOptions(options.contextOptions, options.deviceName, false)});`);
152
- if (options.contextOptions.recordHar) formatter.add(` await context.routeFromHAR(${quote(options.contextOptions.recordHar.path)});`);
153
- return formatter.format();
154
- }
155
- generateStandaloneFooter(saveStorage) {
156
- const storageStateLine = saveStorage ? `\n await context.storageState({ path: ${quote(saveStorage)} });` : '';
157
- return `\n // ---------------------${storageStateLine}
158
- await context.close();
159
- await browser.close();
160
- })();`;
161
- }
162
- }
163
- exports.JavaScriptLanguageGenerator = JavaScriptLanguageGenerator;
164
- function formatOptions(value, hasArguments) {
165
- const keys = Object.keys(value);
166
- if (!keys.length) return '';
167
- return (hasArguments ? ', ' : '') + formatObject(value);
168
- }
169
- function formatObject(value, indent = ' ') {
170
- if (typeof value === 'string') return quote(value);
171
- if (Array.isArray(value)) return `[${value.map(o => formatObject(o)).join(', ')}]`;
172
- if (typeof value === 'object') {
173
- const keys = Object.keys(value).filter(key => value[key] !== undefined).sort();
174
- if (!keys.length) return '{}';
175
- const tokens = [];
176
- for (const key of keys) tokens.push(`${key}: ${formatObject(value[key])}`);
177
- return `{\n${indent}${tokens.join(`,\n${indent}`)}\n}`;
178
- }
179
- return String(value);
180
- }
181
- function formatObjectOrVoid(value, indent = ' ') {
182
- const result = formatObject(value, indent);
183
- return result === '{}' ? '' : result;
184
- }
185
- function formatContextOptions(options, deviceName, isTest) {
186
- const device = deviceName && _deviceDescriptors.deviceDescriptors[deviceName];
187
- // recordHAR is replaced with routeFromHAR in the generated code.
188
- options = {
189
- ...options,
190
- recordHar: undefined
191
- };
192
- if (!device) return formatObjectOrVoid(options);
193
- // Filter out all the properties from the device descriptor.
194
- let serializedObject = formatObjectOrVoid((0, _language.sanitizeDeviceOptions)(device, options));
195
- // When there are no additional context options, we still want to spread the device inside.
196
- if (!serializedObject) serializedObject = '{\n}';
197
- const lines = serializedObject.split('\n');
198
- lines.splice(1, 0, `...devices[${quote(deviceName)}],`);
199
- return lines.join('\n');
200
- }
201
- class JavaScriptFormatter {
202
- constructor(offset = 0) {
203
- this._baseIndent = void 0;
204
- this._baseOffset = void 0;
205
- this._lines = [];
206
- this._baseIndent = ' '.repeat(2);
207
- this._baseOffset = ' '.repeat(offset);
208
- }
209
- prepend(text) {
210
- const trim = isMultilineString(text) ? line => line : line => line.trim();
211
- this._lines = text.trim().split('\n').map(trim).concat(this._lines);
212
- }
213
- add(text) {
214
- const trim = isMultilineString(text) ? line => line : line => line.trim();
215
- this._lines.push(...text.trim().split('\n').map(trim));
216
- }
217
- newLine() {
218
- this._lines.push('');
219
- }
220
- format() {
221
- let spaces = '';
222
- let previousLine = '';
223
- return this._lines.map(line => {
224
- if (line === '') return line;
225
- if (line.startsWith('}') || line.startsWith(']')) spaces = spaces.substring(this._baseIndent.length);
226
- const extraSpaces = /^(for|while|if|try).*\(.*\)$/.test(previousLine) ? this._baseIndent : '';
227
- previousLine = line;
228
- const callCarryOver = line.startsWith('.set');
229
- line = spaces + extraSpaces + (callCarryOver ? this._baseIndent : '') + line;
230
- if (line.endsWith('{') || line.endsWith('[')) spaces += this._baseIndent;
231
- return this._baseOffset + line;
232
- }).join('\n');
233
- }
234
- }
235
- exports.JavaScriptFormatter = JavaScriptFormatter;
236
- function quote(text) {
237
- return (0, _utils.escapeWithQuotes)(text, '\'');
238
- }
239
- function wrapWithStep(description, body) {
240
- return description ? `await test.step(\`${description}\`, async () => {
241
- ${body}
242
- });` : body;
243
- }
244
- function quoteMultiline(text, indent = ' ') {
245
- const escape = text => text.replace(/\\/g, '\\\\').replace(/`/g, '\\`').replace(/\$\{/g, '\\${');
246
- const lines = text.split('\n');
247
- if (lines.length === 1) return '`' + escape(text) + '`';
248
- return '`\n' + lines.map(line => indent + escape(line).replace(/\${/g, '\\${')).join('\n') + `\n${indent}\``;
249
- }
250
- function isMultilineString(text) {
251
- var _text$match;
252
- return (_text$match = text.match(/`[\S\s]*`/)) === null || _text$match === void 0 ? void 0 : _text$match[0].includes('\n');
253
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.JsonlLanguageGenerator = void 0;
7
- var _utils = require("../../utils");
8
- /**
9
- * Copyright (c) Microsoft Corporation.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
-
24
- class JsonlLanguageGenerator {
25
- constructor() {
26
- this.id = 'jsonl';
27
- this.groupName = '';
28
- this.name = 'JSONL';
29
- this.highlighter = 'javascript';
30
- }
31
- generateAction(actionInContext) {
32
- const locator = actionInContext.action.selector ? JSON.parse((0, _utils.asLocator)('jsonl', actionInContext.action.selector)) : undefined;
33
- const entry = {
34
- ...actionInContext.action,
35
- ...actionInContext.frame,
36
- locator
37
- };
38
- return JSON.stringify(entry);
39
- }
40
- generateHeader(options) {
41
- return JSON.stringify(options);
42
- }
43
- generateFooter(saveStorage) {
44
- return '';
45
- }
46
- }
47
- exports.JsonlLanguageGenerator = JsonlLanguageGenerator;
@@ -1,88 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.fromKeyboardModifiers = fromKeyboardModifiers;
7
- exports.generateCode = generateCode;
8
- exports.sanitizeDeviceOptions = sanitizeDeviceOptions;
9
- exports.toClickOptionsForSourceCode = toClickOptionsForSourceCode;
10
- exports.toKeyboardModifiers = toKeyboardModifiers;
11
- exports.toSignalMap = toSignalMap;
12
- /**
13
- * Copyright (c) Microsoft Corporation.
14
- *
15
- * Licensed under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License.
17
- * You may obtain a copy of the License at
18
- *
19
- * http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software
22
- * distributed under the License is distributed on an "AS IS" BASIS,
23
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
- * See the License for the specific language governing permissions and
25
- * limitations under the License.
26
- */
27
-
28
- function generateCode(actions, languageGenerator, options) {
29
- const header = languageGenerator.generateHeader(options);
30
- const footer = languageGenerator.generateFooter(options.saveStorage);
31
- const actionTexts = actions.map(a => languageGenerator.generateAction(a)).filter(Boolean);
32
- const text = [header, ...actionTexts, footer].join('\n');
33
- return {
34
- header,
35
- footer,
36
- actionTexts,
37
- text
38
- };
39
- }
40
- function sanitizeDeviceOptions(device, options) {
41
- // Filter out all the properties from the device descriptor.
42
- const cleanedOptions = {};
43
- for (const property in options) {
44
- if (JSON.stringify(device[property]) !== JSON.stringify(options[property])) cleanedOptions[property] = options[property];
45
- }
46
- return cleanedOptions;
47
- }
48
- function toSignalMap(action) {
49
- let popup;
50
- let download;
51
- let dialog;
52
- for (const signal of action.signals) {
53
- if (signal.name === 'popup') popup = signal;else if (signal.name === 'download') download = signal;else if (signal.name === 'dialog') dialog = signal;
54
- }
55
- return {
56
- popup,
57
- download,
58
- dialog
59
- };
60
- }
61
- function toKeyboardModifiers(modifiers) {
62
- const result = [];
63
- if (modifiers & 1) result.push('Alt');
64
- if (modifiers & 2) result.push('ControlOrMeta');
65
- if (modifiers & 4) result.push('ControlOrMeta');
66
- if (modifiers & 8) result.push('Shift');
67
- return result;
68
- }
69
- function fromKeyboardModifiers(modifiers) {
70
- let result = 0;
71
- if (!modifiers) return result;
72
- if (modifiers.includes('Alt')) result |= 1;
73
- if (modifiers.includes('Control')) result |= 2;
74
- if (modifiers.includes('ControlOrMeta')) result |= 2;
75
- if (modifiers.includes('Meta')) result |= 4;
76
- if (modifiers.includes('Shift')) result |= 8;
77
- return result;
78
- }
79
- function toClickOptionsForSourceCode(action) {
80
- const modifiers = toKeyboardModifiers(action.modifiers);
81
- const options = {};
82
- if (action.button !== 'left') options.button = action.button;
83
- if (modifiers.length) options.modifiers = modifiers;
84
- // Do not render clickCount === 2 for dblclick.
85
- if (action.clickCount > 2) options.clickCount = action.clickCount;
86
- if (action.position) options.position = action.position;
87
- return options;
88
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.languageSet = languageSet;
7
- var _java = require("./java");
8
- var _javascript = require("./javascript");
9
- var _jsonl = require("./jsonl");
10
- var _csharp = require("./csharp");
11
- var _python = require("./python");
12
- /**
13
- * Copyright (c) Microsoft Corporation.
14
- *
15
- * Licensed under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License.
17
- * You may obtain a copy of the License at
18
- *
19
- * http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software
22
- * distributed under the License is distributed on an "AS IS" BASIS,
23
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
- * See the License for the specific language governing permissions and
25
- * limitations under the License.
26
- */
27
-
28
- function languageSet() {
29
- return new Set([new _java.JavaLanguageGenerator('junit'), new _java.JavaLanguageGenerator('library'), new _javascript.JavaScriptLanguageGenerator( /* isPlaywrightTest */false), new _javascript.JavaScriptLanguageGenerator( /* isPlaywrightTest */true), new _python.PythonLanguageGenerator( /* isAsync */false, /* isPytest */true), new _python.PythonLanguageGenerator( /* isAsync */false, /* isPytest */false), new _python.PythonLanguageGenerator( /* isAsync */true, /* isPytest */false), new _csharp.CSharpLanguageGenerator('mstest'), new _csharp.CSharpLanguageGenerator('nunit'), new _csharp.CSharpLanguageGenerator('library'), new _jsonl.JsonlLanguageGenerator()]);
30
- }