rebrowser-playwright-core 1.49.1 → 1.52.0
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.
- package/ThirdPartyNotices.txt +381 -55
- package/bin/reinstall_msedge_beta_linux.sh +6 -0
- package/bin/reinstall_msedge_dev_linux.sh +6 -0
- package/bin/reinstall_msedge_stable_linux.sh +6 -0
- package/browsers.json +28 -13
- package/index.js +0 -1
- package/lib/androidServerImpl.js +42 -48
- package/lib/browserServerImpl.js +60 -64
- package/lib/cli/driver.js +71 -69
- package/lib/cli/program.js +314 -354
- package/lib/cli/programWithTestStub.js +51 -44
- package/lib/client/accessibility.js +31 -32
- package/lib/client/android.js +146 -254
- package/lib/client/api.js +135 -283
- package/lib/client/artifact.js +39 -39
- package/lib/client/browser.js +59 -68
- package/lib/client/browserContext.js +302 -322
- package/lib/client/browserType.js +95 -143
- package/lib/client/cdpSession.js +29 -31
- package/lib/client/channelOwner.js +109 -139
- package/lib/client/clientHelper.js +49 -42
- package/lib/client/clientInstrumentation.js +40 -35
- package/lib/client/clientStackTrace.js +69 -0
- package/lib/client/clock.js +36 -36
- package/lib/client/connection.js +203 -218
- package/lib/client/consoleMessage.js +33 -33
- package/lib/client/coverage.js +25 -22
- package/lib/client/dialog.js +30 -31
- package/lib/client/download.js +25 -25
- package/lib/client/electron.js +74 -76
- package/lib/client/elementHandle.js +126 -163
- package/lib/client/errors.js +53 -53
- package/lib/client/eventEmitter.js +127 -127
- package/lib/client/events.js +72 -68
- package/lib/client/fetch.js +154 -178
- package/lib/client/fileChooser.js +25 -24
- package/lib/client/fileUtils.js +34 -0
- package/lib/client/frame.js +189 -307
- package/lib/client/harRouter.js +44 -56
- package/lib/client/input.js +40 -69
- package/lib/client/jsHandle.js +55 -71
- package/lib/client/jsonPipe.js +27 -23
- package/lib/client/localUtils.js +53 -28
- package/lib/client/locator.js +144 -230
- package/lib/client/network.js +285 -301
- package/lib/client/page.js +273 -312
- package/lib/client/platform.js +74 -0
- package/lib/client/playwright.js +62 -57
- package/lib/client/selectors.js +51 -43
- package/lib/client/stream.js +30 -45
- package/lib/client/timeoutSettings.js +75 -0
- package/lib/client/tracing.js +49 -82
- package/lib/client/types.js +26 -22
- package/lib/client/video.js +35 -27
- package/lib/client/waiter.js +71 -91
- package/lib/client/webError.js +25 -23
- package/lib/client/webSocket.js +111 -0
- package/lib/client/worker.js +48 -56
- package/lib/client/writableStream.js +28 -43
- package/lib/generated/clockSource.js +26 -5
- package/lib/generated/consoleApiSource.js +26 -5
- package/lib/generated/injectedScriptSource.js +26 -5
- package/lib/generated/pollingRecorderSource.js +26 -5
- package/lib/generated/utilityScriptSource.js +26 -5
- package/lib/generated/webSocketMockSource.js +375 -4
- package/lib/inProcessFactory.js +53 -48
- package/lib/inprocess.js +2 -19
- package/lib/outofprocess.js +53 -42
- package/lib/protocol/debug.js +209 -25
- package/lib/protocol/serializers.js +153 -134
- package/lib/protocol/validator.js +2712 -2667
- package/lib/protocol/validatorPrimitives.js +115 -75
- package/lib/remote/playwrightConnection.js +144 -152
- package/lib/remote/playwrightServer.js +106 -77
- package/lib/server/accessibility.js +44 -37
- package/lib/server/android/android.js +216 -206
- package/lib/server/android/backendAdb.js +89 -82
- package/lib/server/artifact.js +78 -55
- package/lib/server/bidi/bidiBrowser.js +227 -158
- package/lib/server/bidi/bidiChromium.js +106 -78
- package/lib/server/bidi/bidiConnection.js +66 -83
- package/lib/server/bidi/bidiExecutionContext.js +161 -97
- package/lib/server/bidi/bidiFirefox.js +76 -68
- package/lib/server/bidi/bidiInput.js +90 -102
- package/lib/server/bidi/bidiNetworkManager.js +141 -159
- package/lib/server/bidi/bidiOverCdp.js +57 -58
- package/lib/server/bidi/bidiPage.js +262 -261
- package/lib/server/bidi/bidiPdf.js +52 -86
- package/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/lib/server/bidi/third_party/bidiDeserializer.js +55 -50
- package/lib/server/bidi/third_party/bidiKeyboard.js +241 -223
- package/lib/server/bidi/third_party/bidiProtocol.js +144 -131
- package/lib/server/bidi/third_party/bidiSerializer.js +67 -63
- package/lib/server/bidi/third_party/firefoxPrefs.js +149 -111
- package/lib/server/browser.js +76 -84
- package/lib/server/browserContext.js +343 -360
- package/lib/server/browserType.js +169 -181
- package/lib/server/callLog.js +82 -0
- package/lib/server/chromium/chromium.js +212 -190
- package/lib/server/chromium/chromiumSwitches.js +99 -44
- package/lib/server/chromium/crAccessibility.js +157 -131
- package/lib/server/chromium/crBrowser.js +262 -280
- package/lib/server/chromium/crConnection.js +121 -178
- package/lib/server/chromium/crCoverage.js +113 -127
- package/lib/server/chromium/crDevTools.js +64 -55
- package/lib/server/chromium/crDragDrop.js +62 -79
- package/lib/server/chromium/crExecutionContext.js +100 -91
- package/lib/server/chromium/crInput.js +101 -88
- package/lib/server/chromium/crNetworkManager.js +269 -370
- package/lib/server/chromium/crPage.js +509 -597
- package/lib/server/chromium/crPdf.js +54 -86
- package/lib/server/chromium/crProtocolHelper.js +92 -80
- package/lib/server/chromium/crServiceWorker.js +85 -69
- package/lib/server/chromium/defaultFontFamilies.js +152 -135
- package/lib/server/chromium/protocol.d.js +16 -0
- package/lib/server/chromium/videoRecorder.js +65 -99
- package/lib/server/clock.js +58 -46
- package/lib/server/codegen/csharp.js +191 -156
- package/lib/server/codegen/java.js +163 -125
- package/lib/server/codegen/javascript.js +166 -143
- package/lib/server/codegen/jsonl.js +33 -29
- package/lib/server/codegen/language.js +75 -52
- package/lib/server/codegen/languages.js +65 -27
- package/lib/server/codegen/python.js +141 -125
- package/lib/server/codegen/types.js +15 -4
- package/lib/server/console.js +28 -32
- package/lib/server/cookieStore.js +105 -86
- package/lib/server/debugController.js +102 -154
- package/lib/server/debugger.js +82 -78
- package/lib/server/deviceDescriptors.js +37 -24
- package/lib/server/deviceDescriptorsSource.json +131 -131
- package/lib/server/dialog.js +36 -35
- package/lib/server/dispatchers/androidDispatcher.js +196 -107
- package/lib/server/dispatchers/artifactDispatcher.js +62 -62
- package/lib/server/dispatchers/browserContextDispatcher.js +177 -217
- package/lib/server/dispatchers/browserDispatcher.js +78 -97
- package/lib/server/dispatchers/browserTypeDispatcher.js +35 -35
- package/lib/server/dispatchers/cdpSessionDispatcher.js +32 -36
- package/lib/server/dispatchers/debugControllerDispatcher.js +48 -64
- package/lib/server/dispatchers/dialogDispatcher.js +30 -27
- package/lib/server/dispatchers/dispatcher.js +180 -229
- package/lib/server/dispatchers/electronDispatcher.js +54 -57
- package/lib/server/dispatchers/elementHandlerDispatcher.js +79 -116
- package/lib/server/dispatchers/frameDispatcher.js +93 -162
- package/lib/server/dispatchers/jsHandleDispatcher.js +49 -66
- package/lib/server/dispatchers/jsonPipeDispatcher.js +35 -36
- package/lib/server/dispatchers/localUtilsDispatcher.js +107 -365
- package/lib/server/dispatchers/networkDispatchers.js +92 -109
- package/lib/server/dispatchers/pageDispatcher.js +130 -169
- package/lib/server/dispatchers/playwrightDispatcher.js +69 -76
- package/lib/server/dispatchers/selectorsDispatcher.js +28 -24
- package/lib/server/dispatchers/streamDispatcher.js +42 -44
- package/lib/server/dispatchers/tracingDispatcher.js +36 -41
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +100 -135
- package/lib/server/dispatchers/writableStreamDispatcher.js +54 -39
- package/lib/server/dom.js +424 -443
- package/lib/server/download.js +45 -35
- package/lib/server/electron/electron.js +156 -175
- package/lib/server/electron/loader.js +8 -36
- package/lib/server/errors.js +47 -46
- package/lib/server/fetch.js +302 -331
- package/lib/server/fileChooser.js +25 -24
- package/lib/server/fileUploadUtils.js +66 -57
- package/lib/server/firefox/ffAccessibility.js +153 -131
- package/lib/server/firefox/ffBrowser.js +218 -274
- package/lib/server/firefox/ffConnection.js +63 -84
- package/lib/server/firefox/ffExecutionContext.js +103 -77
- package/lib/server/firefox/ffInput.js +72 -63
- package/lib/server/firefox/ffNetworkManager.js +131 -110
- package/lib/server/firefox/ffPage.js +244 -302
- package/lib/server/firefox/firefox.js +76 -69
- package/lib/server/firefox/protocol.d.js +16 -0
- package/lib/server/formData.js +107 -35
- package/lib/server/frameSelectors.js +77 -111
- package/lib/server/frames.js +719 -855
- package/lib/server/har/harRecorder.js +85 -77
- package/lib/server/har/harTracer.js +288 -224
- package/lib/server/harBackend.js +157 -0
- package/lib/server/helper.js +56 -59
- package/lib/server/index.js +59 -106
- package/lib/server/input.js +136 -166
- package/lib/server/instrumentation.js +49 -44
- package/lib/server/javascript.js +157 -151
- package/lib/server/launchApp.js +92 -73
- package/lib/server/localUtils.js +211 -0
- package/lib/server/macEditingCommands.js +141 -137
- package/lib/server/network.js +263 -297
- package/lib/server/page.js +351 -434
- package/lib/server/pageBinding.js +88 -0
- package/lib/server/pipeTransport.js +49 -45
- package/lib/server/playwright.js +60 -67
- package/lib/server/progress.js +56 -51
- package/lib/server/protocolError.js +34 -31
- package/lib/server/recorder/chat.js +161 -0
- package/lib/server/recorder/contextRecorder.js +135 -148
- package/lib/server/recorder/recorderApp.js +129 -132
- package/lib/server/recorder/recorderCollection.js +57 -57
- package/lib/server/recorder/recorderFrontend.js +15 -4
- package/lib/server/recorder/recorderRunner.js +80 -100
- package/lib/server/recorder/recorderUtils.js +59 -72
- package/lib/server/recorder/throttledFile.js +42 -31
- package/lib/server/recorder.js +186 -190
- package/lib/server/registry/browserFetcher.js +107 -100
- package/lib/server/registry/dependencies.js +247 -198
- package/lib/server/registry/index.js +928 -709
- package/lib/server/registry/nativeDeps.js +1073 -461
- package/lib/server/registry/oopDownloadBrowserMain.js +57 -75
- package/lib/server/screenshotter.js +166 -182
- package/lib/server/selectors.js +85 -46
- package/lib/server/socksClientCertificatesInterceptor.js +166 -185
- package/lib/server/socksInterceptor.js +62 -67
- package/lib/server/storageScript.js +154 -0
- package/lib/server/timeoutSettings.js +89 -0
- package/lib/server/trace/recorder/snapshotter.js +70 -88
- package/lib/server/trace/recorder/snapshotterInjected.js +246 -218
- package/lib/server/trace/recorder/tracing.js +324 -327
- package/lib/server/trace/test/inMemorySnapshotter.js +46 -52
- package/lib/server/trace/viewer/traceViewer.js +172 -137
- package/lib/server/transport.js +125 -133
- package/lib/server/types.js +26 -22
- package/lib/server/usKeyboardLayout.js +135 -545
- package/lib/server/utils/ascii.js +44 -0
- package/lib/server/utils/comparators.js +161 -0
- package/lib/server/utils/crypto.js +216 -0
- package/lib/server/utils/debug.js +47 -0
- package/lib/server/utils/debugLogger.js +114 -0
- package/lib/server/utils/env.js +68 -0
- package/lib/server/utils/eventsHelper.js +39 -0
- package/lib/server/utils/expectUtils.js +38 -0
- package/lib/server/utils/fileUtils.js +191 -0
- package/lib/server/utils/happyEyeballs.js +207 -0
- package/lib/server/utils/hostPlatform.js +109 -0
- package/lib/server/utils/httpServer.js +218 -0
- package/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/lib/{image_tools → server/utils/image_tools}/compare.js +44 -43
- package/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/lib/{image_tools → server/utils/image_tools}/stats.js +40 -40
- package/lib/server/utils/linuxUtils.js +71 -0
- package/lib/server/utils/network.js +217 -0
- package/lib/server/utils/nodePlatform.js +148 -0
- package/lib/server/utils/pipeTransport.js +84 -0
- package/lib/server/utils/processLauncher.js +238 -0
- package/lib/server/utils/profiler.js +65 -0
- package/lib/server/utils/socksProxy.js +511 -0
- package/lib/server/utils/spawnAsync.js +41 -0
- package/lib/server/utils/task.js +51 -0
- package/lib/server/utils/userAgent.js +98 -0
- package/lib/server/utils/wsServer.js +132 -0
- package/lib/server/utils/zipFile.js +74 -0
- package/lib/server/utils/zones.js +57 -0
- package/lib/server/webkit/protocol.d.js +16 -0
- package/lib/server/webkit/webkit.js +76 -63
- package/lib/server/webkit/wkAccessibility.js +161 -118
- package/lib/server/webkit/wkBrowser.js +163 -180
- package/lib/server/webkit/wkConnection.js +59 -83
- package/lib/server/webkit/wkExecutionContext.js +96 -73
- package/lib/server/webkit/wkInput.js +87 -75
- package/lib/server/webkit/wkInterceptableRequest.js +102 -95
- package/lib/server/webkit/wkPage.js +536 -647
- package/lib/server/webkit/wkProvisionalPage.js +45 -56
- package/lib/server/webkit/wkWorkers.js +77 -77
- package/lib/utils/isomorphic/ariaSnapshot.js +245 -128
- package/lib/utils/isomorphic/assert.js +31 -0
- package/lib/utils/isomorphic/builtins.js +90 -0
- package/lib/utils/isomorphic/colors.js +72 -0
- package/lib/utils/isomorphic/cssParser.js +123 -127
- package/lib/utils/isomorphic/cssTokenizer.js +436 -364
- package/lib/utils/isomorphic/headers.js +53 -0
- package/lib/utils/isomorphic/locatorGenerators.js +344 -349
- package/lib/utils/isomorphic/locatorParser.js +103 -106
- package/lib/utils/isomorphic/locatorUtils.js +63 -44
- package/lib/utils/isomorphic/manualPromise.js +115 -0
- package/lib/utils/isomorphic/mimeType.js +453 -22
- package/lib/utils/isomorphic/multimap.js +81 -0
- package/lib/utils/isomorphic/rtti.js +43 -0
- package/lib/utils/isomorphic/selectorParser.js +183 -193
- package/lib/utils/isomorphic/semaphore.js +54 -0
- package/lib/utils/isomorphic/stackTrace.js +158 -0
- package/lib/utils/isomorphic/stringUtils.js +113 -106
- package/lib/utils/isomorphic/time.js +44 -0
- package/lib/utils/isomorphic/timeoutRunner.js +67 -0
- package/lib/utils/isomorphic/traceUtils.js +52 -32
- package/lib/utils/isomorphic/types.js +16 -0
- package/lib/utils/isomorphic/urlMatch.js +114 -71
- package/lib/utils/isomorphic/utilityScriptSerializers.js +248 -0
- package/lib/utils.js +101 -0
- package/lib/utilsBundle.js +101 -76
- package/lib/utilsBundleImpl/index.js +114 -116
- package/lib/vite/htmlReport/index.html +26 -20
- package/lib/vite/recorder/assets/{codeMirrorModule-C5j27SYZ.js → codeMirrorModule-DVQi6prl.js} +13 -13
- package/lib/vite/recorder/assets/index-97EUAAbk.js +184 -0
- package/lib/vite/recorder/assets/{index-iA1aAGZg.css → index-eHBmevrY.css} +1 -1
- package/lib/vite/recorder/index.html +2 -2
- package/lib/vite/traceViewer/assets/codeMirrorModule-DwAiTpyC.js +24 -0
- package/lib/vite/traceViewer/assets/defaultSettingsView-DkkRvn5X.js +265 -0
- package/lib/vite/traceViewer/assets/{xtermModule-BeNbaIVa.js → xtermModule-BoAIEibi.js} +7 -7
- package/lib/vite/traceViewer/defaultSettingsView.QdHITyLI.css +1 -0
- package/lib/vite/traceViewer/index.DvtSwn6E.js +2 -0
- package/lib/vite/traceViewer/index.html +4 -7
- package/lib/vite/traceViewer/sw.bundle.js +3 -3
- package/lib/vite/traceViewer/{uiMode.voC1ZiOQ.css → uiMode.BatfzHMG.css} +1 -1
- package/lib/vite/traceViewer/uiMode.Sdytl9wc.js +5 -0
- package/lib/vite/traceViewer/uiMode.html +4 -7
- package/lib/zipBundle.js +32 -23
- package/lib/zipBundleImpl.js +4 -4
- package/package.json +7 -7
- package/types/protocol.d.ts +819 -127
- package/types/types.d.ts +181 -69
- package/bin/PrintDeps.exe +0 -0
- package/bin/README.md +0 -2
- package/lib/common/socksProxy.js +0 -569
- package/lib/common/timeoutSettings.js +0 -73
- package/lib/common/types.js +0 -5
- package/lib/image_tools/colorUtils.js +0 -98
- package/lib/image_tools/imageChannel.js +0 -70
- package/lib/protocol/transport.js +0 -82
- package/lib/server/ariaSnapshot.js +0 -33
- package/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
- package/lib/server/recorder/recorderInTraceViewer.js +0 -144
- package/lib/utils/ascii.js +0 -31
- package/lib/utils/comparators.js +0 -153
- package/lib/utils/crypto.js +0 -171
- package/lib/utils/debug.js +0 -46
- package/lib/utils/debugLogger.js +0 -91
- package/lib/utils/env.js +0 -49
- package/lib/utils/eventsHelper.js +0 -38
- package/lib/utils/expectUtils.js +0 -33
- package/lib/utils/fileUtils.js +0 -205
- package/lib/utils/happy-eyeballs.js +0 -194
- package/lib/utils/headers.js +0 -52
- package/lib/utils/hostPlatform.js +0 -139
- package/lib/utils/httpServer.js +0 -237
- package/lib/utils/index.js +0 -368
- package/lib/utils/isomorphic/recorderUtils.js +0 -227
- package/lib/utils/linuxUtils.js +0 -78
- package/lib/utils/manualPromise.js +0 -109
- package/lib/utils/multimap.js +0 -75
- package/lib/utils/network.js +0 -160
- package/lib/utils/processLauncher.js +0 -248
- package/lib/utils/profiler.js +0 -53
- package/lib/utils/rtti.js +0 -44
- package/lib/utils/semaphore.js +0 -51
- package/lib/utils/sequence.js +0 -64
- package/lib/utils/spawnAsync.js +0 -45
- package/lib/utils/stackTrace.js +0 -134
- package/lib/utils/task.js +0 -58
- package/lib/utils/time.js +0 -37
- package/lib/utils/timeoutRunner.js +0 -66
- package/lib/utils/traceUtils.js +0 -44
- package/lib/utils/userAgent.js +0 -105
- package/lib/utils/wsServer.js +0 -127
- package/lib/utils/zipFile.js +0 -75
- package/lib/utils/zones.js +0 -71
- package/lib/vite/recorder/assets/index-m0XdVJHe.js +0 -184
- package/lib/vite/traceViewer/assets/codeMirrorModule-BBCX0spr.js +0 -24
- package/lib/vite/traceViewer/assets/inspectorTab-B4Iw34Ow.js +0 -68
- package/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
- package/lib/vite/traceViewer/assets/workbench-DFlGYqou.js +0 -9
- package/lib/vite/traceViewer/embedded.CmarehFk.js +0 -2
- package/lib/vite/traceViewer/embedded.html +0 -18
- package/lib/vite/traceViewer/embedded.w7WN2u1R.css +0 -1
- package/lib/vite/traceViewer/index.FBucu_gE.js +0 -2
- package/lib/vite/traceViewer/inspectorTab.DEOUW62d.css +0 -1
- package/lib/vite/traceViewer/recorder.B_SY1GJM.css +0 -0
- package/lib/vite/traceViewer/recorder.CW_rzcEp.js +0 -2
- package/lib/vite/traceViewer/recorder.html +0 -17
- package/lib/vite/traceViewer/uiMode.CDUVjusr.js +0 -5
- package/lib/vite/traceViewer/workbench.C-zR9ysA.css +0 -1
- /package/lib/vite/recorder/assets/{codeMirrorModule-ez37Vkbh.css → codeMirrorModule-C3UTv-Ge.css} +0 -0
- /package/lib/vite/traceViewer/{codeMirrorModule.ez37Vkbh.css → codeMirrorModule.C3UTv-Ge.css} +0 -0
- /package/lib/vite/traceViewer/{index.CrbWWHbf.css → index.CFOW-Ezb.css} +0 -0
- /package/lib/vite/traceViewer/{xtermModule.DSXBckUd.css → xtermModule.Beg8tuEN.css} +0 -0
package/lib/cli/program.js
CHANGED
|
@@ -1,149 +1,173 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var program_exports = {};
|
|
30
|
+
__export(program_exports, {
|
|
31
|
+
program: () => import_utilsBundle2.program
|
|
11
32
|
});
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
* you may not use this file except in compliance with the License.
|
|
31
|
-
* You may obtain a copy of the License at
|
|
32
|
-
*
|
|
33
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
-
*
|
|
35
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
36
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
37
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
-
* See the License for the specific language governing permissions and
|
|
39
|
-
* limitations under the License.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
/* eslint-disable no-console */
|
|
43
|
-
|
|
44
|
-
const packageJSON = require('../../package.json');
|
|
45
|
-
_utilsBundle.program.version('Version ' + (process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version)).name(buildBasePlaywrightCLICommand(process.env.PW_LANG_NAME));
|
|
46
|
-
_utilsBundle.program.command('mark-docker-image [dockerImageNameTemplate]', {
|
|
47
|
-
hidden: true
|
|
48
|
-
}).description('mark docker image').allowUnknownOption(true).action(function (dockerImageNameTemplate) {
|
|
49
|
-
(0, _utils.assert)(dockerImageNameTemplate, 'dockerImageNameTemplate is required');
|
|
50
|
-
(0, _server.writeDockerVersion)(dockerImageNameTemplate).catch(logErrorAndExit);
|
|
33
|
+
module.exports = __toCommonJS(program_exports);
|
|
34
|
+
var import_fs = __toESM(require("fs"));
|
|
35
|
+
var import_os = __toESM(require("os"));
|
|
36
|
+
var import_path = __toESM(require("path"));
|
|
37
|
+
var playwright = __toESM(require("../.."));
|
|
38
|
+
var import_driver = require("./driver");
|
|
39
|
+
var import_server = require("../server");
|
|
40
|
+
var import_utils = require("../utils");
|
|
41
|
+
var import_traceViewer = require("../server/trace/viewer/traceViewer");
|
|
42
|
+
var import_utils2 = require("../utils");
|
|
43
|
+
var import_ascii = require("../server/utils/ascii");
|
|
44
|
+
var import_utilsBundle = require("../utilsBundle");
|
|
45
|
+
var import_utilsBundle2 = require("../utilsBundle");
|
|
46
|
+
const packageJSON = require("../../package.json");
|
|
47
|
+
import_utilsBundle.program.version("Version " + (process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version)).name(buildBasePlaywrightCLICommand(process.env.PW_LANG_NAME));
|
|
48
|
+
import_utilsBundle.program.command("mark-docker-image [dockerImageNameTemplate]", { hidden: true }).description("mark docker image").allowUnknownOption(true).action(function(dockerImageNameTemplate) {
|
|
49
|
+
(0, import_utils2.assert)(dockerImageNameTemplate, "dockerImageNameTemplate is required");
|
|
50
|
+
(0, import_server.writeDockerVersion)(dockerImageNameTemplate).catch(logErrorAndExit);
|
|
51
51
|
});
|
|
52
|
-
commandWithOpenOptions(
|
|
52
|
+
commandWithOpenOptions("open [url]", "open page in browser specified via -b, --browser", []).action(function(url, options) {
|
|
53
53
|
open(options, url, codegenId()).catch(logErrorAndExit);
|
|
54
|
-
}).addHelpText(
|
|
54
|
+
}).addHelpText("afterAll", `
|
|
55
55
|
Examples:
|
|
56
56
|
|
|
57
57
|
$ open
|
|
58
58
|
$ open -b webkit https://example.com`);
|
|
59
|
-
commandWithOpenOptions(
|
|
59
|
+
commandWithOpenOptions(
|
|
60
|
+
"codegen [url]",
|
|
61
|
+
"open page and generate code for user actions",
|
|
62
|
+
[
|
|
63
|
+
["-o, --output <file name>", "saves the generated script to a file"],
|
|
64
|
+
["--target <language>", `language to generate, one of javascript, playwright-test, python, python-async, python-pytest, csharp, csharp-mstest, csharp-nunit, java, java-junit`, codegenId()],
|
|
65
|
+
["--test-id-attribute <attributeName>", "use the specified attribute to generate data test ID selectors"]
|
|
66
|
+
]
|
|
67
|
+
).action(function(url, options) {
|
|
60
68
|
codegen(options, url).catch(logErrorAndExit);
|
|
61
|
-
}).addHelpText(
|
|
69
|
+
}).addHelpText("afterAll", `
|
|
62
70
|
Examples:
|
|
63
71
|
|
|
64
72
|
$ codegen
|
|
65
73
|
$ codegen --target=python
|
|
66
74
|
$ codegen -b webkit https://example.com`);
|
|
67
|
-
_utilsBundle.program.command('debug <app> [args...]', {
|
|
68
|
-
hidden: true
|
|
69
|
-
}).description('run command in debug mode: disable timeout, open inspector').allowUnknownOption(true).action(function (app, options) {
|
|
70
|
-
(0, _child_process.spawn)(app, options, {
|
|
71
|
-
env: {
|
|
72
|
-
...process.env,
|
|
73
|
-
PWDEBUG: '1'
|
|
74
|
-
},
|
|
75
|
-
stdio: 'inherit'
|
|
76
|
-
});
|
|
77
|
-
}).addHelpText('afterAll', `
|
|
78
|
-
Examples:
|
|
79
|
-
|
|
80
|
-
$ debug node test.js
|
|
81
|
-
$ debug npm run test`);
|
|
82
75
|
function suggestedBrowsersToInstall() {
|
|
83
|
-
return
|
|
76
|
+
return import_server.registry.executables().filter((e) => e.installType !== "none" && e.type !== "tool").map((e) => e.name).join(", ");
|
|
84
77
|
}
|
|
85
78
|
function defaultBrowsersToInstall(options) {
|
|
86
|
-
let executables =
|
|
87
|
-
if (options.noShell)
|
|
88
|
-
|
|
79
|
+
let executables = import_server.registry.defaultExecutables();
|
|
80
|
+
if (options.noShell)
|
|
81
|
+
executables = executables.filter((e) => e.name !== "chromium-headless-shell");
|
|
82
|
+
if (options.onlyShell)
|
|
83
|
+
executables = executables.filter((e) => e.name !== "chromium");
|
|
89
84
|
return executables;
|
|
90
85
|
}
|
|
91
86
|
function checkBrowsersToInstall(args, options) {
|
|
92
|
-
if (options.noShell && options.onlyShell)
|
|
87
|
+
if (options.noShell && options.onlyShell)
|
|
88
|
+
throw new Error(`Only one of --no-shell and --only-shell can be specified`);
|
|
93
89
|
const faultyArguments = [];
|
|
94
90
|
const executables = [];
|
|
95
|
-
const handleArgument = arg => {
|
|
96
|
-
const executable =
|
|
97
|
-
if (!executable || executable.installType ===
|
|
98
|
-
|
|
91
|
+
const handleArgument = (arg) => {
|
|
92
|
+
const executable = import_server.registry.findExecutable(arg);
|
|
93
|
+
if (!executable || executable.installType === "none")
|
|
94
|
+
faultyArguments.push(arg);
|
|
95
|
+
else
|
|
96
|
+
executables.push(executable);
|
|
97
|
+
if (executable?.browserName === "chromium")
|
|
98
|
+
executables.push(import_server.registry.findExecutable("ffmpeg"));
|
|
99
99
|
};
|
|
100
100
|
for (const arg of args) {
|
|
101
|
-
if (arg ===
|
|
102
|
-
if (!options.onlyShell)
|
|
103
|
-
|
|
101
|
+
if (arg === "chromium") {
|
|
102
|
+
if (!options.onlyShell)
|
|
103
|
+
handleArgument("chromium");
|
|
104
|
+
if (!options.noShell)
|
|
105
|
+
handleArgument("chromium-headless-shell");
|
|
104
106
|
} else {
|
|
105
107
|
handleArgument(arg);
|
|
106
108
|
}
|
|
107
109
|
}
|
|
108
|
-
if (
|
|
110
|
+
if (process.platform === "win32")
|
|
111
|
+
executables.push(import_server.registry.findExecutable("winldd"));
|
|
112
|
+
if (faultyArguments.length)
|
|
113
|
+
throw new Error(`Invalid installation targets: ${faultyArguments.map((name) => `'${name}'`).join(", ")}. Expecting one of: ${suggestedBrowsersToInstall()}`);
|
|
109
114
|
return executables;
|
|
110
115
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if ((0,
|
|
115
|
-
console.error((0,
|
|
116
|
+
import_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) {
|
|
117
|
+
if (options.shell === false)
|
|
118
|
+
options.noShell = true;
|
|
119
|
+
if ((0, import_utils.isLikelyNpxGlobal)()) {
|
|
120
|
+
console.error((0, import_ascii.wrapInASCIIBox)([
|
|
121
|
+
`WARNING: It looks like you are running 'npx playwright install' without first`,
|
|
122
|
+
`installing your project's dependencies.`,
|
|
123
|
+
``,
|
|
124
|
+
`To avoid unexpected behavior, please install your dependencies first, and`,
|
|
125
|
+
`then run Playwright's install command:`,
|
|
126
|
+
``,
|
|
127
|
+
` npm install`,
|
|
128
|
+
` npx playwright install`,
|
|
129
|
+
``,
|
|
130
|
+
`If your project does not yet depend on Playwright, first install the`,
|
|
131
|
+
`applicable npm package (most commonly @playwright/test), and`,
|
|
132
|
+
`then run Playwright's install command to download the browsers:`,
|
|
133
|
+
``,
|
|
134
|
+
` npm install @playwright/test`,
|
|
135
|
+
` npx playwright install`,
|
|
136
|
+
``
|
|
137
|
+
].join("\n"), 1));
|
|
116
138
|
}
|
|
117
139
|
try {
|
|
118
140
|
const hasNoArguments = !args.length;
|
|
119
141
|
const executables = hasNoArguments ? defaultBrowsersToInstall(options) : checkBrowsersToInstall(args, options);
|
|
120
|
-
if (options.withDeps)
|
|
142
|
+
if (options.withDeps)
|
|
143
|
+
await import_server.registry.installDeps(executables, !!options.dryRun);
|
|
121
144
|
if (options.dryRun) {
|
|
122
145
|
for (const executable of executables) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
console.log(`
|
|
126
|
-
|
|
127
|
-
if ((_executable$downloadU = executable.downloadURLs) !== null && _executable$downloadU !== void 0 && _executable$downloadU.length) {
|
|
146
|
+
const version = executable.browserVersion ? `version ` + executable.browserVersion : "";
|
|
147
|
+
console.log(`browser: ${executable.name}${version ? " " + version : ""}`);
|
|
148
|
+
console.log(` Install location: ${executable.directory ?? "<system>"}`);
|
|
149
|
+
if (executable.downloadURLs?.length) {
|
|
128
150
|
const [url, ...fallbacks] = executable.downloadURLs;
|
|
129
151
|
console.log(` Download url: ${url}`);
|
|
130
|
-
for (let i = 0; i < fallbacks.length; ++i)
|
|
152
|
+
for (let i = 0; i < fallbacks.length; ++i)
|
|
153
|
+
console.log(` Download fallback ${i + 1}: ${fallbacks[i]}`);
|
|
131
154
|
}
|
|
132
155
|
console.log(``);
|
|
133
156
|
}
|
|
134
157
|
} else {
|
|
135
158
|
const forceReinstall = hasNoArguments ? false : !!options.force;
|
|
136
|
-
await
|
|
137
|
-
await
|
|
138
|
-
e.name =
|
|
159
|
+
await import_server.registry.install(executables, forceReinstall);
|
|
160
|
+
await import_server.registry.validateHostRequirementsForExecutablesIfNeeded(executables, process.env.PW_LANG_NAME || "javascript").catch((e) => {
|
|
161
|
+
e.name = "Playwright Host validation warning";
|
|
139
162
|
console.error(e);
|
|
140
163
|
});
|
|
141
164
|
}
|
|
142
165
|
} catch (e) {
|
|
143
|
-
console.log(`Failed to install browsers
|
|
144
|
-
|
|
166
|
+
console.log(`Failed to install browsers
|
|
167
|
+
${e}`);
|
|
168
|
+
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
|
145
169
|
}
|
|
146
|
-
}).addHelpText(
|
|
170
|
+
}).addHelpText("afterAll", `
|
|
147
171
|
|
|
148
172
|
Examples:
|
|
149
173
|
- $ install
|
|
@@ -151,108 +175,110 @@ Examples:
|
|
|
151
175
|
|
|
152
176
|
- $ install chrome firefox
|
|
153
177
|
Install custom browsers, supports ${suggestedBrowsersToInstall()}.`);
|
|
154
|
-
|
|
178
|
+
import_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) => {
|
|
155
179
|
delete process.env.PLAYWRIGHT_SKIP_BROWSER_GC;
|
|
156
|
-
await
|
|
157
|
-
numberOfBrowsersLeft
|
|
158
|
-
}) => {
|
|
180
|
+
await import_server.registry.uninstall(!!options.all).then(({ numberOfBrowsersLeft }) => {
|
|
159
181
|
if (!options.all && numberOfBrowsersLeft > 0) {
|
|
160
|
-
console.log(
|
|
161
|
-
console.log(`There are still ${numberOfBrowsersLeft} browsers left, used by other Playwright installations
|
|
182
|
+
console.log("Successfully uninstalled Playwright browsers for the current Playwright installation.");
|
|
183
|
+
console.log(`There are still ${numberOfBrowsersLeft} browsers left, used by other Playwright installations.
|
|
184
|
+
To uninstall Playwright browsers for all installations, re-run with --all flag.`);
|
|
162
185
|
}
|
|
163
186
|
}).catch(logErrorAndExit);
|
|
164
187
|
});
|
|
165
|
-
|
|
188
|
+
import_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) {
|
|
166
189
|
try {
|
|
167
|
-
if (!args.length)
|
|
190
|
+
if (!args.length)
|
|
191
|
+
await import_server.registry.installDeps(defaultBrowsersToInstall({}), !!options.dryRun);
|
|
192
|
+
else
|
|
193
|
+
await import_server.registry.installDeps(checkBrowsersToInstall(args, {}), !!options.dryRun);
|
|
168
194
|
} catch (e) {
|
|
169
|
-
console.log(`Failed to install browser dependencies
|
|
170
|
-
|
|
195
|
+
console.log(`Failed to install browser dependencies
|
|
196
|
+
${e}`);
|
|
197
|
+
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
|
171
198
|
}
|
|
172
|
-
}).addHelpText(
|
|
199
|
+
}).addHelpText("afterAll", `
|
|
173
200
|
Examples:
|
|
174
201
|
- $ install-deps
|
|
175
202
|
Install dependencies for default browsers.
|
|
176
203
|
|
|
177
204
|
- $ install-deps chrome firefox
|
|
178
205
|
Install dependencies for specific browsers, supports ${suggestedBrowsersToInstall()}.`);
|
|
179
|
-
const browsers = [
|
|
180
|
-
alias:
|
|
181
|
-
name:
|
|
182
|
-
type:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
name
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
alias: 'wk',
|
|
189
|
-
name: 'WebKit',
|
|
190
|
-
type: 'webkit'
|
|
191
|
-
}];
|
|
192
|
-
for (const {
|
|
193
|
-
alias,
|
|
194
|
-
name,
|
|
195
|
-
type
|
|
196
|
-
} of browsers) {
|
|
197
|
-
commandWithOpenOptions(`${alias} [url]`, `open page in ${name}`, []).action(function (url, options) {
|
|
198
|
-
open({
|
|
199
|
-
...options,
|
|
200
|
-
browser: type
|
|
201
|
-
}, url, options.target).catch(logErrorAndExit);
|
|
202
|
-
}).addHelpText('afterAll', `
|
|
206
|
+
const browsers = [
|
|
207
|
+
{ alias: "cr", name: "Chromium", type: "chromium" },
|
|
208
|
+
{ alias: "ff", name: "Firefox", type: "firefox" },
|
|
209
|
+
{ alias: "wk", name: "WebKit", type: "webkit" }
|
|
210
|
+
];
|
|
211
|
+
for (const { alias, name, type } of browsers) {
|
|
212
|
+
commandWithOpenOptions(`${alias} [url]`, `open page in ${name}`, []).action(function(url, options) {
|
|
213
|
+
open({ ...options, browser: type }, url, options.target).catch(logErrorAndExit);
|
|
214
|
+
}).addHelpText("afterAll", `
|
|
203
215
|
Examples:
|
|
204
216
|
|
|
205
217
|
$ ${alias} https://example.com`);
|
|
206
218
|
}
|
|
207
|
-
commandWithOpenOptions(
|
|
219
|
+
commandWithOpenOptions(
|
|
220
|
+
"screenshot <url> <filename>",
|
|
221
|
+
"capture a page screenshot",
|
|
222
|
+
[
|
|
223
|
+
["--wait-for-selector <selector>", "wait for selector before taking a screenshot"],
|
|
224
|
+
["--wait-for-timeout <timeout>", "wait for timeout in milliseconds before taking a screenshot"],
|
|
225
|
+
["--full-page", "whether to take a full page screenshot (entire scrollable area)"]
|
|
226
|
+
]
|
|
227
|
+
).action(function(url, filename, command) {
|
|
208
228
|
screenshot(command, command, url, filename).catch(logErrorAndExit);
|
|
209
|
-
}).addHelpText(
|
|
229
|
+
}).addHelpText("afterAll", `
|
|
210
230
|
Examples:
|
|
211
231
|
|
|
212
232
|
$ screenshot -b webkit https://example.com example.png`);
|
|
213
|
-
commandWithOpenOptions(
|
|
233
|
+
commandWithOpenOptions(
|
|
234
|
+
"pdf <url> <filename>",
|
|
235
|
+
"save page as pdf",
|
|
236
|
+
[
|
|
237
|
+
["--paper-format <format>", "paper format: Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6"],
|
|
238
|
+
["--wait-for-selector <selector>", "wait for given selector before saving as pdf"],
|
|
239
|
+
["--wait-for-timeout <timeout>", "wait for given timeout in milliseconds before saving as pdf"]
|
|
240
|
+
]
|
|
241
|
+
).action(function(url, filename, options) {
|
|
214
242
|
pdf(options, options, url, filename).catch(logErrorAndExit);
|
|
215
|
-
}).addHelpText(
|
|
243
|
+
}).addHelpText("afterAll", `
|
|
216
244
|
Examples:
|
|
217
245
|
|
|
218
246
|
$ pdf https://example.com example.pdf`);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}).action(function (options) {
|
|
222
|
-
(0, _driver.runDriver)();
|
|
247
|
+
import_utilsBundle.program.command("run-driver", { hidden: true }).action(function(options) {
|
|
248
|
+
(0, import_driver.runDriver)();
|
|
223
249
|
});
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
(0, _driver.runServer)({
|
|
228
|
-
port: options.port ? +options.port : undefined,
|
|
250
|
+
import_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) {
|
|
251
|
+
(0, import_driver.runServer)({
|
|
252
|
+
port: options.port ? +options.port : void 0,
|
|
229
253
|
host: options.host,
|
|
230
254
|
path: options.path,
|
|
231
255
|
maxConnections: options.maxClients ? +options.maxClients : Infinity,
|
|
232
|
-
extension: options.mode ===
|
|
256
|
+
extension: options.mode === "extension" || !!process.env.PW_EXTENSION_MODE
|
|
233
257
|
}).catch(logErrorAndExit);
|
|
234
258
|
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}).action(function (options) {
|
|
238
|
-
(0, _driver.printApiJson)();
|
|
259
|
+
import_utilsBundle.program.command("print-api-json", { hidden: true }).action(function(options) {
|
|
260
|
+
(0, import_driver.printApiJson)();
|
|
239
261
|
});
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}).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) {
|
|
243
|
-
(0, _driver.launchBrowserServer)(options.browser, options.config);
|
|
262
|
+
import_utilsBundle.program.command("launch-server", { hidden: true }).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) {
|
|
263
|
+
(0, import_driver.launchBrowserServer)(options.browser, options.config);
|
|
244
264
|
});
|
|
245
|
-
|
|
246
|
-
if (options.browser ===
|
|
247
|
-
|
|
248
|
-
if (options.browser ===
|
|
265
|
+
import_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) {
|
|
266
|
+
if (options.browser === "cr")
|
|
267
|
+
options.browser = "chromium";
|
|
268
|
+
if (options.browser === "ff")
|
|
269
|
+
options.browser = "firefox";
|
|
270
|
+
if (options.browser === "wk")
|
|
271
|
+
options.browser = "webkit";
|
|
249
272
|
const openOptions = {
|
|
250
273
|
host: options.host,
|
|
251
274
|
port: +options.port,
|
|
252
275
|
isServer: !!options.stdin
|
|
253
276
|
};
|
|
254
|
-
if (options.port !==
|
|
255
|
-
|
|
277
|
+
if (options.port !== void 0 || options.host !== void 0)
|
|
278
|
+
(0, import_traceViewer.runTraceInBrowser)(traces, openOptions).catch(logErrorAndExit);
|
|
279
|
+
else
|
|
280
|
+
(0, import_traceViewer.runTraceViewerApp)(traces, options.browser, openOptions, true).catch(logErrorAndExit);
|
|
281
|
+
}).addHelpText("afterAll", `
|
|
256
282
|
Examples:
|
|
257
283
|
|
|
258
284
|
$ show-trace https://example.com/trace.zip`);
|
|
@@ -260,78 +286,67 @@ async function launchContext(options, extraOptions) {
|
|
|
260
286
|
validateOptions(options);
|
|
261
287
|
const browserType = lookupBrowserType(options);
|
|
262
288
|
const launchOptions = extraOptions;
|
|
263
|
-
if (options.channel)
|
|
289
|
+
if (options.channel)
|
|
290
|
+
launchOptions.channel = options.channel;
|
|
264
291
|
launchOptions.handleSIGINT = false;
|
|
265
|
-
const contextOptions =
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
// In headless, keep things the way it works in Playwright by default.
|
|
273
|
-
// Assume high-dpi on MacOS. TODO: this is not perfect.
|
|
274
|
-
if (!extraOptions.headless) contextOptions.deviceScaleFactor = _os.default.platform() === 'darwin' ? 2 : 1;
|
|
275
|
-
|
|
276
|
-
// Work around the WebKit GTK scrolling issue.
|
|
277
|
-
if (browserType.name() === 'webkit' && process.platform === 'linux') {
|
|
292
|
+
const contextOptions = (
|
|
293
|
+
// Copy the device descriptor since we have to compare and modify the options.
|
|
294
|
+
options.device ? { ...playwright.devices[options.device] } : {}
|
|
295
|
+
);
|
|
296
|
+
if (!extraOptions.headless)
|
|
297
|
+
contextOptions.deviceScaleFactor = import_os.default.platform() === "darwin" ? 2 : 1;
|
|
298
|
+
if (browserType.name() === "webkit" && process.platform === "linux") {
|
|
278
299
|
delete contextOptions.hasTouch;
|
|
279
300
|
delete contextOptions.isMobile;
|
|
280
301
|
}
|
|
281
|
-
if (contextOptions.isMobile && browserType.name() ===
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
302
|
+
if (contextOptions.isMobile && browserType.name() === "firefox")
|
|
303
|
+
contextOptions.isMobile = void 0;
|
|
304
|
+
if (options.blockServiceWorkers)
|
|
305
|
+
contextOptions.serviceWorkers = "block";
|
|
286
306
|
if (options.proxyServer) {
|
|
287
307
|
launchOptions.proxy = {
|
|
288
308
|
server: options.proxyServer
|
|
289
309
|
};
|
|
290
|
-
if (options.proxyBypass)
|
|
310
|
+
if (options.proxyBypass)
|
|
311
|
+
launchOptions.proxy.bypass = options.proxyBypass;
|
|
291
312
|
}
|
|
292
313
|
const browser = await browserType.launch(launchOptions);
|
|
293
314
|
if (process.env.PWTEST_CLI_IS_UNDER_TEST) {
|
|
294
|
-
process._didSetSourcesForTest = text => {
|
|
295
|
-
process.stdout.write(
|
|
315
|
+
process._didSetSourcesForTest = (text) => {
|
|
316
|
+
process.stdout.write("\n-------------8<-------------\n");
|
|
296
317
|
process.stdout.write(text);
|
|
297
|
-
process.stdout.write(
|
|
318
|
+
process.stdout.write("\n-------------8<-------------\n");
|
|
298
319
|
const autoExitCondition = process.env.PWTEST_CLI_AUTO_EXIT_WHEN;
|
|
299
|
-
if (autoExitCondition && text.includes(autoExitCondition))
|
|
320
|
+
if (autoExitCondition && text.includes(autoExitCondition))
|
|
321
|
+
closeBrowser();
|
|
300
322
|
};
|
|
301
|
-
// Make sure we exit abnormally when browser crashes.
|
|
302
323
|
const logs = [];
|
|
303
|
-
require(
|
|
304
|
-
const line = require(
|
|
324
|
+
require("playwright-core/lib/utilsBundle").debug.log = (...args) => {
|
|
325
|
+
const line = require("util").format(...args) + "\n";
|
|
305
326
|
logs.push(line);
|
|
306
327
|
process.stderr.write(line);
|
|
307
328
|
};
|
|
308
|
-
browser.on(
|
|
309
|
-
const hasCrashLine = logs.some(line => line.includes(
|
|
329
|
+
browser.on("disconnected", () => {
|
|
330
|
+
const hasCrashLine = logs.some((line) => line.includes("process did exit:") && !line.includes("process did exit: exitCode=0, signal=null"));
|
|
310
331
|
if (hasCrashLine) {
|
|
311
|
-
process.stderr.write(
|
|
312
|
-
(0,
|
|
332
|
+
process.stderr.write("Detected browser crash.\n");
|
|
333
|
+
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
|
313
334
|
}
|
|
314
335
|
});
|
|
315
336
|
}
|
|
316
|
-
|
|
317
|
-
// Viewport size
|
|
318
337
|
if (options.viewportSize) {
|
|
319
338
|
try {
|
|
320
|
-
const [width, height] = options.viewportSize.split(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
};
|
|
339
|
+
const [width, height] = options.viewportSize.split(",").map((n) => +n);
|
|
340
|
+
if (isNaN(width) || isNaN(height))
|
|
341
|
+
throw new Error("bad values");
|
|
342
|
+
contextOptions.viewport = { width, height };
|
|
325
343
|
} catch (e) {
|
|
326
|
-
throw new Error('Invalid viewport size format: use "width,
|
|
344
|
+
throw new Error('Invalid viewport size format: use "width,height", for example --viewport-size="800,600"');
|
|
327
345
|
}
|
|
328
346
|
}
|
|
329
|
-
|
|
330
|
-
// Geolocation
|
|
331
|
-
|
|
332
347
|
if (options.geolocation) {
|
|
333
348
|
try {
|
|
334
|
-
const [latitude, longitude] = options.geolocation.split(
|
|
349
|
+
const [latitude, longitude] = options.geolocation.split(",").map((n) => parseFloat(n.trim()));
|
|
335
350
|
contextOptions.geolocation = {
|
|
336
351
|
latitude,
|
|
337
352
|
longitude
|
|
@@ -339,101 +354,71 @@ async function launchContext(options, extraOptions) {
|
|
|
339
354
|
} catch (e) {
|
|
340
355
|
throw new Error('Invalid geolocation format, should be "lat,long". For example --geolocation="37.819722,-122.478611"');
|
|
341
356
|
}
|
|
342
|
-
contextOptions.permissions = [
|
|
357
|
+
contextOptions.permissions = ["geolocation"];
|
|
343
358
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
// Timezone
|
|
358
|
-
|
|
359
|
-
if (options.timezone) contextOptions.timezoneId = options.timezone;
|
|
360
|
-
|
|
361
|
-
// Storage
|
|
362
|
-
|
|
363
|
-
if (options.loadStorage) contextOptions.storageState = options.loadStorage;
|
|
364
|
-
if (options.ignoreHttpsErrors) contextOptions.ignoreHTTPSErrors = true;
|
|
365
|
-
|
|
366
|
-
// HAR
|
|
367
|
-
|
|
359
|
+
if (options.userAgent)
|
|
360
|
+
contextOptions.userAgent = options.userAgent;
|
|
361
|
+
if (options.lang)
|
|
362
|
+
contextOptions.locale = options.lang;
|
|
363
|
+
if (options.colorScheme)
|
|
364
|
+
contextOptions.colorScheme = options.colorScheme;
|
|
365
|
+
if (options.timezone)
|
|
366
|
+
contextOptions.timezoneId = options.timezone;
|
|
367
|
+
if (options.loadStorage)
|
|
368
|
+
contextOptions.storageState = options.loadStorage;
|
|
369
|
+
if (options.ignoreHttpsErrors)
|
|
370
|
+
contextOptions.ignoreHTTPSErrors = true;
|
|
368
371
|
if (options.saveHar) {
|
|
369
|
-
contextOptions.recordHar = {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
if (options.saveHarGlob) contextOptions.recordHar.urlFilter = options.saveHarGlob;
|
|
374
|
-
contextOptions.serviceWorkers = 'block';
|
|
372
|
+
contextOptions.recordHar = { path: import_path.default.resolve(process.cwd(), options.saveHar), mode: "minimal" };
|
|
373
|
+
if (options.saveHarGlob)
|
|
374
|
+
contextOptions.recordHar.urlFilter = options.saveHarGlob;
|
|
375
|
+
contextOptions.serviceWorkers = "block";
|
|
375
376
|
}
|
|
376
|
-
|
|
377
|
-
// Close app when the last window closes.
|
|
378
|
-
|
|
379
377
|
const context = await browser.newContext(contextOptions);
|
|
380
378
|
let closingBrowser = false;
|
|
381
379
|
async function closeBrowser() {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
if (closingBrowser) return;
|
|
380
|
+
if (closingBrowser)
|
|
381
|
+
return;
|
|
385
382
|
closingBrowser = true;
|
|
386
|
-
if (options.
|
|
387
|
-
path: options.
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
path: options.saveStorage
|
|
391
|
-
}).catch(e => null);
|
|
392
|
-
if (options.saveHar) await context.close();
|
|
383
|
+
if (options.saveStorage)
|
|
384
|
+
await context.storageState({ path: options.saveStorage }).catch((e) => null);
|
|
385
|
+
if (options.saveHar)
|
|
386
|
+
await context.close();
|
|
393
387
|
await browser.close();
|
|
394
388
|
}
|
|
395
|
-
context.on(
|
|
396
|
-
page.on(
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
389
|
+
context.on("page", (page) => {
|
|
390
|
+
page.on("dialog", () => {
|
|
391
|
+
});
|
|
392
|
+
page.on("close", () => {
|
|
393
|
+
const hasPage = browser.contexts().some((context2) => context2.pages().length > 0);
|
|
394
|
+
if (hasPage)
|
|
395
|
+
return;
|
|
396
|
+
closeBrowser().catch(() => {
|
|
397
|
+
});
|
|
402
398
|
});
|
|
403
399
|
});
|
|
404
|
-
process.on(
|
|
400
|
+
process.on("SIGINT", async () => {
|
|
405
401
|
await closeBrowser();
|
|
406
|
-
(0,
|
|
402
|
+
(0, import_utils.gracefullyProcessExitDoNotHang)(130);
|
|
407
403
|
});
|
|
408
404
|
const timeout = options.timeout ? parseInt(options.timeout, 10) : 0;
|
|
409
405
|
context.setDefaultTimeout(timeout);
|
|
410
406
|
context.setDefaultNavigationTimeout(timeout);
|
|
411
|
-
if (options.saveTrace) await context.tracing.start({
|
|
412
|
-
screenshots: true,
|
|
413
|
-
snapshots: true
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
// Omit options that we add automatically for presentation purpose.
|
|
417
407
|
delete launchOptions.headless;
|
|
418
408
|
delete launchOptions.executablePath;
|
|
419
409
|
delete launchOptions.handleSIGINT;
|
|
420
410
|
delete contextOptions.deviceScaleFactor;
|
|
421
|
-
return {
|
|
422
|
-
browser,
|
|
423
|
-
browserName: browserType.name(),
|
|
424
|
-
context,
|
|
425
|
-
contextOptions,
|
|
426
|
-
launchOptions
|
|
427
|
-
};
|
|
411
|
+
return { browser, browserName: browserType.name(), context, contextOptions, launchOptions };
|
|
428
412
|
}
|
|
429
413
|
async function openPage(context, url) {
|
|
430
414
|
const page = await context.newPage();
|
|
431
415
|
if (url) {
|
|
432
|
-
if (
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
416
|
+
if (import_fs.default.existsSync(url))
|
|
417
|
+
url = "file://" + import_path.default.resolve(url);
|
|
418
|
+
else if (!url.startsWith("http") && !url.startsWith("file://") && !url.startsWith("about:") && !url.startsWith("data:"))
|
|
419
|
+
url = "http://" + url;
|
|
420
|
+
await page.goto(url).catch((error) => {
|
|
421
|
+
if (process.env.PWTEST_CLI_AUTO_EXIT_WHEN) {
|
|
437
422
|
} else {
|
|
438
423
|
throw error;
|
|
439
424
|
}
|
|
@@ -442,14 +427,7 @@ async function openPage(context, url) {
|
|
|
442
427
|
return page;
|
|
443
428
|
}
|
|
444
429
|
async function open(options, url, language) {
|
|
445
|
-
const {
|
|
446
|
-
context,
|
|
447
|
-
launchOptions,
|
|
448
|
-
contextOptions
|
|
449
|
-
} = await launchContext(options, {
|
|
450
|
-
headless: !!process.env.PWTEST_CLI_HEADLESS,
|
|
451
|
-
executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH
|
|
452
|
-
});
|
|
430
|
+
const { context, launchOptions, contextOptions } = await launchContext(options, { headless: !!process.env.PWTEST_CLI_HEADLESS, executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH });
|
|
453
431
|
await context._enableRecorder({
|
|
454
432
|
language,
|
|
455
433
|
launchOptions,
|
|
@@ -461,34 +439,23 @@ async function open(options, url, language) {
|
|
|
461
439
|
await openPage(context, url);
|
|
462
440
|
}
|
|
463
441
|
async function codegen(options, url) {
|
|
464
|
-
const {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
testIdAttribute: testIdAttributeName
|
|
468
|
-
} = options;
|
|
469
|
-
const tracesDir = _path.default.join(_os.default.tmpdir(), `playwright-recorder-trace-${Date.now()}`);
|
|
470
|
-
const {
|
|
471
|
-
context,
|
|
472
|
-
launchOptions,
|
|
473
|
-
contextOptions
|
|
474
|
-
} = await launchContext(options, {
|
|
442
|
+
const { target: language, output: outputFile, testIdAttribute: testIdAttributeName } = options;
|
|
443
|
+
const tracesDir = import_path.default.join(import_os.default.tmpdir(), `playwright-recorder-trace-${Date.now()}`);
|
|
444
|
+
const { context, launchOptions, contextOptions } = await launchContext(options, {
|
|
475
445
|
headless: !!process.env.PWTEST_CLI_HEADLESS,
|
|
476
446
|
executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH,
|
|
477
447
|
tracesDir
|
|
478
448
|
});
|
|
479
|
-
|
|
480
|
-
path: 'playwright.env'
|
|
481
|
-
});
|
|
449
|
+
import_utilsBundle.dotenv.config({ path: "playwright.env" });
|
|
482
450
|
await context._enableRecorder({
|
|
483
451
|
language,
|
|
484
452
|
launchOptions,
|
|
485
453
|
contextOptions,
|
|
486
454
|
device: options.device,
|
|
487
455
|
saveStorage: options.saveStorage,
|
|
488
|
-
mode:
|
|
489
|
-
codegenMode: process.env.PW_RECORDER_IS_TRACE_VIEWER ? 'trace-events' : 'actions',
|
|
456
|
+
mode: "recording",
|
|
490
457
|
testIdAttributeName,
|
|
491
|
-
outputFile: outputFile ?
|
|
458
|
+
outputFile: outputFile ? import_path.default.resolve(outputFile) : void 0,
|
|
492
459
|
handleSIGINT: false
|
|
493
460
|
});
|
|
494
461
|
await openPage(context, url);
|
|
@@ -503,41 +470,24 @@ async function waitForPage(page, captureOptions) {
|
|
|
503
470
|
await page.waitForTimeout(parseInt(captureOptions.waitForTimeout, 10));
|
|
504
471
|
}
|
|
505
472
|
}
|
|
506
|
-
async function screenshot(options, captureOptions, url,
|
|
507
|
-
const {
|
|
508
|
-
|
|
509
|
-
} = await launchContext(options, {
|
|
510
|
-
headless: true
|
|
511
|
-
});
|
|
512
|
-
console.log('Navigating to ' + url);
|
|
473
|
+
async function screenshot(options, captureOptions, url, path2) {
|
|
474
|
+
const { context } = await launchContext(options, { headless: true });
|
|
475
|
+
console.log("Navigating to " + url);
|
|
513
476
|
const page = await openPage(context, url);
|
|
514
477
|
await waitForPage(page, captureOptions);
|
|
515
|
-
console.log(
|
|
516
|
-
await page.screenshot({
|
|
517
|
-
path,
|
|
518
|
-
fullPage: !!captureOptions.fullPage
|
|
519
|
-
});
|
|
520
|
-
// launchContext takes care of closing the browser.
|
|
478
|
+
console.log("Capturing screenshot into " + path2);
|
|
479
|
+
await page.screenshot({ path: path2, fullPage: !!captureOptions.fullPage });
|
|
521
480
|
await page.close();
|
|
522
481
|
}
|
|
523
|
-
async function pdf(options, captureOptions, url,
|
|
524
|
-
if (options.browser !==
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
...options,
|
|
529
|
-
browser: 'chromium'
|
|
530
|
-
}, {
|
|
531
|
-
headless: true
|
|
532
|
-
});
|
|
533
|
-
console.log('Navigating to ' + url);
|
|
482
|
+
async function pdf(options, captureOptions, url, path2) {
|
|
483
|
+
if (options.browser !== "chromium")
|
|
484
|
+
throw new Error("PDF creation is only working with Chromium");
|
|
485
|
+
const { context } = await launchContext({ ...options, browser: "chromium" }, { headless: true });
|
|
486
|
+
console.log("Navigating to " + url);
|
|
534
487
|
const page = await openPage(context, url);
|
|
535
488
|
await waitForPage(page, captureOptions);
|
|
536
|
-
console.log(
|
|
537
|
-
await page.pdf({
|
|
538
|
-
path
|
|
539
|
-
});
|
|
540
|
-
// launchContext takes care of closing the browser.
|
|
489
|
+
console.log("Saving as pdf into " + path2);
|
|
490
|
+
await page.pdf({ path: path2, format: captureOptions.paperFormat });
|
|
541
491
|
await page.close();
|
|
542
492
|
}
|
|
543
493
|
function lookupBrowserType(options) {
|
|
@@ -548,60 +498,70 @@ function lookupBrowserType(options) {
|
|
|
548
498
|
}
|
|
549
499
|
let browserType;
|
|
550
500
|
switch (name) {
|
|
551
|
-
case
|
|
501
|
+
case "chromium":
|
|
552
502
|
browserType = playwright.chromium;
|
|
553
503
|
break;
|
|
554
|
-
case
|
|
504
|
+
case "webkit":
|
|
555
505
|
browserType = playwright.webkit;
|
|
556
506
|
break;
|
|
557
|
-
case
|
|
507
|
+
case "firefox":
|
|
558
508
|
browserType = playwright.firefox;
|
|
559
509
|
break;
|
|
560
|
-
case
|
|
510
|
+
case "cr":
|
|
561
511
|
browserType = playwright.chromium;
|
|
562
512
|
break;
|
|
563
|
-
case
|
|
513
|
+
case "wk":
|
|
564
514
|
browserType = playwright.webkit;
|
|
565
515
|
break;
|
|
566
|
-
case
|
|
516
|
+
case "ff":
|
|
567
517
|
browserType = playwright.firefox;
|
|
568
518
|
break;
|
|
569
519
|
}
|
|
570
|
-
if (browserType)
|
|
571
|
-
|
|
520
|
+
if (browserType)
|
|
521
|
+
return browserType;
|
|
522
|
+
import_utilsBundle.program.help();
|
|
572
523
|
}
|
|
573
524
|
function validateOptions(options) {
|
|
574
525
|
if (options.device && !(options.device in playwright.devices)) {
|
|
575
526
|
const lines = [`Device descriptor not found: '${options.device}', available devices are:`];
|
|
576
|
-
for (const name in playwright.devices)
|
|
577
|
-
|
|
527
|
+
for (const name in playwright.devices)
|
|
528
|
+
lines.push(` "${name}"`);
|
|
529
|
+
throw new Error(lines.join("\n"));
|
|
578
530
|
}
|
|
579
|
-
if (options.colorScheme && ![
|
|
531
|
+
if (options.colorScheme && !["light", "dark"].includes(options.colorScheme))
|
|
532
|
+
throw new Error('Invalid color scheme, should be one of "light", "dark"');
|
|
580
533
|
}
|
|
581
534
|
function logErrorAndExit(e) {
|
|
582
|
-
if (process.env.PWDEBUGIMPL)
|
|
583
|
-
|
|
535
|
+
if (process.env.PWDEBUGIMPL)
|
|
536
|
+
console.error(e);
|
|
537
|
+
else
|
|
538
|
+
console.error(e.name + ": " + e.message);
|
|
539
|
+
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
|
584
540
|
}
|
|
585
541
|
function codegenId() {
|
|
586
|
-
return process.env.PW_LANG_NAME ||
|
|
542
|
+
return process.env.PW_LANG_NAME || "playwright-test";
|
|
587
543
|
}
|
|
588
544
|
function commandWithOpenOptions(command, description, options) {
|
|
589
|
-
let result =
|
|
590
|
-
for (const option of options)
|
|
591
|
-
|
|
545
|
+
let result = import_utilsBundle.program.command(command).description(description);
|
|
546
|
+
for (const option of options)
|
|
547
|
+
result = result.option(option[0], ...option.slice(1));
|
|
548
|
+
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"');
|
|
592
549
|
}
|
|
593
550
|
function buildBasePlaywrightCLICommand(cliTargetLang) {
|
|
594
551
|
switch (cliTargetLang) {
|
|
595
|
-
case
|
|
552
|
+
case "python":
|
|
596
553
|
return `playwright`;
|
|
597
|
-
case
|
|
554
|
+
case "java":
|
|
598
555
|
return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="...options.."`;
|
|
599
|
-
case
|
|
556
|
+
case "csharp":
|
|
600
557
|
return `pwsh bin/Debug/netX/playwright.ps1`;
|
|
601
|
-
default:
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}
|
|
558
|
+
default: {
|
|
559
|
+
const packageManagerCommand = (0, import_utils2.getPackageManagerExecCommand)();
|
|
560
|
+
return `${packageManagerCommand} playwright`;
|
|
561
|
+
}
|
|
606
562
|
}
|
|
607
|
-
}
|
|
563
|
+
}
|
|
564
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
565
|
+
0 && (module.exports = {
|
|
566
|
+
program
|
|
567
|
+
});
|