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,583 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "program", {
7
- enumerable: true,
8
- get: function () {
9
- return _utilsBundle.program;
10
- }
11
- });
12
- var _fs = _interopRequireDefault(require("fs"));
13
- var _os = _interopRequireDefault(require("os"));
14
- var _path = _interopRequireDefault(require("path"));
15
- var _utilsBundle = require("../utilsBundle");
16
- var _driver = require("./driver");
17
- var _traceViewer = require("../server/trace/viewer/traceViewer");
18
- var playwright = _interopRequireWildcard(require("../.."));
19
- var _utils = require("../utils");
20
- var _server = require("../server");
21
- var _errors = require("../client/errors");
22
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
23
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
- /**
26
- * Copyright (c) Microsoft Corporation.
27
- *
28
- * Licensed under the Apache License, Version 2.0 (the "License");
29
- * you may not use this file except in compliance with the License.
30
- * You may obtain a copy of the License at
31
- *
32
- * http://www.apache.org/licenses/LICENSE-2.0
33
- *
34
- * Unless required by applicable law or agreed to in writing, software
35
- * distributed under the License is distributed on an "AS IS" BASIS,
36
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37
- * See the License for the specific language governing permissions and
38
- * limitations under the License.
39
- */
40
-
41
- /* eslint-disable no-console */
42
-
43
- const packageJSON = require('../../package.json');
44
- _utilsBundle.program.version('Version ' + (process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version)).name(buildBasePlaywrightCLICommand(process.env.PW_LANG_NAME));
45
- _utilsBundle.program.command('mark-docker-image [dockerImageNameTemplate]', {
46
- hidden: true
47
- }).description('mark docker image').allowUnknownOption(true).action(function (dockerImageNameTemplate) {
48
- (0, _utils.assert)(dockerImageNameTemplate, 'dockerImageNameTemplate is required');
49
- (0, _server.writeDockerVersion)(dockerImageNameTemplate).catch(logErrorAndExit);
50
- });
51
- commandWithOpenOptions('open [url]', 'open page in browser specified via -b, --browser', []).action(function (url, options) {
52
- open(options, url, codegenId()).catch(logErrorAndExit);
53
- }).addHelpText('afterAll', `
54
- Examples:
55
-
56
- $ open
57
- $ open -b webkit https://example.com`);
58
- commandWithOpenOptions('codegen [url]', 'open page and generate code for user actions', [['-o, --output <file name>', 'saves the generated script to a file'], ['--target <language>', `language to generate, one of javascript, playwright-test, python, python-async, python-pytest, csharp, csharp-mstest, csharp-nunit, java, java-junit`, codegenId()], ['--test-id-attribute <attributeName>', 'use the specified attribute to generate data test ID selectors']]).action(function (url, options) {
59
- codegen(options, url).catch(logErrorAndExit);
60
- }).addHelpText('afterAll', `
61
- Examples:
62
-
63
- $ codegen
64
- $ codegen --target=python
65
- $ codegen -b webkit https://example.com`);
66
- function suggestedBrowsersToInstall() {
67
- return _server.registry.executables().filter(e => e.installType !== 'none' && e.type !== 'tool').map(e => e.name).join(', ');
68
- }
69
- function defaultBrowsersToInstall(options) {
70
- let executables = _server.registry.defaultExecutables();
71
- if (options.noShell) executables = executables.filter(e => e.name !== 'chromium-headless-shell');
72
- if (options.onlyShell) executables = executables.filter(e => e.name !== 'chromium');
73
- return executables;
74
- }
75
- function checkBrowsersToInstall(args, options) {
76
- if (options.noShell && options.onlyShell) throw new Error(`Only one of --no-shell and --only-shell can be specified`);
77
- const faultyArguments = [];
78
- const executables = [];
79
- const handleArgument = arg => {
80
- const executable = _server.registry.findExecutable(arg);
81
- if (!executable || executable.installType === 'none') faultyArguments.push(arg);else executables.push(executable);
82
- if ((executable === null || executable === void 0 ? void 0 : executable.browserName) === 'chromium') executables.push(_server.registry.findExecutable('ffmpeg'));
83
- };
84
- for (const arg of args) {
85
- if (arg === 'chromium') {
86
- if (!options.onlyShell) handleArgument('chromium');
87
- if (!options.noShell) handleArgument('chromium-headless-shell');
88
- } else {
89
- handleArgument(arg);
90
- }
91
- }
92
- if (process.platform === 'win32') executables.push(_server.registry.findExecutable('winldd'));
93
- if (faultyArguments.length) throw new Error(`Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${suggestedBrowsersToInstall()}`);
94
- return executables;
95
- }
96
- _utilsBundle.program.command('install [browser...]').description('ensure browsers necessary for this version of Playwright are installed').option('--with-deps', 'install system dependencies for browsers').option('--dry-run', 'do not execute installation, only print information').option('--force', 'force reinstall of stable browser channels').option('--only-shell', 'only install headless shell when installing chromium').option('--no-shell', 'do not install chromium headless shell').action(async function (args, options) {
97
- // For '--no-shell' option, commander sets `shell: false` instead.
98
- if (options.shell === false) options.noShell = true;
99
- if ((0, _utils.isLikelyNpxGlobal)()) {
100
- console.error((0, _utils.wrapInASCIIBox)([`WARNING: It looks like you are running 'npx playwright install' without first`, `installing your project's dependencies.`, ``, `To avoid unexpected behavior, please install your dependencies first, and`, `then run Playwright's install command:`, ``, ` npm install`, ` npx playwright install`, ``, `If your project does not yet depend on Playwright, first install the`, `applicable npm package (most commonly @playwright/test), and`, `then run Playwright's install command to download the browsers:`, ``, ` npm install @playwright/test`, ` npx playwright install`, ``].join('\n'), 1));
101
- }
102
- try {
103
- const hasNoArguments = !args.length;
104
- const executables = hasNoArguments ? defaultBrowsersToInstall(options) : checkBrowsersToInstall(args, options);
105
- if (options.withDeps) await _server.registry.installDeps(executables, !!options.dryRun);
106
- if (options.dryRun) {
107
- for (const executable of executables) {
108
- var _executable$directory, _executable$downloadU;
109
- const version = executable.browserVersion ? `version ` + executable.browserVersion : '';
110
- console.log(`browser: ${executable.name}${version ? ' ' + version : ''}`);
111
- console.log(` Install location: ${(_executable$directory = executable.directory) !== null && _executable$directory !== void 0 ? _executable$directory : '<system>'}`);
112
- if ((_executable$downloadU = executable.downloadURLs) !== null && _executable$downloadU !== void 0 && _executable$downloadU.length) {
113
- const [url, ...fallbacks] = executable.downloadURLs;
114
- console.log(` Download url: ${url}`);
115
- for (let i = 0; i < fallbacks.length; ++i) console.log(` Download fallback ${i + 1}: ${fallbacks[i]}`);
116
- }
117
- console.log(``);
118
- }
119
- } else {
120
- const forceReinstall = hasNoArguments ? false : !!options.force;
121
- await _server.registry.install(executables, forceReinstall);
122
- await _server.registry.validateHostRequirementsForExecutablesIfNeeded(executables, process.env.PW_LANG_NAME || 'javascript').catch(e => {
123
- e.name = 'Playwright Host validation warning';
124
- console.error(e);
125
- });
126
- }
127
- } catch (e) {
128
- console.log(`Failed to install browsers\n${e}`);
129
- (0, _utils.gracefullyProcessExitDoNotHang)(1);
130
- }
131
- }).addHelpText('afterAll', `
132
-
133
- Examples:
134
- - $ install
135
- Install default browsers.
136
-
137
- - $ install chrome firefox
138
- Install custom browsers, supports ${suggestedBrowsersToInstall()}.`);
139
- _utilsBundle.program.command('uninstall').description('Removes browsers used by this installation of Playwright from the system (chromium, firefox, webkit, ffmpeg). This does not include branded channels.').option('--all', 'Removes all browsers used by any Playwright installation from the system.').action(async options => {
140
- delete process.env.PLAYWRIGHT_SKIP_BROWSER_GC;
141
- await _server.registry.uninstall(!!options.all).then(({
142
- numberOfBrowsersLeft
143
- }) => {
144
- if (!options.all && numberOfBrowsersLeft > 0) {
145
- console.log('Successfully uninstalled Playwright browsers for the current Playwright installation.');
146
- console.log(`There are still ${numberOfBrowsersLeft} browsers left, used by other Playwright installations.\nTo uninstall Playwright browsers for all installations, re-run with --all flag.`);
147
- }
148
- }).catch(logErrorAndExit);
149
- });
150
- _utilsBundle.program.command('install-deps [browser...]').description('install dependencies necessary to run browsers (will ask for sudo permissions)').option('--dry-run', 'Do not execute installation commands, only print them').action(async function (args, options) {
151
- try {
152
- if (!args.length) await _server.registry.installDeps(defaultBrowsersToInstall({}), !!options.dryRun);else await _server.registry.installDeps(checkBrowsersToInstall(args, {}), !!options.dryRun);
153
- } catch (e) {
154
- console.log(`Failed to install browser dependencies\n${e}`);
155
- (0, _utils.gracefullyProcessExitDoNotHang)(1);
156
- }
157
- }).addHelpText('afterAll', `
158
- Examples:
159
- - $ install-deps
160
- Install dependencies for default browsers.
161
-
162
- - $ install-deps chrome firefox
163
- Install dependencies for specific browsers, supports ${suggestedBrowsersToInstall()}.`);
164
- const browsers = [{
165
- alias: 'cr',
166
- name: 'Chromium',
167
- type: 'chromium'
168
- }, {
169
- alias: 'ff',
170
- name: 'Firefox',
171
- type: 'firefox'
172
- }, {
173
- alias: 'wk',
174
- name: 'WebKit',
175
- type: 'webkit'
176
- }];
177
- for (const {
178
- alias,
179
- name,
180
- type
181
- } of browsers) {
182
- commandWithOpenOptions(`${alias} [url]`, `open page in ${name}`, []).action(function (url, options) {
183
- open({
184
- ...options,
185
- browser: type
186
- }, url, options.target).catch(logErrorAndExit);
187
- }).addHelpText('afterAll', `
188
- Examples:
189
-
190
- $ ${alias} https://example.com`);
191
- }
192
- commandWithOpenOptions('screenshot <url> <filename>', 'capture a page screenshot', [['--wait-for-selector <selector>', 'wait for selector before taking a screenshot'], ['--wait-for-timeout <timeout>', 'wait for timeout in milliseconds before taking a screenshot'], ['--full-page', 'whether to take a full page screenshot (entire scrollable area)']]).action(function (url, filename, command) {
193
- screenshot(command, command, url, filename).catch(logErrorAndExit);
194
- }).addHelpText('afterAll', `
195
- Examples:
196
-
197
- $ screenshot -b webkit https://example.com example.png`);
198
- commandWithOpenOptions('pdf <url> <filename>', 'save page as pdf', [['--wait-for-selector <selector>', 'wait for given selector before saving as pdf'], ['--wait-for-timeout <timeout>', 'wait for given timeout in milliseconds before saving as pdf']]).action(function (url, filename, options) {
199
- pdf(options, options, url, filename).catch(logErrorAndExit);
200
- }).addHelpText('afterAll', `
201
- Examples:
202
-
203
- $ pdf https://example.com example.pdf`);
204
- _utilsBundle.program.command('run-driver', {
205
- hidden: true
206
- }).action(function (options) {
207
- (0, _driver.runDriver)();
208
- });
209
- _utilsBundle.program.command('run-server').option('--port <port>', 'Server port').option('--host <host>', 'Server host').option('--path <path>', 'Endpoint Path', '/').option('--max-clients <maxClients>', 'Maximum clients').option('--mode <mode>', 'Server mode, either "default" or "extension"').action(function (options) {
210
- (0, _driver.runServer)({
211
- port: options.port ? +options.port : undefined,
212
- host: options.host,
213
- path: options.path,
214
- maxConnections: options.maxClients ? +options.maxClients : Infinity,
215
- extension: options.mode === 'extension' || !!process.env.PW_EXTENSION_MODE
216
- }).catch(logErrorAndExit);
217
- });
218
- _utilsBundle.program.command('print-api-json', {
219
- hidden: true
220
- }).action(function (options) {
221
- (0, _driver.printApiJson)();
222
- });
223
- _utilsBundle.program.command('launch-server', {
224
- hidden: true
225
- }).requiredOption('--browser <browserName>', 'Browser name, one of "chromium", "firefox" or "webkit"').option('--config <path-to-config-file>', 'JSON file with launchServer options').action(function (options) {
226
- (0, _driver.launchBrowserServer)(options.browser, options.config);
227
- });
228
- _utilsBundle.program.command('show-trace [trace...]').option('-b, --browser <browserType>', 'browser to use, one of cr, chromium, ff, firefox, wk, webkit', 'chromium').option('-h, --host <host>', 'Host to serve trace on; specifying this option opens trace in a browser tab').option('-p, --port <port>', 'Port to serve trace on, 0 for any free port; specifying this option opens trace in a browser tab').option('--stdin', 'Accept trace URLs over stdin to update the viewer').description('show trace viewer').action(function (traces, options) {
229
- if (options.browser === 'cr') options.browser = 'chromium';
230
- if (options.browser === 'ff') options.browser = 'firefox';
231
- if (options.browser === 'wk') options.browser = 'webkit';
232
- const openOptions = {
233
- host: options.host,
234
- port: +options.port,
235
- isServer: !!options.stdin
236
- };
237
- if (options.port !== undefined || options.host !== undefined) (0, _traceViewer.runTraceInBrowser)(traces, openOptions).catch(logErrorAndExit);else (0, _traceViewer.runTraceViewerApp)(traces, options.browser, openOptions, true).catch(logErrorAndExit);
238
- }).addHelpText('afterAll', `
239
- Examples:
240
-
241
- $ show-trace https://example.com/trace.zip`);
242
- async function launchContext(options, extraOptions) {
243
- validateOptions(options);
244
- const browserType = lookupBrowserType(options);
245
- const launchOptions = extraOptions;
246
- if (options.channel) launchOptions.channel = options.channel;
247
- launchOptions.handleSIGINT = false;
248
- const contextOptions =
249
- // Copy the device descriptor since we have to compare and modify the options.
250
- options.device ? {
251
- ...playwright.devices[options.device]
252
- } : {};
253
-
254
- // In headful mode, use host device scale factor for things to look nice.
255
- // In headless, keep things the way it works in Playwright by default.
256
- // Assume high-dpi on MacOS. TODO: this is not perfect.
257
- if (!extraOptions.headless) contextOptions.deviceScaleFactor = _os.default.platform() === 'darwin' ? 2 : 1;
258
-
259
- // Work around the WebKit GTK scrolling issue.
260
- if (browserType.name() === 'webkit' && process.platform === 'linux') {
261
- delete contextOptions.hasTouch;
262
- delete contextOptions.isMobile;
263
- }
264
- if (contextOptions.isMobile && browserType.name() === 'firefox') contextOptions.isMobile = undefined;
265
- if (options.blockServiceWorkers) contextOptions.serviceWorkers = 'block';
266
-
267
- // Proxy
268
-
269
- if (options.proxyServer) {
270
- launchOptions.proxy = {
271
- server: options.proxyServer
272
- };
273
- if (options.proxyBypass) launchOptions.proxy.bypass = options.proxyBypass;
274
- }
275
- const browser = await browserType.launch(launchOptions);
276
- if (process.env.PWTEST_CLI_IS_UNDER_TEST) {
277
- process._didSetSourcesForTest = text => {
278
- process.stdout.write('\n-------------8<-------------\n');
279
- process.stdout.write(text);
280
- process.stdout.write('\n-------------8<-------------\n');
281
- const autoExitCondition = process.env.PWTEST_CLI_AUTO_EXIT_WHEN;
282
- if (autoExitCondition && text.includes(autoExitCondition)) closeBrowser();
283
- };
284
- // Make sure we exit abnormally when browser crashes.
285
- const logs = [];
286
- require('playwright-core/lib/utilsBundle').debug.log = (...args) => {
287
- const line = require('util').format(...args) + '\n';
288
- logs.push(line);
289
- process.stderr.write(line);
290
- };
291
- browser.on('disconnected', () => {
292
- const hasCrashLine = logs.some(line => line.includes('process did exit:') && !line.includes('process did exit: exitCode=0, signal=null'));
293
- if (hasCrashLine) {
294
- process.stderr.write('Detected browser crash.\n');
295
- (0, _utils.gracefullyProcessExitDoNotHang)(1);
296
- }
297
- });
298
- }
299
-
300
- // Viewport size
301
- if (options.viewportSize) {
302
- try {
303
- const [width, height] = options.viewportSize.split(',').map(n => +n);
304
- if (isNaN(width) || isNaN(height)) throw new Error('bad values');
305
- contextOptions.viewport = {
306
- width,
307
- height
308
- };
309
- } catch (e) {
310
- throw new Error('Invalid viewport size format: use "width,height", for example --viewport-size="800,600"');
311
- }
312
- }
313
-
314
- // Geolocation
315
-
316
- if (options.geolocation) {
317
- try {
318
- const [latitude, longitude] = options.geolocation.split(',').map(n => parseFloat(n.trim()));
319
- contextOptions.geolocation = {
320
- latitude,
321
- longitude
322
- };
323
- } catch (e) {
324
- throw new Error('Invalid geolocation format, should be "lat,long". For example --geolocation="37.819722,-122.478611"');
325
- }
326
- contextOptions.permissions = ['geolocation'];
327
- }
328
-
329
- // User agent
330
-
331
- if (options.userAgent) contextOptions.userAgent = options.userAgent;
332
-
333
- // Lang
334
-
335
- if (options.lang) contextOptions.locale = options.lang;
336
-
337
- // Color scheme
338
-
339
- if (options.colorScheme) contextOptions.colorScheme = options.colorScheme;
340
-
341
- // Timezone
342
-
343
- if (options.timezone) contextOptions.timezoneId = options.timezone;
344
-
345
- // Storage
346
-
347
- if (options.loadStorage) contextOptions.storageState = options.loadStorage;
348
- if (options.ignoreHttpsErrors) contextOptions.ignoreHTTPSErrors = true;
349
-
350
- // HAR
351
-
352
- if (options.saveHar) {
353
- contextOptions.recordHar = {
354
- path: _path.default.resolve(process.cwd(), options.saveHar),
355
- mode: 'minimal'
356
- };
357
- if (options.saveHarGlob) contextOptions.recordHar.urlFilter = options.saveHarGlob;
358
- contextOptions.serviceWorkers = 'block';
359
- }
360
-
361
- // Close app when the last window closes.
362
-
363
- const context = await browser.newContext(contextOptions);
364
- let closingBrowser = false;
365
- async function closeBrowser() {
366
- // We can come here multiple times. For example, saving storage creates
367
- // a temporary page and we call closeBrowser again when that page closes.
368
- if (closingBrowser) return;
369
- closingBrowser = true;
370
- if (options.saveStorage) await context.storageState({
371
- path: options.saveStorage
372
- }).catch(e => null);
373
- if (options.saveHar) await context.close();
374
- await browser.close();
375
- }
376
- context.on('page', page => {
377
- page.on('dialog', () => {}); // Prevent dialogs from being automatically dismissed.
378
- page.on('close', () => {
379
- const hasPage = browser.contexts().some(context => context.pages().length > 0);
380
- if (hasPage) return;
381
- // Avoid the error when the last page is closed because the browser has been closed.
382
- closeBrowser().catch(() => {});
383
- });
384
- });
385
- process.on('SIGINT', async () => {
386
- await closeBrowser();
387
- (0, _utils.gracefullyProcessExitDoNotHang)(130);
388
- });
389
- const timeout = options.timeout ? parseInt(options.timeout, 10) : 0;
390
- context.setDefaultTimeout(timeout);
391
- context.setDefaultNavigationTimeout(timeout);
392
-
393
- // Omit options that we add automatically for presentation purpose.
394
- delete launchOptions.headless;
395
- delete launchOptions.executablePath;
396
- delete launchOptions.handleSIGINT;
397
- delete contextOptions.deviceScaleFactor;
398
- return {
399
- browser,
400
- browserName: browserType.name(),
401
- context,
402
- contextOptions,
403
- launchOptions
404
- };
405
- }
406
- async function openPage(context, url) {
407
- const page = await context.newPage();
408
- if (url) {
409
- if (_fs.default.existsSync(url)) url = 'file://' + _path.default.resolve(url);else if (!url.startsWith('http') && !url.startsWith('file://') && !url.startsWith('about:') && !url.startsWith('data:')) url = 'http://' + url;
410
- await page.goto(url).catch(error => {
411
- if (process.env.PWTEST_CLI_AUTO_EXIT_WHEN && (0, _errors.isTargetClosedError)(error)) {
412
- // Tests with PWTEST_CLI_AUTO_EXIT_WHEN might close page too fast, resulting
413
- // in a stray navigation aborted error. We should ignore it.
414
- } else {
415
- throw error;
416
- }
417
- });
418
- }
419
- return page;
420
- }
421
- async function open(options, url, language) {
422
- const {
423
- context,
424
- launchOptions,
425
- contextOptions
426
- } = await launchContext(options, {
427
- headless: !!process.env.PWTEST_CLI_HEADLESS,
428
- executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH
429
- });
430
- await context._enableRecorder({
431
- language,
432
- launchOptions,
433
- contextOptions,
434
- device: options.device,
435
- saveStorage: options.saveStorage,
436
- handleSIGINT: false
437
- });
438
- await openPage(context, url);
439
- }
440
- async function codegen(options, url) {
441
- const {
442
- target: language,
443
- output: outputFile,
444
- testIdAttribute: testIdAttributeName
445
- } = options;
446
- const tracesDir = _path.default.join(_os.default.tmpdir(), `playwright-recorder-trace-${Date.now()}`);
447
- const {
448
- context,
449
- launchOptions,
450
- contextOptions
451
- } = await launchContext(options, {
452
- headless: !!process.env.PWTEST_CLI_HEADLESS,
453
- executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH,
454
- tracesDir
455
- });
456
- _utilsBundle.dotenv.config({
457
- path: 'playwright.env'
458
- });
459
- await context._enableRecorder({
460
- language,
461
- launchOptions,
462
- contextOptions,
463
- device: options.device,
464
- saveStorage: options.saveStorage,
465
- mode: 'recording',
466
- testIdAttributeName,
467
- outputFile: outputFile ? _path.default.resolve(outputFile) : undefined,
468
- handleSIGINT: false
469
- });
470
- await openPage(context, url);
471
- }
472
- async function waitForPage(page, captureOptions) {
473
- if (captureOptions.waitForSelector) {
474
- console.log(`Waiting for selector ${captureOptions.waitForSelector}...`);
475
- await page.waitForSelector(captureOptions.waitForSelector);
476
- }
477
- if (captureOptions.waitForTimeout) {
478
- console.log(`Waiting for timeout ${captureOptions.waitForTimeout}...`);
479
- await page.waitForTimeout(parseInt(captureOptions.waitForTimeout, 10));
480
- }
481
- }
482
- async function screenshot(options, captureOptions, url, path) {
483
- const {
484
- context
485
- } = await launchContext(options, {
486
- headless: true
487
- });
488
- console.log('Navigating to ' + url);
489
- const page = await openPage(context, url);
490
- await waitForPage(page, captureOptions);
491
- console.log('Capturing screenshot into ' + path);
492
- await page.screenshot({
493
- path,
494
- fullPage: !!captureOptions.fullPage
495
- });
496
- // launchContext takes care of closing the browser.
497
- await page.close();
498
- }
499
- async function pdf(options, captureOptions, url, path) {
500
- if (options.browser !== 'chromium') throw new Error('PDF creation is only working with Chromium');
501
- const {
502
- context
503
- } = await launchContext({
504
- ...options,
505
- browser: 'chromium'
506
- }, {
507
- headless: true
508
- });
509
- console.log('Navigating to ' + url);
510
- const page = await openPage(context, url);
511
- await waitForPage(page, captureOptions);
512
- console.log('Saving as pdf into ' + path);
513
- await page.pdf({
514
- path
515
- });
516
- // launchContext takes care of closing the browser.
517
- await page.close();
518
- }
519
- function lookupBrowserType(options) {
520
- let name = options.browser;
521
- if (options.device) {
522
- const device = playwright.devices[options.device];
523
- name = device.defaultBrowserType;
524
- }
525
- let browserType;
526
- switch (name) {
527
- case 'chromium':
528
- browserType = playwright.chromium;
529
- break;
530
- case 'webkit':
531
- browserType = playwright.webkit;
532
- break;
533
- case 'firefox':
534
- browserType = playwright.firefox;
535
- break;
536
- case 'cr':
537
- browserType = playwright.chromium;
538
- break;
539
- case 'wk':
540
- browserType = playwright.webkit;
541
- break;
542
- case 'ff':
543
- browserType = playwright.firefox;
544
- break;
545
- }
546
- if (browserType) return browserType;
547
- _utilsBundle.program.help();
548
- }
549
- function validateOptions(options) {
550
- if (options.device && !(options.device in playwright.devices)) {
551
- const lines = [`Device descriptor not found: '${options.device}', available devices are:`];
552
- for (const name in playwright.devices) lines.push(` "${name}"`);
553
- throw new Error(lines.join('\n'));
554
- }
555
- if (options.colorScheme && !['light', 'dark'].includes(options.colorScheme)) throw new Error('Invalid color scheme, should be one of "light", "dark"');
556
- }
557
- function logErrorAndExit(e) {
558
- if (process.env.PWDEBUGIMPL) console.error(e);else console.error(e.name + ': ' + e.message);
559
- (0, _utils.gracefullyProcessExitDoNotHang)(1);
560
- }
561
- function codegenId() {
562
- return process.env.PW_LANG_NAME || 'playwright-test';
563
- }
564
- function commandWithOpenOptions(command, description, options) {
565
- let result = _utilsBundle.program.command(command).description(description);
566
- for (const option of options) result = result.option(option[0], ...option.slice(1));
567
- return result.option('-b, --browser <browserType>', 'browser to use, one of cr, chromium, ff, firefox, wk, webkit', 'chromium').option('--block-service-workers', 'block service workers').option('--channel <channel>', 'Chromium distribution channel, "chrome", "chrome-beta", "msedge-dev", etc').option('--color-scheme <scheme>', 'emulate preferred color scheme, "light" or "dark"').option('--device <deviceName>', 'emulate device, for example "iPhone 11"').option('--geolocation <coordinates>', 'specify geolocation coordinates, for example "37.819722,-122.478611"').option('--ignore-https-errors', 'ignore https errors').option('--load-storage <filename>', 'load context storage state from the file, previously saved with --save-storage').option('--lang <language>', 'specify language / locale, for example "en-GB"').option('--proxy-server <proxy>', 'specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"').option('--proxy-bypass <bypass>', 'comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"').option('--save-har <filename>', 'save HAR file with all network activity at the end').option('--save-har-glob <glob pattern>', 'filter entries in the HAR by matching url against this glob pattern').option('--save-storage <filename>', 'save context storage state at the end, for later use with --load-storage').option('--timezone <time zone>', 'time zone to emulate, for example "Europe/Rome"').option('--timeout <timeout>', 'timeout for Playwright actions in milliseconds, no timeout by default').option('--user-agent <ua string>', 'specify user agent string').option('--viewport-size <size>', 'specify browser viewport size in pixels, for example "1280, 720"');
568
- }
569
- function buildBasePlaywrightCLICommand(cliTargetLang) {
570
- switch (cliTargetLang) {
571
- case 'python':
572
- return `playwright`;
573
- case 'java':
574
- return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="...options.."`;
575
- case 'csharp':
576
- return `pwsh bin/Debug/netX/playwright.ps1`;
577
- default:
578
- {
579
- const packageManagerCommand = (0, _utils.getPackageManagerExecCommand)();
580
- return `${packageManagerCommand} playwright`;
581
- }
582
- }
583
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "program", {
7
- enumerable: true,
8
- get: function () {
9
- return _program.program;
10
- }
11
- });
12
- var _utils = require("../utils");
13
- var _program = require("./program");
14
- /**
15
- * Copyright (c) Microsoft Corporation.
16
- *
17
- * Licensed under the Apache License, Version 2.0 (the "License");
18
- * you may not use this file except in compliance with the License.
19
- * You may obtain a copy of the License at
20
- *
21
- * http://www.apache.org/licenses/LICENSE-2.0
22
- *
23
- * Unless required by applicable law or agreed to in writing, software
24
- * distributed under the License is distributed on an "AS IS" BASIS,
25
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
- * See the License for the specific language governing permissions and
27
- * limitations under the License.
28
- */
29
-
30
- /* eslint-disable no-console */
31
-
32
- function printPlaywrightTestError(command) {
33
- const packages = [];
34
- for (const pkg of ['playwright', 'playwright-chromium', 'playwright-firefox', 'playwright-webkit']) {
35
- try {
36
- require.resolve(pkg);
37
- packages.push(pkg);
38
- } catch (e) {}
39
- }
40
- if (!packages.length) packages.push('playwright');
41
- const packageManager = (0, _utils.getPackageManager)();
42
- if (packageManager === 'yarn') {
43
- console.error(`Please install @playwright/test package before running "yarn playwright ${command}"`);
44
- console.error(` yarn remove ${packages.join(' ')}`);
45
- console.error(' yarn add -D @playwright/test');
46
- } else if (packageManager === 'pnpm') {
47
- console.error(`Please install @playwright/test package before running "pnpm exec playwright ${command}"`);
48
- console.error(` pnpm remove ${packages.join(' ')}`);
49
- console.error(' pnpm add -D @playwright/test');
50
- } else {
51
- console.error(`Please install @playwright/test package before running "npx playwright ${command}"`);
52
- console.error(` npm uninstall ${packages.join(' ')}`);
53
- console.error(' npm install -D @playwright/test');
54
- }
55
- }
56
- const kExternalPlaywrightTestCommands = [['test', 'Run tests with Playwright Test.'], ['show-report', 'Show Playwright Test HTML report.'], ['merge-reports', 'Merge Playwright Test Blob reports']];
57
- function addExternalPlaywrightTestCommands() {
58
- for (const [command, description] of kExternalPlaywrightTestCommands) {
59
- const playwrightTest = _program.program.command(command).allowUnknownOption(true);
60
- playwrightTest.description(`${description} Available in @playwright/test package.`);
61
- playwrightTest.action(async () => {
62
- printPlaywrightTestError(command);
63
- (0, _utils.gracefullyProcessExitDoNotHang)(1);
64
- });
65
- }
66
- }
67
- if (!process.env.PW_LANG_NAME) addExternalPlaywrightTestCommands();