playwright-codegen-pro-core 1.0.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/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +3 -0
- package/ThirdPartyNotices.txt +3552 -0
- package/bin/install_media_pack.ps1 +5 -0
- package/bin/install_webkit_wsl.ps1 +33 -0
- package/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/browsers.json +81 -0
- package/bundles/mcp/package-lock.json +1135 -0
- package/bundles/mcp/package.json +10 -0
- package/bundles/mcp/raw-body.ts +43 -0
- package/bundles/utils/package-lock.json +466 -0
- package/bundles/utils/package.json +40 -0
- package/bundles/zip/package-lock.json +257 -0
- package/bundles/zip/package.json +16 -0
- package/cli.js +18 -0
- package/index.d.ts +17 -0
- package/index.js +32 -0
- package/index.mjs +28 -0
- package/lib/androidServerImpl.js +65 -0
- package/lib/browserServerImpl.js +120 -0
- package/lib/cli/driver.js +98 -0
- package/lib/cli/program.js +599 -0
- package/lib/cli/programWithTestStub.js +74 -0
- package/lib/client/android.js +361 -0
- package/lib/client/api.js +137 -0
- package/lib/client/artifact.js +79 -0
- package/lib/client/browser.js +169 -0
- package/lib/client/browserContext.js +563 -0
- package/lib/client/browserType.js +153 -0
- package/lib/client/cdpSession.js +55 -0
- package/lib/client/channelOwner.js +194 -0
- package/lib/client/clientHelper.js +64 -0
- package/lib/client/clientInstrumentation.js +55 -0
- package/lib/client/clientStackTrace.js +69 -0
- package/lib/client/clock.js +68 -0
- package/lib/client/connect.js +143 -0
- package/lib/client/connection.js +322 -0
- package/lib/client/consoleMessage.js +61 -0
- package/lib/client/coverage.js +44 -0
- package/lib/client/debugger.js +57 -0
- package/lib/client/dialog.js +56 -0
- package/lib/client/disposable.js +76 -0
- package/lib/client/download.js +62 -0
- package/lib/client/electron.js +138 -0
- package/lib/client/elementHandle.js +281 -0
- package/lib/client/errors.js +77 -0
- package/lib/client/eventEmitter.js +314 -0
- package/lib/client/events.js +103 -0
- package/lib/client/fetch.js +367 -0
- package/lib/client/fileChooser.js +46 -0
- package/lib/client/fileUtils.js +34 -0
- package/lib/client/frame.js +404 -0
- package/lib/client/harRouter.js +99 -0
- package/lib/client/input.js +84 -0
- package/lib/client/jsHandle.js +105 -0
- package/lib/client/jsonPipe.js +39 -0
- package/lib/client/localUtils.js +60 -0
- package/lib/client/locator.js +367 -0
- package/lib/client/network.js +750 -0
- package/lib/client/page.js +729 -0
- package/lib/client/platform.js +77 -0
- package/lib/client/playwright.js +71 -0
- package/lib/client/screencast.js +48 -0
- package/lib/client/selectors.js +57 -0
- package/lib/client/stream.js +39 -0
- package/lib/client/timeoutSettings.js +79 -0
- package/lib/client/tracing.js +126 -0
- package/lib/client/types.js +28 -0
- package/lib/client/video.js +68 -0
- package/lib/client/waiter.js +142 -0
- package/lib/client/webError.js +39 -0
- package/lib/client/worker.js +85 -0
- package/lib/client/writableStream.js +39 -0
- package/lib/generated/bindingsControllerSource.js +28 -0
- package/lib/generated/clockSource.js +28 -0
- package/lib/generated/injectedScriptSource.js +28 -0
- package/lib/generated/pollingRecorderSource.js +28 -0
- package/lib/generated/storageScriptSource.js +28 -0
- package/lib/generated/utilityScriptSource.js +28 -0
- package/lib/generated/webSocketMockSource.js +336 -0
- package/lib/inProcessFactory.js +60 -0
- package/lib/inprocess.js +3 -0
- package/lib/mcpBundle.js +81 -0
- package/lib/mcpBundleImpl/index.js +91 -0
- package/lib/outofprocess.js +76 -0
- package/lib/protocol/serializers.js +197 -0
- package/lib/protocol/validator.js +3035 -0
- package/lib/protocol/validatorPrimitives.js +193 -0
- package/lib/remote/playwrightConnection.js +131 -0
- package/lib/remote/playwrightPipeServer.js +100 -0
- package/lib/remote/playwrightServer.js +339 -0
- package/lib/remote/playwrightWebSocketServer.js +73 -0
- package/lib/remote/serverTransport.js +96 -0
- package/lib/server/android/android.js +465 -0
- package/lib/server/android/backendAdb.js +177 -0
- package/lib/server/artifact.js +127 -0
- package/lib/server/bidi/bidiBrowser.js +571 -0
- package/lib/server/bidi/bidiChromium.js +162 -0
- package/lib/server/bidi/bidiConnection.js +213 -0
- package/lib/server/bidi/bidiDeserializer.js +116 -0
- package/lib/server/bidi/bidiExecutionContext.js +267 -0
- package/lib/server/bidi/bidiFirefox.js +128 -0
- package/lib/server/bidi/bidiInput.js +146 -0
- package/lib/server/bidi/bidiNetworkManager.js +411 -0
- package/lib/server/bidi/bidiOverCdp.js +102 -0
- package/lib/server/bidi/bidiPage.js +599 -0
- package/lib/server/bidi/bidiPdf.js +106 -0
- package/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- package/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/lib/server/bidi/third_party/bidiProtocolCore.js +180 -0
- package/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- package/lib/server/bidi/third_party/firefoxPrefs.js +261 -0
- package/lib/server/browser.js +223 -0
- package/lib/server/browserContext.js +703 -0
- package/lib/server/browserType.js +338 -0
- package/lib/server/callLog.js +82 -0
- package/lib/server/chromium/appIcon.png +0 -0
- package/lib/server/chromium/chromium.js +399 -0
- package/lib/server/chromium/chromiumSwitches.js +104 -0
- package/lib/server/chromium/crBrowser.js +532 -0
- package/lib/server/chromium/crConnection.js +197 -0
- package/lib/server/chromium/crCoverage.js +235 -0
- package/lib/server/chromium/crDevTools.js +111 -0
- package/lib/server/chromium/crDragDrop.js +131 -0
- package/lib/server/chromium/crExecutionContext.js +146 -0
- package/lib/server/chromium/crInput.js +187 -0
- package/lib/server/chromium/crNetworkManager.js +711 -0
- package/lib/server/chromium/crPage.js +1004 -0
- package/lib/server/chromium/crPdf.js +121 -0
- package/lib/server/chromium/crProtocolHelper.js +145 -0
- package/lib/server/chromium/crServiceWorker.js +137 -0
- package/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/lib/server/chromium/protocol.d.js +16 -0
- package/lib/server/clock.js +149 -0
- package/lib/server/codegen/csharp.js +327 -0
- package/lib/server/codegen/java.js +274 -0
- package/lib/server/codegen/javascript.js +247 -0
- package/lib/server/codegen/jsonl.js +52 -0
- package/lib/server/codegen/language.js +132 -0
- package/lib/server/codegen/languages.js +68 -0
- package/lib/server/codegen/python.js +279 -0
- package/lib/server/codegen/types.js +16 -0
- package/lib/server/console.js +61 -0
- package/lib/server/cookieStore.js +206 -0
- package/lib/server/debugController.js +197 -0
- package/lib/server/debugger.js +117 -0
- package/lib/server/deviceDescriptors.js +39 -0
- package/lib/server/deviceDescriptorsSource.json +1779 -0
- package/lib/server/dialog.js +116 -0
- package/lib/server/dispatchers/androidDispatcher.js +325 -0
- package/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/lib/server/dispatchers/browserContextDispatcher.js +381 -0
- package/lib/server/dispatchers/browserDispatcher.js +124 -0
- package/lib/server/dispatchers/browserTypeDispatcher.js +71 -0
- package/lib/server/dispatchers/cdpSessionDispatcher.js +47 -0
- package/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/lib/server/dispatchers/debuggerDispatcher.js +80 -0
- package/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/lib/server/dispatchers/dispatcher.js +364 -0
- package/lib/server/dispatchers/disposableDispatcher.js +39 -0
- package/lib/server/dispatchers/electronDispatcher.js +90 -0
- package/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- package/lib/server/dispatchers/frameDispatcher.js +227 -0
- package/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- package/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- package/lib/server/dispatchers/localUtilsDispatcher.js +185 -0
- package/lib/server/dispatchers/networkDispatchers.js +214 -0
- package/lib/server/dispatchers/pageDispatcher.js +430 -0
- package/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- package/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +164 -0
- package/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/lib/server/disposable.js +41 -0
- package/lib/server/dom.js +833 -0
- package/lib/server/download.js +71 -0
- package/lib/server/electron/electron.js +272 -0
- package/lib/server/electron/loader.js +29 -0
- package/lib/server/errors.js +69 -0
- package/lib/server/fetch.js +621 -0
- package/lib/server/fileChooser.js +43 -0
- package/lib/server/fileUploadUtils.js +84 -0
- package/lib/server/firefox/ffBrowser.js +415 -0
- package/lib/server/firefox/ffConnection.js +142 -0
- package/lib/server/firefox/ffExecutionContext.js +150 -0
- package/lib/server/firefox/ffInput.js +175 -0
- package/lib/server/firefox/ffNetworkManager.js +256 -0
- package/lib/server/firefox/ffPage.js +495 -0
- package/lib/server/firefox/firefox.js +114 -0
- package/lib/server/firefox/protocol.d.js +16 -0
- package/lib/server/formData.js +147 -0
- package/lib/server/frameSelectors.js +160 -0
- package/lib/server/frames.js +1495 -0
- package/lib/server/har/harRecorder.js +147 -0
- package/lib/server/har/harTracer.js +608 -0
- package/lib/server/harBackend.js +157 -0
- package/lib/server/helper.js +96 -0
- package/lib/server/index.js +58 -0
- package/lib/server/input.js +322 -0
- package/lib/server/instrumentation.js +72 -0
- package/lib/server/javascript.js +291 -0
- package/lib/server/launchApp.js +127 -0
- package/lib/server/localUtils.js +214 -0
- package/lib/server/macEditingCommands.js +143 -0
- package/lib/server/network.js +668 -0
- package/lib/server/page.js +884 -0
- package/lib/server/pipeTransport.js +89 -0
- package/lib/server/playwright.js +69 -0
- package/lib/server/progress.js +136 -0
- package/lib/server/protocolError.js +52 -0
- package/lib/server/recorder/chat.js +161 -0
- package/lib/server/recorder/networkCapture.js +282 -0
- package/lib/server/recorder/recorderApp.js +581 -0
- package/lib/server/recorder/recorderRunner.js +138 -0
- package/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/lib/server/recorder/recorderUtils.js +157 -0
- package/lib/server/recorder/sessionExporter.js +40 -0
- package/lib/server/recorder/sessionPromptBuilder.js +128 -0
- package/lib/server/recorder/sessionRedactor.js +74 -0
- package/lib/server/recorder/throttledFile.js +57 -0
- package/lib/server/recorder.js +538 -0
- package/lib/server/registry/browserFetcher.js +177 -0
- package/lib/server/registry/dependencies.js +371 -0
- package/lib/server/registry/index.js +1395 -0
- package/lib/server/registry/nativeDeps.js +1281 -0
- package/lib/server/registry/oopDownloadBrowserMain.js +127 -0
- package/lib/server/screencast.js +238 -0
- package/lib/server/screenshotter.js +333 -0
- package/lib/server/selectors.js +112 -0
- package/lib/server/socksClientCertificatesInterceptor.js +383 -0
- package/lib/server/socksInterceptor.js +95 -0
- package/lib/server/trace/recorder/snapshotter.js +147 -0
- package/lib/server/trace/recorder/snapshotterInjected.js +561 -0
- package/lib/server/trace/recorder/tracing.js +615 -0
- package/lib/server/trace/viewer/traceViewer.js +244 -0
- package/lib/server/transport.js +181 -0
- package/lib/server/types.js +28 -0
- package/lib/server/usKeyboardLayout.js +152 -0
- package/lib/server/utils/ascii.js +44 -0
- package/lib/server/utils/comparators.js +139 -0
- package/lib/server/utils/crypto.js +216 -0
- package/lib/server/utils/debug.js +42 -0
- package/lib/server/utils/debugLogger.js +122 -0
- package/lib/server/utils/disposable.js +32 -0
- package/lib/server/utils/env.js +73 -0
- package/lib/server/utils/eventsHelper.js +41 -0
- package/lib/server/utils/expectUtils.js +123 -0
- package/lib/server/utils/fileUtils.js +191 -0
- package/lib/server/utils/happyEyeballs.js +207 -0
- package/lib/server/utils/hostPlatform.js +123 -0
- package/lib/server/utils/httpServer.js +205 -0
- package/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/lib/server/utils/image_tools/compare.js +109 -0
- package/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/lib/server/utils/image_tools/stats.js +102 -0
- package/lib/server/utils/linuxUtils.js +71 -0
- package/lib/server/utils/network.js +243 -0
- package/lib/server/utils/nodePlatform.js +154 -0
- package/lib/server/utils/pipeTransport.js +84 -0
- package/lib/server/utils/processLauncher.js +243 -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 +121 -0
- package/lib/server/utils/zipFile.js +74 -0
- package/lib/server/utils/zones.js +57 -0
- package/lib/server/videoRecorder.js +133 -0
- package/lib/server/webkit/protocol.d.js +16 -0
- package/lib/server/webkit/webkit.js +108 -0
- package/lib/server/webkit/wkBrowser.js +331 -0
- package/lib/server/webkit/wkConnection.js +144 -0
- package/lib/server/webkit/wkExecutionContext.js +154 -0
- package/lib/server/webkit/wkInput.js +181 -0
- package/lib/server/webkit/wkInterceptableRequest.js +197 -0
- package/lib/server/webkit/wkPage.js +1164 -0
- package/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/lib/server/webkit/wkWorkers.js +106 -0
- package/lib/serverRegistry.js +147 -0
- package/lib/third_party/pixelmatch.js +255 -0
- package/lib/tools/backend/browserBackend.js +79 -0
- package/lib/tools/backend/common.js +63 -0
- package/lib/tools/backend/config.js +41 -0
- package/lib/tools/backend/console.js +66 -0
- package/lib/tools/backend/context.js +290 -0
- package/lib/tools/backend/cookies.js +152 -0
- package/lib/tools/backend/devtools.js +69 -0
- package/lib/tools/backend/dialogs.js +59 -0
- package/lib/tools/backend/evaluate.js +64 -0
- package/lib/tools/backend/files.js +60 -0
- package/lib/tools/backend/form.js +64 -0
- package/lib/tools/backend/keyboard.js +155 -0
- package/lib/tools/backend/logFile.js +95 -0
- package/lib/tools/backend/mouse.js +168 -0
- package/lib/tools/backend/navigate.js +106 -0
- package/lib/tools/backend/network.js +135 -0
- package/lib/tools/backend/pdf.js +48 -0
- package/lib/tools/backend/recorder.js +74 -0
- package/lib/tools/backend/response.js +302 -0
- package/lib/tools/backend/route.js +140 -0
- package/lib/tools/backend/runCode.js +76 -0
- package/lib/tools/backend/screenshot.js +88 -0
- package/lib/tools/backend/sessionLog.js +74 -0
- package/lib/tools/backend/snapshot.js +208 -0
- package/lib/tools/backend/storage.js +67 -0
- package/lib/tools/backend/tab.js +445 -0
- package/lib/tools/backend/tabs.js +67 -0
- package/lib/tools/backend/tool.js +47 -0
- package/lib/tools/backend/tools.js +104 -0
- package/lib/tools/backend/tracing.js +75 -0
- package/lib/tools/backend/utils.js +83 -0
- package/lib/tools/backend/verify.js +151 -0
- package/lib/tools/backend/video.js +89 -0
- package/lib/tools/backend/wait.js +63 -0
- package/lib/tools/backend/webstorage.js +223 -0
- package/lib/tools/cli-client/cli.js +6 -0
- package/lib/tools/cli-client/help.json +101 -0
- package/lib/tools/cli-client/minimist.js +128 -0
- package/lib/tools/cli-client/program.js +382 -0
- package/lib/tools/cli-client/registry.js +176 -0
- package/lib/tools/cli-client/session.js +289 -0
- package/lib/tools/cli-client/skill/SKILL.md +326 -0
- package/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
- package/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
- package/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
- package/lib/tools/cli-client/skill/references/running-code.md +231 -0
- package/lib/tools/cli-client/skill/references/session-management.md +169 -0
- package/lib/tools/cli-client/skill/references/storage-state.md +275 -0
- package/lib/tools/cli-client/skill/references/test-generation.md +88 -0
- package/lib/tools/cli-client/skill/references/tracing.md +139 -0
- package/lib/tools/cli-client/skill/references/video-recording.md +46 -0
- package/lib/tools/cli-daemon/command.js +73 -0
- package/lib/tools/cli-daemon/commands.js +933 -0
- package/lib/tools/cli-daemon/daemon.js +178 -0
- package/lib/tools/cli-daemon/helpGenerator.js +173 -0
- package/lib/tools/cli-daemon/program.js +118 -0
- package/lib/tools/dashboard/appIcon.png +0 -0
- package/lib/tools/dashboard/dashboardApp.js +286 -0
- package/lib/tools/dashboard/dashboardController.js +296 -0
- package/lib/tools/exports.js +60 -0
- package/lib/tools/mcp/browserFactory.js +233 -0
- package/lib/tools/mcp/cdpRelay.js +353 -0
- package/lib/tools/mcp/cli-stub.js +7 -0
- package/lib/tools/mcp/config.d.js +16 -0
- package/lib/tools/mcp/config.js +401 -0
- package/lib/tools/mcp/configIni.js +189 -0
- package/lib/tools/mcp/extensionContextFactory.js +59 -0
- package/lib/tools/mcp/index.js +62 -0
- package/lib/tools/mcp/log.js +35 -0
- package/lib/tools/mcp/program.js +107 -0
- package/lib/tools/mcp/protocol.js +28 -0
- package/lib/tools/mcp/watchdog.js +44 -0
- package/lib/tools/trace/SKILL.md +163 -0
- package/lib/tools/trace/installSkill.js +48 -0
- package/lib/tools/trace/traceActions.js +142 -0
- package/lib/tools/trace/traceAttachments.js +69 -0
- package/lib/tools/trace/traceCli.js +80 -0
- package/lib/tools/trace/traceConsole.js +97 -0
- package/lib/tools/trace/traceErrors.js +55 -0
- package/lib/tools/trace/traceOpen.js +69 -0
- package/lib/tools/trace/traceParser.js +96 -0
- package/lib/tools/trace/traceRequests.js +158 -0
- package/lib/tools/trace/traceScreenshot.js +68 -0
- package/lib/tools/trace/traceSnapshot.js +149 -0
- package/lib/tools/trace/traceUtils.js +135 -0
- package/lib/tools/utils/connect.js +32 -0
- package/lib/tools/utils/mcp/http.js +152 -0
- package/lib/tools/utils/mcp/server.js +230 -0
- package/lib/tools/utils/mcp/tool.js +47 -0
- package/lib/tools/utils/socketConnection.js +108 -0
- package/lib/utils/isomorphic/ariaSnapshot.js +455 -0
- package/lib/utils/isomorphic/assert.js +31 -0
- package/lib/utils/isomorphic/colors.js +72 -0
- package/lib/utils/isomorphic/cssParser.js +245 -0
- package/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- package/lib/utils/isomorphic/formatUtils.js +64 -0
- package/lib/utils/isomorphic/headers.js +53 -0
- package/lib/utils/isomorphic/imageUtils.js +141 -0
- package/lib/utils/isomorphic/locatorGenerators.js +689 -0
- package/lib/utils/isomorphic/locatorParser.js +176 -0
- package/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/lib/utils/isomorphic/lruCache.js +51 -0
- package/lib/utils/isomorphic/manualPromise.js +114 -0
- package/lib/utils/isomorphic/mimeType.js +464 -0
- package/lib/utils/isomorphic/multimap.js +80 -0
- package/lib/utils/isomorphic/protocolFormatter.js +81 -0
- package/lib/utils/isomorphic/protocolMetainfo.js +347 -0
- package/lib/utils/isomorphic/rtti.js +43 -0
- package/lib/utils/isomorphic/selectorParser.js +386 -0
- package/lib/utils/isomorphic/semaphore.js +54 -0
- package/lib/utils/isomorphic/stackTrace.js +158 -0
- package/lib/utils/isomorphic/stringUtils.js +204 -0
- package/lib/utils/isomorphic/time.js +49 -0
- package/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/lib/utils/isomorphic/trace/entries.js +16 -0
- package/lib/utils/isomorphic/trace/snapshotRenderer.js +492 -0
- package/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
- package/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
- package/lib/utils/isomorphic/trace/traceLoader.js +131 -0
- package/lib/utils/isomorphic/trace/traceModel.js +366 -0
- package/lib/utils/isomorphic/trace/traceModernizer.js +401 -0
- package/lib/utils/isomorphic/trace/traceUtils.js +58 -0
- package/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
- package/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
- package/lib/utils/isomorphic/types.js +16 -0
- package/lib/utils/isomorphic/urlMatch.js +243 -0
- package/lib/utils/isomorphic/utilityScriptSerializers.js +262 -0
- package/lib/utils/isomorphic/yaml.js +84 -0
- package/lib/utils.js +113 -0
- package/lib/utilsBundle.js +91 -0
- package/lib/utilsBundleImpl/index.js +218 -0
- package/lib/utilsBundleImpl/xdg-open +1066 -0
- package/lib/vite/dashboard/assets/index-Bn2lDGZX.js +50 -0
- package/lib/vite/dashboard/assets/index-DDWrEWMc.css +1 -0
- package/lib/vite/dashboard/index.html +28 -0
- package/lib/vite/htmlReport/index.html +89 -0
- package/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
- package/lib/vite/recorder/assets/codeMirrorModule-RoSmqW0t.js +32 -0
- package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/lib/vite/recorder/assets/index-CLrDthbi.js +193 -0
- package/lib/vite/recorder/assets/index-OFPIkgDs.css +1 -0
- package/lib/vite/recorder/index.html +29 -0
- package/lib/vite/recorder/playwright-logo.svg +9 -0
- package/lib/vite/traceViewer/assets/codeMirrorModule-Cigrr2OM.js +32 -0
- package/lib/vite/traceViewer/assets/defaultSettingsView-ConrJv9G.js +262 -0
- package/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- package/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
- package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/lib/vite/traceViewer/defaultSettingsView.B4dS75f0.css +1 -0
- package/lib/vite/traceViewer/index.CzXZzn5A.css +1 -0
- package/lib/vite/traceViewer/index.EVGp-u_4.js +2 -0
- package/lib/vite/traceViewer/index.html +43 -0
- package/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/lib/vite/traceViewer/snapshot.html +21 -0
- package/lib/vite/traceViewer/sw.bundle.js +5 -0
- package/lib/vite/traceViewer/uiMode.Bewj7-uD.js +6 -0
- package/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- package/lib/vite/traceViewer/uiMode.html +17 -0
- package/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- package/lib/zipBundle.js +34 -0
- package/lib/zipBundleImpl.js +5 -0
- package/package.json +46 -0
- package/types/protocol.d.ts +24365 -0
- package/types/structs.d.ts +45 -0
- package/types/types.d.ts +23498 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var traceAttachments_exports = {};
|
|
20
|
+
__export(traceAttachments_exports, {
|
|
21
|
+
traceAttachment: () => traceAttachment,
|
|
22
|
+
traceAttachments: () => traceAttachments
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(traceAttachments_exports);
|
|
25
|
+
var import_traceUtils = require("./traceUtils");
|
|
26
|
+
async function traceAttachments() {
|
|
27
|
+
const trace = await (0, import_traceUtils.loadTrace)();
|
|
28
|
+
if (!trace.model.attachments.length) {
|
|
29
|
+
console.log(" No attachments");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
console.log(` ${"#".padStart(4)} ${"Name".padEnd(40)} ${"Content-Type".padEnd(30)} ${"Action".padEnd(8)}`);
|
|
33
|
+
console.log(` ${"\u2500".repeat(4)} ${"\u2500".repeat(40)} ${"\u2500".repeat(30)} ${"\u2500".repeat(8)}`);
|
|
34
|
+
for (let i = 0; i < trace.model.attachments.length; i++) {
|
|
35
|
+
const a = trace.model.attachments[i];
|
|
36
|
+
const actionOrdinal = trace.callIdToOrdinal.get(a.callId);
|
|
37
|
+
console.log(` ${(i + 1 + ".").padStart(4)} ${a.name.padEnd(40)} ${a.contentType.padEnd(30)} ${(actionOrdinal !== void 0 ? String(actionOrdinal) : a.callId).padEnd(8)}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function traceAttachment(attachmentId, options) {
|
|
41
|
+
const trace = await (0, import_traceUtils.loadTrace)();
|
|
42
|
+
const ordinal = parseInt(attachmentId, 10);
|
|
43
|
+
const attachment = !isNaN(ordinal) && ordinal >= 1 && ordinal <= trace.model.attachments.length ? trace.model.attachments[ordinal - 1] : void 0;
|
|
44
|
+
if (!attachment) {
|
|
45
|
+
console.error(`Attachment '${attachmentId}' not found. Use 'trace attachments' to see available attachments.`);
|
|
46
|
+
process.exitCode = 1;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let content;
|
|
50
|
+
if (attachment.sha1) {
|
|
51
|
+
const blob = await trace.loader.resourceForSha1(attachment.sha1);
|
|
52
|
+
if (blob)
|
|
53
|
+
content = Buffer.from(await blob.arrayBuffer());
|
|
54
|
+
} else if (attachment.base64) {
|
|
55
|
+
content = Buffer.from(attachment.base64, "base64");
|
|
56
|
+
}
|
|
57
|
+
if (!content) {
|
|
58
|
+
console.error(`Could not extract attachment content.`);
|
|
59
|
+
process.exitCode = 1;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const outFile = await (0, import_traceUtils.saveOutputFile)(attachment.name, content, options.output);
|
|
63
|
+
console.log(` Attachment saved to ${outFile}`);
|
|
64
|
+
}
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
traceAttachment,
|
|
68
|
+
traceAttachments
|
|
69
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var traceCli_exports = {};
|
|
20
|
+
__export(traceCli_exports, {
|
|
21
|
+
addTraceCommands: () => addTraceCommands
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(traceCli_exports);
|
|
24
|
+
var import_traceOpen = require("./traceOpen");
|
|
25
|
+
var import_traceActions = require("./traceActions");
|
|
26
|
+
var import_traceRequests = require("./traceRequests");
|
|
27
|
+
var import_traceConsole = require("./traceConsole");
|
|
28
|
+
var import_traceErrors = require("./traceErrors");
|
|
29
|
+
var import_traceSnapshot = require("./traceSnapshot");
|
|
30
|
+
var import_traceScreenshot = require("./traceScreenshot");
|
|
31
|
+
var import_traceAttachments = require("./traceAttachments");
|
|
32
|
+
var import_installSkill = require("./installSkill");
|
|
33
|
+
function addTraceCommands(program, logErrorAndExit) {
|
|
34
|
+
const traceCommand = program.command("trace").description("inspect trace files from the command line");
|
|
35
|
+
traceCommand.command("open <trace>").description("extract trace file for inspection").action((trace) => {
|
|
36
|
+
(0, import_traceOpen.traceOpen)(trace).catch(logErrorAndExit);
|
|
37
|
+
});
|
|
38
|
+
traceCommand.command("actions").description("list actions in the trace").option("--grep <pattern>", "filter actions by title pattern").option("--errors-only", "only show failed actions").action((options) => {
|
|
39
|
+
(0, import_traceActions.traceActions)(options).catch(logErrorAndExit);
|
|
40
|
+
});
|
|
41
|
+
traceCommand.command("action <action-id>").description("show details of a specific action").action((actionId) => {
|
|
42
|
+
(0, import_traceActions.traceAction)(actionId).catch(logErrorAndExit);
|
|
43
|
+
});
|
|
44
|
+
traceCommand.command("requests").description("show network requests").option("--grep <pattern>", "filter by URL pattern").option("--method <method>", "filter by HTTP method").option("--status <code>", "filter by status code").option("--failed", "only show failed requests (status >= 400)").action((options) => {
|
|
45
|
+
(0, import_traceRequests.traceRequests)(options).catch(logErrorAndExit);
|
|
46
|
+
});
|
|
47
|
+
traceCommand.command("request <request-id>").description("show details of a specific network request").action((requestId) => {
|
|
48
|
+
(0, import_traceRequests.traceRequest)(requestId).catch(logErrorAndExit);
|
|
49
|
+
});
|
|
50
|
+
traceCommand.command("console").description("show console messages").option("--errors-only", "only show errors").option("--warnings", "show errors and warnings").option("--browser", "only browser console messages").option("--stdio", "only stdout/stderr").action((options) => {
|
|
51
|
+
(0, import_traceConsole.traceConsole)(options).catch(logErrorAndExit);
|
|
52
|
+
});
|
|
53
|
+
traceCommand.command("errors").description("show errors with stack traces").action(() => {
|
|
54
|
+
(0, import_traceErrors.traceErrors)().catch(logErrorAndExit);
|
|
55
|
+
});
|
|
56
|
+
traceCommand.command("snapshot <action-id>").description("run a playwright-cli command against a DOM snapshot").option("--name <name>", "snapshot phase: before, input, or after").option("--serve", "serve snapshot on localhost and keep running").allowUnknownOption(true).allowExcessArguments(true).action(async (actionId, options, cmd) => {
|
|
57
|
+
try {
|
|
58
|
+
const browserArgs = cmd.args.slice(1);
|
|
59
|
+
await (0, import_traceSnapshot.traceSnapshot)(actionId, { ...options, browserArgs });
|
|
60
|
+
} catch (e) {
|
|
61
|
+
logErrorAndExit(e);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
traceCommand.command("screenshot <action-id>").description("save screencast screenshot for an action").option("-o, --output <path>", "output file path").action((actionId, options) => {
|
|
65
|
+
(0, import_traceScreenshot.traceScreenshot)(actionId, options).catch(logErrorAndExit);
|
|
66
|
+
});
|
|
67
|
+
traceCommand.command("attachments").description("list trace attachments").action(() => {
|
|
68
|
+
(0, import_traceAttachments.traceAttachments)().catch(logErrorAndExit);
|
|
69
|
+
});
|
|
70
|
+
traceCommand.command("attachment <attachment-id>").description("extract a trace attachment by its number").option("-o, --output <path>", "output file path").action((attachmentId, options) => {
|
|
71
|
+
(0, import_traceAttachments.traceAttachment)(attachmentId, options).catch(logErrorAndExit);
|
|
72
|
+
});
|
|
73
|
+
traceCommand.command("install-skill").description("install SKILL.md for LLM integration").action(() => {
|
|
74
|
+
(0, import_installSkill.installSkill)().catch(logErrorAndExit);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
+
0 && (module.exports = {
|
|
79
|
+
addTraceCommands
|
|
80
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var traceConsole_exports = {};
|
|
20
|
+
__export(traceConsole_exports, {
|
|
21
|
+
traceConsole: () => traceConsole
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(traceConsole_exports);
|
|
24
|
+
var import_traceUtils = require("./traceUtils");
|
|
25
|
+
async function traceConsole(options) {
|
|
26
|
+
const trace = await (0, import_traceUtils.loadTrace)();
|
|
27
|
+
const model = trace.model;
|
|
28
|
+
const items = [];
|
|
29
|
+
for (const event of model.events) {
|
|
30
|
+
if (event.type === "console") {
|
|
31
|
+
if (options.stdio)
|
|
32
|
+
continue;
|
|
33
|
+
const level = event.messageType;
|
|
34
|
+
if (options.errorsOnly && level !== "error")
|
|
35
|
+
continue;
|
|
36
|
+
if (options.warnings && level !== "error" && level !== "warning")
|
|
37
|
+
continue;
|
|
38
|
+
const url = event.location.url;
|
|
39
|
+
const filename = url ? url.substring(url.lastIndexOf("/") + 1) : "<anonymous>";
|
|
40
|
+
items.push({
|
|
41
|
+
type: "browser",
|
|
42
|
+
level,
|
|
43
|
+
text: event.text,
|
|
44
|
+
location: `${filename}:${event.location.lineNumber}`,
|
|
45
|
+
timestamp: event.time
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (event.type === "event" && event.method === "pageError") {
|
|
49
|
+
if (options.stdio)
|
|
50
|
+
continue;
|
|
51
|
+
const error = event.params.error;
|
|
52
|
+
items.push({
|
|
53
|
+
type: "browser",
|
|
54
|
+
level: "error",
|
|
55
|
+
text: error?.error?.message || String(error?.value || ""),
|
|
56
|
+
timestamp: event.time
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for (const event of model.stdio) {
|
|
61
|
+
if (options.browser)
|
|
62
|
+
continue;
|
|
63
|
+
if (options.errorsOnly && event.type !== "stderr")
|
|
64
|
+
continue;
|
|
65
|
+
if (options.warnings && event.type !== "stderr")
|
|
66
|
+
continue;
|
|
67
|
+
let text = "";
|
|
68
|
+
if (event.text)
|
|
69
|
+
text = event.text.trim();
|
|
70
|
+
if (event.base64)
|
|
71
|
+
text = Buffer.from(event.base64, "base64").toString("utf-8").trim();
|
|
72
|
+
if (!text)
|
|
73
|
+
continue;
|
|
74
|
+
items.push({
|
|
75
|
+
type: event.type,
|
|
76
|
+
level: event.type === "stderr" ? "error" : "info",
|
|
77
|
+
text,
|
|
78
|
+
timestamp: event.timestamp
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
items.sort((a, b) => a.timestamp - b.timestamp);
|
|
82
|
+
if (!items.length) {
|
|
83
|
+
console.log(" No console entries");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
for (const item of items) {
|
|
87
|
+
const ts = (0, import_traceUtils.formatTimestamp)(item.timestamp, model.startTime);
|
|
88
|
+
const source = item.type === "browser" ? "[browser]" : `[${item.type}]`;
|
|
89
|
+
const level = item.level.padEnd(8);
|
|
90
|
+
const location = item.location ? ` ${item.location}` : "";
|
|
91
|
+
console.log(` ${ts} ${source.padEnd(10)} ${level} ${item.text}${location}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
traceConsole
|
|
97
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var traceErrors_exports = {};
|
|
20
|
+
__export(traceErrors_exports, {
|
|
21
|
+
traceErrors: () => traceErrors
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(traceErrors_exports);
|
|
24
|
+
var import_traceUtils = require("./traceUtils");
|
|
25
|
+
async function traceErrors() {
|
|
26
|
+
const trace = await (0, import_traceUtils.loadTrace)();
|
|
27
|
+
const model = trace.model;
|
|
28
|
+
if (!model.errorDescriptors.length) {
|
|
29
|
+
console.log(" No errors");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (const error of model.errorDescriptors) {
|
|
33
|
+
if (error.action) {
|
|
34
|
+
const title = (0, import_traceUtils.actionTitle)(error.action);
|
|
35
|
+
console.log(`
|
|
36
|
+
\u2717 ${title}`);
|
|
37
|
+
} else {
|
|
38
|
+
console.log(`
|
|
39
|
+
\u2717 Error`);
|
|
40
|
+
}
|
|
41
|
+
if (error.stack?.length) {
|
|
42
|
+
const frame = error.stack[0];
|
|
43
|
+
const file = frame.file.replace(/.*[/\\](.*)/, "$1");
|
|
44
|
+
console.log(` at ${file}:${frame.line}:${frame.column}`);
|
|
45
|
+
}
|
|
46
|
+
console.log("");
|
|
47
|
+
const indented = error.message.split("\n").map((l) => ` ${l}`).join("\n");
|
|
48
|
+
console.log(indented);
|
|
49
|
+
}
|
|
50
|
+
console.log("");
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
traceErrors
|
|
55
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var traceOpen_exports = {};
|
|
20
|
+
__export(traceOpen_exports, {
|
|
21
|
+
traceOpen: () => traceOpen
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(traceOpen_exports);
|
|
24
|
+
var import_traceUtils = require("./traceUtils");
|
|
25
|
+
var import_formatUtils = require("../../utils/isomorphic/formatUtils");
|
|
26
|
+
async function traceOpen(traceFile) {
|
|
27
|
+
await (0, import_traceUtils.openTrace)(traceFile);
|
|
28
|
+
await traceInfo();
|
|
29
|
+
}
|
|
30
|
+
async function traceInfo() {
|
|
31
|
+
const trace = await (0, import_traceUtils.loadTrace)();
|
|
32
|
+
const model = trace.model;
|
|
33
|
+
const info = {
|
|
34
|
+
browser: model.browserName || "unknown",
|
|
35
|
+
platform: model.platform || "unknown",
|
|
36
|
+
playwrightVersion: model.playwrightVersion || "unknown",
|
|
37
|
+
title: model.title || "",
|
|
38
|
+
duration: (0, import_formatUtils.msToString)(model.endTime - model.startTime),
|
|
39
|
+
durationMs: model.endTime - model.startTime,
|
|
40
|
+
startTime: model.wallTime ? new Date(model.wallTime).toISOString() : "unknown",
|
|
41
|
+
viewport: model.options.viewport ? `${model.options.viewport.width}x${model.options.viewport.height}` : "default",
|
|
42
|
+
actions: model.actions.length,
|
|
43
|
+
pages: model.pages.length,
|
|
44
|
+
network: model.resources.length,
|
|
45
|
+
errors: model.errorDescriptors.length,
|
|
46
|
+
attachments: model.attachments.length,
|
|
47
|
+
consoleMessages: model.events.filter((e) => e.type === "console").length
|
|
48
|
+
};
|
|
49
|
+
console.log("");
|
|
50
|
+
console.log(` Browser: ${info.browser}`);
|
|
51
|
+
console.log(` Platform: ${info.platform}`);
|
|
52
|
+
console.log(` Playwright: ${info.playwrightVersion}`);
|
|
53
|
+
if (info.title)
|
|
54
|
+
console.log(` Title: ${info.title}`);
|
|
55
|
+
console.log(` Duration: ${info.duration}`);
|
|
56
|
+
console.log(` Start time: ${info.startTime}`);
|
|
57
|
+
console.log(` Viewport: ${info.viewport}`);
|
|
58
|
+
console.log(` Actions: ${info.actions}`);
|
|
59
|
+
console.log(` Pages: ${info.pages}`);
|
|
60
|
+
console.log(` Network: ${info.network} requests`);
|
|
61
|
+
console.log(` Errors: ${info.errors}`);
|
|
62
|
+
console.log(` Attachments: ${info.attachments}`);
|
|
63
|
+
console.log(` Console: ${info.consoleMessages} messages`);
|
|
64
|
+
console.log("");
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
traceOpen
|
|
69
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
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 });
|
|
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 traceParser_exports = {};
|
|
30
|
+
__export(traceParser_exports, {
|
|
31
|
+
DirTraceLoaderBackend: () => DirTraceLoaderBackend,
|
|
32
|
+
extractTrace: () => extractTrace
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(traceParser_exports);
|
|
35
|
+
var import_fs = __toESM(require("fs"));
|
|
36
|
+
var import_path = __toESM(require("path"));
|
|
37
|
+
var import_zipFile = require("../../server/utils/zipFile");
|
|
38
|
+
class DirTraceLoaderBackend {
|
|
39
|
+
constructor(dir) {
|
|
40
|
+
this._dir = dir;
|
|
41
|
+
}
|
|
42
|
+
isLive() {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
async entryNames() {
|
|
46
|
+
const entries = [];
|
|
47
|
+
const walk = async (dir, prefix) => {
|
|
48
|
+
const items = await import_fs.default.promises.readdir(dir, { withFileTypes: true });
|
|
49
|
+
for (const item of items) {
|
|
50
|
+
if (item.isDirectory())
|
|
51
|
+
await walk(import_path.default.join(dir, item.name), prefix ? `${prefix}/${item.name}` : item.name);
|
|
52
|
+
else
|
|
53
|
+
entries.push(prefix ? `${prefix}/${item.name}` : item.name);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
await walk(this._dir, "");
|
|
57
|
+
return entries;
|
|
58
|
+
}
|
|
59
|
+
async hasEntry(entryName) {
|
|
60
|
+
try {
|
|
61
|
+
await import_fs.default.promises.access(import_path.default.join(this._dir, entryName));
|
|
62
|
+
return true;
|
|
63
|
+
} catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async readText(entryName) {
|
|
68
|
+
try {
|
|
69
|
+
return await import_fs.default.promises.readFile(import_path.default.join(this._dir, entryName), "utf-8");
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async readBlob(entryName) {
|
|
74
|
+
try {
|
|
75
|
+
const buffer = await import_fs.default.promises.readFile(import_path.default.join(this._dir, entryName));
|
|
76
|
+
return new Blob([new Uint8Array(buffer)]);
|
|
77
|
+
} catch {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function extractTrace(traceFile, outDir) {
|
|
82
|
+
const zipFile = new import_zipFile.ZipFile(traceFile);
|
|
83
|
+
const entries = await zipFile.entries();
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
const outPath = import_path.default.join(outDir, entry);
|
|
86
|
+
await import_fs.default.promises.mkdir(import_path.default.dirname(outPath), { recursive: true });
|
|
87
|
+
const buffer = await zipFile.read(entry);
|
|
88
|
+
await import_fs.default.promises.writeFile(outPath, buffer);
|
|
89
|
+
}
|
|
90
|
+
zipFile.close();
|
|
91
|
+
}
|
|
92
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
+
0 && (module.exports = {
|
|
94
|
+
DirTraceLoaderBackend,
|
|
95
|
+
extractTrace
|
|
96
|
+
});
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var traceRequests_exports = {};
|
|
20
|
+
__export(traceRequests_exports, {
|
|
21
|
+
traceRequest: () => traceRequest,
|
|
22
|
+
traceRequests: () => traceRequests
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(traceRequests_exports);
|
|
25
|
+
var import_traceUtils = require("./traceUtils");
|
|
26
|
+
var import_formatUtils = require("../../utils/isomorphic/formatUtils");
|
|
27
|
+
async function traceRequests(options) {
|
|
28
|
+
const trace = await (0, import_traceUtils.loadTrace)();
|
|
29
|
+
const model = trace.model;
|
|
30
|
+
let indexed = model.resources.map((r, i) => ({ resource: r, ordinal: i + 1 }));
|
|
31
|
+
if (options.grep) {
|
|
32
|
+
const pattern = new RegExp(options.grep, "i");
|
|
33
|
+
indexed = indexed.filter(({ resource: r }) => pattern.test(r.request.url));
|
|
34
|
+
}
|
|
35
|
+
if (options.method)
|
|
36
|
+
indexed = indexed.filter(({ resource: r }) => r.request.method.toLowerCase() === options.method.toLowerCase());
|
|
37
|
+
if (options.status) {
|
|
38
|
+
const code = parseInt(options.status, 10);
|
|
39
|
+
indexed = indexed.filter(({ resource: r }) => r.response.status === code);
|
|
40
|
+
}
|
|
41
|
+
if (options.failed)
|
|
42
|
+
indexed = indexed.filter(({ resource: r }) => r.response.status >= 400 || r.response.status === -1);
|
|
43
|
+
if (!indexed.length) {
|
|
44
|
+
console.log(" No network requests");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
console.log(` ${"#".padStart(4)} ${"Method".padEnd(8)} ${"Status".padEnd(8)} ${"Name".padEnd(45)} ${"Duration".padStart(10)} ${"Size".padStart(8)} ${"Route".padEnd(10)}`);
|
|
48
|
+
console.log(` ${"\u2500".repeat(4)} ${"\u2500".repeat(8)} ${"\u2500".repeat(8)} ${"\u2500".repeat(45)} ${"\u2500".repeat(10)} ${"\u2500".repeat(8)} ${"\u2500".repeat(10)}`);
|
|
49
|
+
for (const { resource: r, ordinal } of indexed) {
|
|
50
|
+
let name;
|
|
51
|
+
try {
|
|
52
|
+
const url = new URL(r.request.url);
|
|
53
|
+
name = url.pathname.substring(url.pathname.lastIndexOf("/") + 1);
|
|
54
|
+
if (!name)
|
|
55
|
+
name = url.host;
|
|
56
|
+
if (url.search)
|
|
57
|
+
name += url.search;
|
|
58
|
+
} catch {
|
|
59
|
+
name = r.request.url;
|
|
60
|
+
}
|
|
61
|
+
if (name.length > 45)
|
|
62
|
+
name = name.substring(0, 42) + "...";
|
|
63
|
+
const status = r.response.status > 0 ? String(r.response.status) : "ERR";
|
|
64
|
+
const size = r.response._transferSize > 0 ? r.response._transferSize : r.response.bodySize;
|
|
65
|
+
const route = formatRouteStatus(r);
|
|
66
|
+
console.log(` ${(ordinal + ".").padStart(4)} ${r.request.method.padEnd(8)} ${status.padEnd(8)} ${name.padEnd(45)} ${(0, import_formatUtils.msToString)(r.time).padStart(10)} ${bytesToString(size).padStart(8)} ${route.padEnd(10)}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function traceRequest(requestId) {
|
|
70
|
+
const trace = await (0, import_traceUtils.loadTrace)();
|
|
71
|
+
const model = trace.model;
|
|
72
|
+
const ordinal = parseInt(requestId, 10);
|
|
73
|
+
const resource = !isNaN(ordinal) && ordinal >= 1 && ordinal <= model.resources.length ? model.resources[ordinal - 1] : void 0;
|
|
74
|
+
if (!resource) {
|
|
75
|
+
console.error(`Request '${requestId}' not found. Use 'trace requests' to see available request IDs.`);
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const r = resource;
|
|
80
|
+
const status = r.response.status > 0 ? `${r.response.status} ${r.response.statusText}` : "ERR";
|
|
81
|
+
const size = r.response._transferSize > 0 ? r.response._transferSize : r.response.bodySize;
|
|
82
|
+
console.log(`
|
|
83
|
+
${r.request.method} ${r.request.url}
|
|
84
|
+
`);
|
|
85
|
+
console.log(" General");
|
|
86
|
+
console.log(` status: ${status}`);
|
|
87
|
+
console.log(` duration: ${(0, import_formatUtils.msToString)(r.time)}`);
|
|
88
|
+
console.log(` size: ${bytesToString(size)}`);
|
|
89
|
+
if (r.response.content.mimeType)
|
|
90
|
+
console.log(` type: ${r.response.content.mimeType}`);
|
|
91
|
+
const route = formatRouteStatus(r);
|
|
92
|
+
if (route)
|
|
93
|
+
console.log(` route: ${route}`);
|
|
94
|
+
if (r.serverIPAddress)
|
|
95
|
+
console.log(` server: ${r.serverIPAddress}${r._serverPort ? ":" + r._serverPort : ""}`);
|
|
96
|
+
if (r.response._failureText)
|
|
97
|
+
console.log(` error: ${r.response._failureText}`);
|
|
98
|
+
if (r.request.headers.length) {
|
|
99
|
+
console.log("\n Request headers");
|
|
100
|
+
for (const h of r.request.headers)
|
|
101
|
+
console.log(` ${h.name}: ${h.value}`);
|
|
102
|
+
}
|
|
103
|
+
if (r.request.postData) {
|
|
104
|
+
console.log("\n Request body");
|
|
105
|
+
console.log(` type: ${r.request.postData.mimeType}`);
|
|
106
|
+
if (r.request.postData.text) {
|
|
107
|
+
const text = r.request.postData.text.length > 2e3 ? r.request.postData.text.substring(0, 2e3) + "..." : r.request.postData.text;
|
|
108
|
+
console.log(` ${text}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (r.response.headers.length) {
|
|
112
|
+
console.log("\n Response headers");
|
|
113
|
+
for (const h of r.response.headers)
|
|
114
|
+
console.log(` ${h.name}: ${h.value}`);
|
|
115
|
+
}
|
|
116
|
+
if (r._securityDetails) {
|
|
117
|
+
console.log("\n Security");
|
|
118
|
+
if (r._securityDetails.protocol)
|
|
119
|
+
console.log(` protocol: ${r._securityDetails.protocol}`);
|
|
120
|
+
if (r._securityDetails.subjectName)
|
|
121
|
+
console.log(` subject: ${r._securityDetails.subjectName}`);
|
|
122
|
+
if (r._securityDetails.issuer)
|
|
123
|
+
console.log(` issuer: ${r._securityDetails.issuer}`);
|
|
124
|
+
}
|
|
125
|
+
console.log("");
|
|
126
|
+
}
|
|
127
|
+
function bytesToString(bytes) {
|
|
128
|
+
if (bytes < 0 || !isFinite(bytes))
|
|
129
|
+
return "-";
|
|
130
|
+
if (bytes === 0)
|
|
131
|
+
return "0";
|
|
132
|
+
if (bytes < 1e3)
|
|
133
|
+
return bytes.toFixed(0);
|
|
134
|
+
const kb = bytes / 1024;
|
|
135
|
+
if (kb < 1e3)
|
|
136
|
+
return kb.toFixed(1) + "K";
|
|
137
|
+
const mb = kb / 1024;
|
|
138
|
+
if (mb < 1e3)
|
|
139
|
+
return mb.toFixed(1) + "M";
|
|
140
|
+
const gb = mb / 1024;
|
|
141
|
+
return gb.toFixed(1) + "G";
|
|
142
|
+
}
|
|
143
|
+
function formatRouteStatus(r) {
|
|
144
|
+
if (r._wasAborted)
|
|
145
|
+
return "aborted";
|
|
146
|
+
if (r._wasContinued)
|
|
147
|
+
return "continued";
|
|
148
|
+
if (r._wasFulfilled)
|
|
149
|
+
return "fulfilled";
|
|
150
|
+
if (r._apiRequest)
|
|
151
|
+
return "api";
|
|
152
|
+
return "";
|
|
153
|
+
}
|
|
154
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
155
|
+
0 && (module.exports = {
|
|
156
|
+
traceRequest,
|
|
157
|
+
traceRequests
|
|
158
|
+
});
|