@browsermation/browser-engine 0.0.12 → 0.0.16
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/dist/node_modules/playwright/LICENSE +202 -0
- package/dist/node_modules/playwright/NOTICE +5 -0
- package/dist/node_modules/playwright/README.md +168 -0
- package/dist/node_modules/playwright/ThirdPartyNotices.txt +6197 -0
- package/dist/node_modules/playwright/cli.js +19 -0
- package/dist/node_modules/playwright/index.d.ts +17 -0
- package/dist/node_modules/playwright/index.js +17 -0
- package/dist/node_modules/playwright/index.mjs +18 -0
- package/dist/node_modules/playwright/jsx-runtime.js +42 -0
- package/dist/node_modules/playwright/jsx-runtime.mjs +21 -0
- package/dist/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- package/dist/node_modules/playwright/lib/agents/generateAgents.js +395 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +55 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +72 -0
- package/dist/node_modules/playwright/lib/common/config.js +280 -0
- package/dist/node_modules/playwright/lib/common/configLoader.js +344 -0
- package/dist/node_modules/playwright/lib/common/esmLoaderHost.js +102 -0
- package/dist/node_modules/playwright/lib/common/expectBundle.js +43 -0
- package/dist/node_modules/playwright/lib/common/expectBundleImpl.js +407 -0
- package/dist/node_modules/playwright/lib/common/fixtures.js +302 -0
- package/dist/node_modules/playwright/lib/common/globals.js +58 -0
- package/dist/node_modules/playwright/lib/common/ipc.js +60 -0
- package/dist/node_modules/playwright/lib/common/poolBuilder.js +85 -0
- package/dist/node_modules/playwright/lib/common/process.js +104 -0
- package/dist/node_modules/playwright/lib/common/suiteUtils.js +140 -0
- package/dist/node_modules/playwright/lib/common/test.js +321 -0
- package/dist/node_modules/playwright/lib/common/testLoader.js +101 -0
- package/dist/node_modules/playwright/lib/common/testType.js +298 -0
- package/dist/node_modules/playwright/lib/common/validators.js +68 -0
- package/dist/node_modules/playwright/lib/fsWatcher.js +67 -0
- package/dist/node_modules/playwright/lib/index.js +682 -0
- package/dist/node_modules/playwright/lib/internalsForTest.js +42 -0
- package/dist/node_modules/playwright/lib/isomorphic/events.js +77 -0
- package/dist/node_modules/playwright/lib/isomorphic/folders.js +30 -0
- package/dist/node_modules/playwright/lib/isomorphic/stringInternPool.js +69 -0
- package/dist/node_modules/playwright/lib/isomorphic/teleReceiver.js +508 -0
- package/dist/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +137 -0
- package/dist/node_modules/playwright/lib/isomorphic/testServerConnection.js +225 -0
- package/dist/node_modules/playwright/lib/isomorphic/testServerInterface.js +16 -0
- package/dist/node_modules/playwright/lib/isomorphic/testTree.js +334 -0
- package/dist/node_modules/playwright/lib/isomorphic/types.d.js +16 -0
- package/dist/node_modules/playwright/lib/loader/loaderMain.js +59 -0
- package/dist/node_modules/playwright/lib/matchers/expect.js +324 -0
- package/dist/node_modules/playwright/lib/matchers/matcherHint.js +87 -0
- package/dist/node_modules/playwright/lib/matchers/matchers.js +382 -0
- package/dist/node_modules/playwright/lib/matchers/toBeTruthy.js +73 -0
- package/dist/node_modules/playwright/lib/matchers/toEqual.js +99 -0
- package/dist/node_modules/playwright/lib/matchers/toHaveURL.js +102 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +159 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchSnapshot.js +341 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchText.js +99 -0
- package/dist/node_modules/playwright/lib/mcp/browser/actions.d.js +16 -0
- package/dist/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +296 -0
- package/dist/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +76 -0
- package/dist/node_modules/playwright/lib/mcp/browser/codegen.js +66 -0
- package/dist/node_modules/playwright/lib/mcp/browser/config.js +368 -0
- package/dist/node_modules/playwright/lib/mcp/browser/context.js +267 -0
- package/dist/node_modules/playwright/lib/mcp/browser/response.js +237 -0
- package/dist/node_modules/playwright/lib/mcp/browser/sessionLog.js +160 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tab.js +292 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/common.js +63 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/console.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +60 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +69 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/files.js +58 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/form.js +73 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/install.js +69 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +84 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/mouse.js +107 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/navigate.js +62 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/network.js +54 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/pdf.js +59 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/runCode.js +75 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +106 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +181 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tabs.js +67 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tool.js +49 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tracing.js +74 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/utils.js +89 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/verify.js +153 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/wait.js +63 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools.js +82 -0
- package/dist/node_modules/playwright/lib/mcp/browser/watchdog.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/config.d.js +16 -0
- package/dist/node_modules/playwright/lib/mcp/extension/cdpRelay.js +351 -0
- package/dist/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +75 -0
- package/dist/node_modules/playwright/lib/mcp/extension/protocol.js +28 -0
- package/dist/node_modules/playwright/lib/mcp/index.js +61 -0
- package/dist/node_modules/playwright/lib/mcp/log.js +35 -0
- package/dist/node_modules/playwright/lib/mcp/program.js +116 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/bundle.js +81 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/exports.js +30 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/http.js +187 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +71 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/proxyBackend.js +128 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/server.js +198 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/tool.js +47 -0
- package/dist/node_modules/playwright/lib/mcp/test/browserBackend.js +108 -0
- package/dist/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- package/dist/node_modules/playwright/lib/mcp/test/plannerTools.js +144 -0
- package/dist/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- package/dist/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- package/dist/node_modules/playwright/lib/mcp/test/testContext.js +279 -0
- package/dist/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- package/dist/node_modules/playwright/lib/mcp/test/testTools.js +106 -0
- package/dist/node_modules/playwright/lib/mcpBundleImpl.js +41 -0
- package/dist/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +198 -0
- package/dist/node_modules/playwright/lib/plugins/index.js +28 -0
- package/dist/node_modules/playwright/lib/plugins/webServerPlugin.js +237 -0
- package/dist/node_modules/playwright/lib/program.js +403 -0
- package/dist/node_modules/playwright/lib/reporters/base.js +609 -0
- package/dist/node_modules/playwright/lib/reporters/blob.js +135 -0
- package/dist/node_modules/playwright/lib/reporters/dot.js +82 -0
- package/dist/node_modules/playwright/lib/reporters/empty.js +32 -0
- package/dist/node_modules/playwright/lib/reporters/github.js +128 -0
- package/dist/node_modules/playwright/lib/reporters/html.js +623 -0
- package/dist/node_modules/playwright/lib/reporters/internalReporter.js +132 -0
- package/dist/node_modules/playwright/lib/reporters/json.js +254 -0
- package/dist/node_modules/playwright/lib/reporters/junit.js +232 -0
- package/dist/node_modules/playwright/lib/reporters/line.js +113 -0
- package/dist/node_modules/playwright/lib/reporters/list.js +231 -0
- package/dist/node_modules/playwright/lib/reporters/listModeReporter.js +69 -0
- package/dist/node_modules/playwright/lib/reporters/markdown.js +144 -0
- package/dist/node_modules/playwright/lib/reporters/merge.js +541 -0
- package/dist/node_modules/playwright/lib/reporters/multiplexer.js +104 -0
- package/dist/node_modules/playwright/lib/reporters/reporterV2.js +102 -0
- package/dist/node_modules/playwright/lib/reporters/teleEmitter.js +299 -0
- package/dist/node_modules/playwright/lib/reporters/versions/blobV1.js +16 -0
- package/dist/node_modules/playwright/lib/runner/dispatcher.js +515 -0
- package/dist/node_modules/playwright/lib/runner/failureTracker.js +72 -0
- package/dist/node_modules/playwright/lib/runner/lastRun.js +77 -0
- package/dist/node_modules/playwright/lib/runner/loadUtils.js +334 -0
- package/dist/node_modules/playwright/lib/runner/loaderHost.js +89 -0
- package/dist/node_modules/playwright/lib/runner/processHost.js +161 -0
- package/dist/node_modules/playwright/lib/runner/projectUtils.js +241 -0
- package/dist/node_modules/playwright/lib/runner/rebase.js +189 -0
- package/dist/node_modules/playwright/lib/runner/reporters.js +138 -0
- package/dist/node_modules/playwright/lib/runner/sigIntWatcher.js +96 -0
- package/dist/node_modules/playwright/lib/runner/taskRunner.js +127 -0
- package/dist/node_modules/playwright/lib/runner/tasks.js +410 -0
- package/dist/node_modules/playwright/lib/runner/testGroups.js +117 -0
- package/dist/node_modules/playwright/lib/runner/testRunner.js +389 -0
- package/dist/node_modules/playwright/lib/runner/testServer.js +269 -0
- package/dist/node_modules/playwright/lib/runner/uiModeReporter.js +30 -0
- package/dist/node_modules/playwright/lib/runner/vcs.js +72 -0
- package/dist/node_modules/playwright/lib/runner/watchMode.js +395 -0
- package/dist/node_modules/playwright/lib/runner/workerHost.js +98 -0
- package/dist/node_modules/playwright/lib/third_party/pirates.js +62 -0
- package/dist/node_modules/playwright/lib/third_party/tsconfig-loader.js +103 -0
- package/dist/node_modules/playwright/lib/transform/babelBundle.js +43 -0
- package/dist/node_modules/playwright/lib/transform/babelBundleImpl.js +461 -0
- package/dist/node_modules/playwright/lib/transform/compilationCache.js +272 -0
- package/dist/node_modules/playwright/lib/transform/esmLoader.js +104 -0
- package/dist/node_modules/playwright/lib/transform/portTransport.js +67 -0
- package/dist/node_modules/playwright/lib/transform/transform.js +293 -0
- package/dist/node_modules/playwright/lib/util.js +403 -0
- package/dist/node_modules/playwright/lib/utilsBundle.js +43 -0
- package/dist/node_modules/playwright/lib/utilsBundleImpl.js +100 -0
- package/dist/node_modules/playwright/lib/worker/fixtureRunner.js +258 -0
- package/dist/node_modules/playwright/lib/worker/testInfo.js +516 -0
- package/dist/node_modules/playwright/lib/worker/testTracing.js +345 -0
- package/dist/node_modules/playwright/lib/worker/timeoutManager.js +174 -0
- package/dist/node_modules/playwright/lib/worker/util.js +31 -0
- package/dist/node_modules/playwright/lib/worker/workerMain.js +529 -0
- package/dist/node_modules/playwright/package.json +72 -0
- package/dist/node_modules/playwright/test.d.ts +18 -0
- package/dist/node_modules/playwright/test.js +24 -0
- package/dist/node_modules/playwright/test.mjs +33 -0
- package/dist/node_modules/playwright/types/test.d.ts +10253 -0
- package/dist/node_modules/playwright/types/testReporter.d.ts +821 -0
- package/dist/node_modules/playwright-core/LICENSE +202 -0
- package/dist/node_modules/playwright-core/NOTICE +5 -0
- package/dist/node_modules/playwright-core/README.md +3 -0
- package/dist/node_modules/playwright-core/ThirdPartyNotices.txt +1161 -0
- package/dist/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/dist/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/browsers.json +80 -0
- package/dist/node_modules/playwright-core/cli.js +18 -0
- package/dist/node_modules/playwright-core/index.d.ts +17 -0
- package/dist/node_modules/playwright-core/index.js +32 -0
- package/dist/node_modules/playwright-core/index.mjs +28 -0
- package/dist/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
- package/dist/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
- package/dist/node_modules/playwright-core/lib/cli/driver.js +97 -0
- package/dist/node_modules/playwright-core/lib/cli/program.js +590 -0
- package/dist/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
- package/dist/node_modules/playwright-core/lib/client/android.js +361 -0
- package/dist/node_modules/playwright-core/lib/client/api.js +134 -0
- package/dist/node_modules/playwright-core/lib/client/artifact.js +79 -0
- package/dist/node_modules/playwright-core/lib/client/browser.js +163 -0
- package/dist/node_modules/playwright-core/lib/client/browserContext.js +547 -0
- package/dist/node_modules/playwright-core/lib/client/browserType.js +184 -0
- package/dist/node_modules/playwright-core/lib/client/cdpSession.js +51 -0
- package/dist/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
- package/dist/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
- package/dist/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
- package/dist/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
- package/dist/node_modules/playwright-core/lib/client/clock.js +68 -0
- package/dist/node_modules/playwright-core/lib/client/connection.js +314 -0
- package/dist/node_modules/playwright-core/lib/client/consoleMessage.js +58 -0
- package/dist/node_modules/playwright-core/lib/client/coverage.js +44 -0
- package/dist/node_modules/playwright-core/lib/client/dialog.js +56 -0
- package/dist/node_modules/playwright-core/lib/client/download.js +62 -0
- package/dist/node_modules/playwright-core/lib/client/electron.js +138 -0
- package/dist/node_modules/playwright-core/lib/client/elementHandle.js +281 -0
- package/dist/node_modules/playwright-core/lib/client/errors.js +77 -0
- package/dist/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
- package/dist/node_modules/playwright-core/lib/client/events.js +100 -0
- package/dist/node_modules/playwright-core/lib/client/fetch.js +369 -0
- package/dist/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
- package/dist/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
- package/dist/node_modules/playwright-core/lib/client/frame.js +408 -0
- package/dist/node_modules/playwright-core/lib/client/harRouter.js +87 -0
- package/dist/node_modules/playwright-core/lib/client/input.js +84 -0
- package/dist/node_modules/playwright-core/lib/client/jsHandle.js +109 -0
- package/dist/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/localUtils.js +60 -0
- package/dist/node_modules/playwright-core/lib/client/locator.js +369 -0
- package/dist/node_modules/playwright-core/lib/client/network.js +747 -0
- package/dist/node_modules/playwright-core/lib/client/page.js +718 -0
- package/dist/node_modules/playwright-core/lib/client/platform.js +74 -0
- package/dist/node_modules/playwright-core/lib/client/playwright.js +71 -0
- package/dist/node_modules/playwright-core/lib/client/selectors.js +55 -0
- package/dist/node_modules/playwright-core/lib/client/stream.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
- package/dist/node_modules/playwright-core/lib/client/tracing.js +119 -0
- package/dist/node_modules/playwright-core/lib/client/types.js +28 -0
- package/dist/node_modules/playwright-core/lib/client/video.js +59 -0
- package/dist/node_modules/playwright-core/lib/client/waiter.js +142 -0
- package/dist/node_modules/playwright-core/lib/client/webError.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/webSocket.js +93 -0
- package/dist/node_modules/playwright-core/lib/client/worker.js +85 -0
- package/dist/node_modules/playwright-core/lib/client/writableStream.js +39 -0
- package/dist/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
- package/dist/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
- package/dist/node_modules/playwright-core/lib/inprocess.js +3 -0
- package/dist/node_modules/playwright-core/lib/outofprocess.js +76 -0
- package/dist/node_modules/playwright-core/lib/protocol/serializers.js +192 -0
- package/dist/node_modules/playwright-core/lib/protocol/validator.js +2890 -0
- package/dist/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
- package/dist/node_modules/playwright-core/lib/remote/playwrightConnection.js +129 -0
- package/dist/node_modules/playwright-core/lib/remote/playwrightServer.js +335 -0
- package/dist/node_modules/playwright-core/lib/server/android/android.js +465 -0
- package/dist/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
- package/dist/node_modules/playwright-core/lib/server/artifact.js +127 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +505 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +153 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +212 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +221 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +130 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +383 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiPage.js +572 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js +98 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
- package/dist/node_modules/playwright-core/lib/server/browser.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/browserContext.js +695 -0
- package/dist/node_modules/playwright-core/lib/server/browserType.js +328 -0
- package/dist/node_modules/playwright-core/lib/server/callLog.js +82 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/chromium.js +402 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crBrowser.js +510 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crConnection.js +202 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crDevTools.js +113 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +666 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crPage.js +1069 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +136 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/videoRecorder.js +115 -0
- package/dist/node_modules/playwright-core/lib/server/clock.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/javascript.js +270 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/console.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
- package/dist/node_modules/playwright-core/lib/server/debugController.js +191 -0
- package/dist/node_modules/playwright-core/lib/server/debugger.js +119 -0
- package/dist/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
- package/dist/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
- package/dist/node_modules/playwright-core/lib/server/dialog.js +116 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +381 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +118 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +371 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +213 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +389 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/dist/node_modules/playwright-core/lib/server/dom.js +806 -0
- package/dist/node_modules/playwright-core/lib/server/download.js +70 -0
- package/dist/node_modules/playwright-core/lib/server/electron/electron.js +270 -0
- package/dist/node_modules/playwright-core/lib/server/electron/loader.js +29 -0
- package/dist/node_modules/playwright-core/lib/server/errors.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/fetch.js +621 -0
- package/dist/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
- package/dist/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +428 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffConnection.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffInput.js +159 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffPage.js +500 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/firefox.js +116 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/formData.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/frameSelectors.js +154 -0
- package/dist/node_modules/playwright-core/lib/server/frames.js +1455 -0
- package/dist/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/har/harTracer.js +607 -0
- package/dist/node_modules/playwright-core/lib/server/harBackend.js +157 -0
- package/dist/node_modules/playwright-core/lib/server/helper.js +96 -0
- package/dist/node_modules/playwright-core/lib/server/index.js +58 -0
- package/dist/node_modules/playwright-core/lib/server/input.js +277 -0
- package/dist/node_modules/playwright-core/lib/server/instrumentation.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/javascript.js +291 -0
- package/dist/node_modules/playwright-core/lib/server/launchApp.js +128 -0
- package/dist/node_modules/playwright-core/lib/server/localUtils.js +214 -0
- package/dist/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
- package/dist/node_modules/playwright-core/lib/server/network.js +629 -0
- package/dist/node_modules/playwright-core/lib/server/page.js +886 -0
- package/dist/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/playwright.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/progress.js +112 -0
- package/dist/node_modules/playwright-core/lib/server/protocolError.js +52 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderApp.js +387 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/recorder.js +499 -0
- package/dist/node_modules/playwright-core/lib/server/registry/browserFetcher.js +175 -0
- package/dist/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
- package/dist/node_modules/playwright-core/lib/server/registry/index.js +1399 -0
- package/dist/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1280 -0
- package/dist/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +124 -0
- package/dist/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
- package/dist/node_modules/playwright-core/lib/server/selectors.js +112 -0
- package/dist/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
- package/dist/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +541 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +604 -0
- package/dist/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js +87 -0
- package/dist/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +241 -0
- package/dist/node_modules/playwright-core/lib/server/transport.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/types.js +28 -0
- package/dist/node_modules/playwright-core/lib/server/usKeyboardLayout.js +145 -0
- package/dist/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
- package/dist/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
- package/dist/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
- package/dist/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
- package/dist/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
- package/dist/node_modules/playwright-core/lib/server/utils/env.js +73 -0
- package/dist/node_modules/playwright-core/lib/server/utils/eventsHelper.js +39 -0
- package/dist/node_modules/playwright-core/lib/server/utils/expectUtils.js +38 -0
- package/dist/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
- package/dist/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
- package/dist/node_modules/playwright-core/lib/server/utils/hostPlatform.js +123 -0
- package/dist/node_modules/playwright-core/lib/server/utils/httpServer.js +218 -0
- package/dist/node_modules/playwright-core/lib/server/utils/imageUtils.js +141 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
- package/dist/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
- package/dist/node_modules/playwright-core/lib/server/utils/network.js +233 -0
- package/dist/node_modules/playwright-core/lib/server/utils/nodePlatform.js +148 -0
- package/dist/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
- package/dist/node_modules/playwright-core/lib/server/utils/processLauncher.js +241 -0
- package/dist/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
- package/dist/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
- package/dist/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
- package/dist/node_modules/playwright-core/lib/server/utils/task.js +51 -0
- package/dist/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
- package/dist/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
- package/dist/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
- package/dist/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/webkit.js +110 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +339 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkConnection.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +169 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkPage.js +1130 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +105 -0
- package/dist/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +397 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +459 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +322 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +155 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +58 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +190 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- package/dist/node_modules/playwright-core/lib/utils.js +109 -0
- package/dist/node_modules/playwright-core/lib/utilsBundle.js +112 -0
- package/dist/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
- package/dist/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +1066 -0
- package/dist/node_modules/playwright-core/lib/vite/htmlReport/index.html +84 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BoWUGj0J.js +25 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/index-DJqDAOZp.js +193 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/index-Ri0uHF7I.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-Bucv2d7q.js +25 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-BEpdCv1S.js +266 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.ConWv5KN.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.BxQ34UMZ.js +2 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.C4Y3Aw8n.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.html +43 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +21 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +3 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.BWTwXl41.js +5 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +17 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- package/dist/node_modules/playwright-core/lib/zipBundle.js +34 -0
- package/dist/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
- package/dist/node_modules/playwright-core/package.json +42 -0
- package/dist/node_modules/playwright-core/types/protocol.d.ts +23245 -0
- package/dist/node_modules/playwright-core/types/structs.d.ts +45 -0
- package/dist/node_modules/playwright-core/types/types.d.ts +22856 -0
- package/dist/server.obf.js +1 -1
- package/package.json +11 -12
|
@@ -0,0 +1,293 @@
|
|
|
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 transform_exports = {};
|
|
30
|
+
__export(transform_exports, {
|
|
31
|
+
requireOrImport: () => requireOrImport,
|
|
32
|
+
resolveHook: () => resolveHook,
|
|
33
|
+
setSingleTSConfig: () => setSingleTSConfig,
|
|
34
|
+
setTransformConfig: () => setTransformConfig,
|
|
35
|
+
setTransformData: () => setTransformData,
|
|
36
|
+
shouldTransform: () => shouldTransform,
|
|
37
|
+
singleTSConfig: () => singleTSConfig,
|
|
38
|
+
transformConfig: () => transformConfig,
|
|
39
|
+
transformHook: () => transformHook,
|
|
40
|
+
wrapFunctionWithLocation: () => wrapFunctionWithLocation
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(transform_exports);
|
|
43
|
+
var import_fs = __toESM(require("fs"));
|
|
44
|
+
var import_module = __toESM(require("module"));
|
|
45
|
+
var import_path = __toESM(require("path"));
|
|
46
|
+
var import_url = __toESM(require("url"));
|
|
47
|
+
var import_crypto = __toESM(require("crypto"));
|
|
48
|
+
var import_tsconfig_loader = require("../third_party/tsconfig-loader");
|
|
49
|
+
var import_util = require("../util");
|
|
50
|
+
var import_utilsBundle = require("../utilsBundle");
|
|
51
|
+
var import_compilationCache = require("./compilationCache");
|
|
52
|
+
var import_pirates = require("../third_party/pirates");
|
|
53
|
+
const version = require("../../package.json").version;
|
|
54
|
+
const cachedTSConfigs = /* @__PURE__ */ new Map();
|
|
55
|
+
let _transformConfig = {
|
|
56
|
+
babelPlugins: [],
|
|
57
|
+
external: []
|
|
58
|
+
};
|
|
59
|
+
let _externalMatcher = () => false;
|
|
60
|
+
function setTransformConfig(config) {
|
|
61
|
+
_transformConfig = config;
|
|
62
|
+
_externalMatcher = (0, import_util.createFileMatcher)(_transformConfig.external);
|
|
63
|
+
}
|
|
64
|
+
function transformConfig() {
|
|
65
|
+
return _transformConfig;
|
|
66
|
+
}
|
|
67
|
+
let _singleTSConfigPath;
|
|
68
|
+
let _singleTSConfig;
|
|
69
|
+
function setSingleTSConfig(value) {
|
|
70
|
+
_singleTSConfigPath = value;
|
|
71
|
+
}
|
|
72
|
+
function singleTSConfig() {
|
|
73
|
+
return _singleTSConfigPath;
|
|
74
|
+
}
|
|
75
|
+
function validateTsConfig(tsconfig) {
|
|
76
|
+
const pathsBase = tsconfig.absoluteBaseUrl ?? tsconfig.paths?.pathsBasePath;
|
|
77
|
+
const pathsFallback = tsconfig.absoluteBaseUrl ? [{ key: "*", values: ["*"] }] : [];
|
|
78
|
+
return {
|
|
79
|
+
allowJs: !!tsconfig.allowJs,
|
|
80
|
+
pathsBase,
|
|
81
|
+
paths: Object.entries(tsconfig.paths?.mapping || {}).map(([key, values]) => ({ key, values })).concat(pathsFallback)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function loadAndValidateTsconfigsForFile(file2) {
|
|
85
|
+
if (_singleTSConfigPath && !_singleTSConfig)
|
|
86
|
+
_singleTSConfig = (0, import_tsconfig_loader.loadTsConfig)(_singleTSConfigPath).map(validateTsConfig);
|
|
87
|
+
if (_singleTSConfig)
|
|
88
|
+
return _singleTSConfig;
|
|
89
|
+
return loadAndValidateTsconfigsForFolder(import_path.default.dirname(file2));
|
|
90
|
+
}
|
|
91
|
+
function loadAndValidateTsconfigsForFolder(folder) {
|
|
92
|
+
const foldersWithConfig = [];
|
|
93
|
+
let currentFolder = import_path.default.resolve(folder);
|
|
94
|
+
let result2;
|
|
95
|
+
while (true) {
|
|
96
|
+
const cached = cachedTSConfigs.get(currentFolder);
|
|
97
|
+
if (cached) {
|
|
98
|
+
result2 = cached;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
foldersWithConfig.push(currentFolder);
|
|
102
|
+
for (const name of ["tsconfig.json", "jsconfig.json"]) {
|
|
103
|
+
const configPath = import_path.default.join(currentFolder, name);
|
|
104
|
+
if (import_fs.default.existsSync(configPath)) {
|
|
105
|
+
const loaded = (0, import_tsconfig_loader.loadTsConfig)(configPath);
|
|
106
|
+
result2 = loaded.map(validateTsConfig);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (result2)
|
|
111
|
+
break;
|
|
112
|
+
const parentFolder = import_path.default.resolve(currentFolder, "../");
|
|
113
|
+
if (currentFolder === parentFolder)
|
|
114
|
+
break;
|
|
115
|
+
currentFolder = parentFolder;
|
|
116
|
+
}
|
|
117
|
+
result2 = result2 || [];
|
|
118
|
+
for (const folder2 of foldersWithConfig)
|
|
119
|
+
cachedTSConfigs.set(folder2, result2);
|
|
120
|
+
return result2;
|
|
121
|
+
}
|
|
122
|
+
const pathSeparator = process.platform === "win32" ? ";" : ":";
|
|
123
|
+
const builtins = new Set(import_module.default.builtinModules);
|
|
124
|
+
function resolveHook(filename, specifier) {
|
|
125
|
+
if (specifier.startsWith("node:") || builtins.has(specifier))
|
|
126
|
+
return;
|
|
127
|
+
if (!shouldTransform(filename))
|
|
128
|
+
return;
|
|
129
|
+
if (isRelativeSpecifier(specifier))
|
|
130
|
+
return (0, import_util.resolveImportSpecifierAfterMapping)(import_path.default.resolve(import_path.default.dirname(filename), specifier), false);
|
|
131
|
+
const isTypeScript = filename.endsWith(".ts") || filename.endsWith(".tsx");
|
|
132
|
+
const tsconfigs = loadAndValidateTsconfigsForFile(filename);
|
|
133
|
+
for (const tsconfig of tsconfigs) {
|
|
134
|
+
if (!isTypeScript && !tsconfig.allowJs)
|
|
135
|
+
continue;
|
|
136
|
+
let longestPrefixLength = -1;
|
|
137
|
+
let pathMatchedByLongestPrefix;
|
|
138
|
+
for (const { key, values } of tsconfig.paths) {
|
|
139
|
+
let matchedPartOfSpecifier = specifier;
|
|
140
|
+
const [keyPrefix, keySuffix] = key.split("*");
|
|
141
|
+
if (key.includes("*")) {
|
|
142
|
+
if (keyPrefix) {
|
|
143
|
+
if (!specifier.startsWith(keyPrefix))
|
|
144
|
+
continue;
|
|
145
|
+
matchedPartOfSpecifier = matchedPartOfSpecifier.substring(keyPrefix.length, matchedPartOfSpecifier.length);
|
|
146
|
+
}
|
|
147
|
+
if (keySuffix) {
|
|
148
|
+
if (!specifier.endsWith(keySuffix))
|
|
149
|
+
continue;
|
|
150
|
+
matchedPartOfSpecifier = matchedPartOfSpecifier.substring(0, matchedPartOfSpecifier.length - keySuffix.length);
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
if (specifier !== key)
|
|
154
|
+
continue;
|
|
155
|
+
matchedPartOfSpecifier = specifier;
|
|
156
|
+
}
|
|
157
|
+
if (keyPrefix.length <= longestPrefixLength)
|
|
158
|
+
continue;
|
|
159
|
+
for (const value of values) {
|
|
160
|
+
let candidate = value;
|
|
161
|
+
if (value.includes("*"))
|
|
162
|
+
candidate = candidate.replace("*", matchedPartOfSpecifier);
|
|
163
|
+
candidate = import_path.default.resolve(tsconfig.pathsBase, candidate);
|
|
164
|
+
const existing = (0, import_util.resolveImportSpecifierAfterMapping)(candidate, true);
|
|
165
|
+
if (existing) {
|
|
166
|
+
longestPrefixLength = keyPrefix.length;
|
|
167
|
+
pathMatchedByLongestPrefix = existing;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (pathMatchedByLongestPrefix)
|
|
172
|
+
return pathMatchedByLongestPrefix;
|
|
173
|
+
}
|
|
174
|
+
if (import_path.default.isAbsolute(specifier)) {
|
|
175
|
+
return (0, import_util.resolveImportSpecifierAfterMapping)(specifier, false);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function shouldTransform(filename) {
|
|
179
|
+
if (_externalMatcher(filename))
|
|
180
|
+
return false;
|
|
181
|
+
return !(0, import_compilationCache.belongsToNodeModules)(filename);
|
|
182
|
+
}
|
|
183
|
+
let transformData;
|
|
184
|
+
function setTransformData(pluginName, value) {
|
|
185
|
+
transformData.set(pluginName, value);
|
|
186
|
+
}
|
|
187
|
+
function transformHook(originalCode, filename, moduleUrl) {
|
|
188
|
+
const hasPreprocessor = process.env.PW_TEST_SOURCE_TRANSFORM && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE && process.env.PW_TEST_SOURCE_TRANSFORM_SCOPE.split(pathSeparator).some((f) => filename.startsWith(f));
|
|
189
|
+
const pluginsPrologue = _transformConfig.babelPlugins;
|
|
190
|
+
const pluginsEpilogue = hasPreprocessor ? [[process.env.PW_TEST_SOURCE_TRANSFORM]] : [];
|
|
191
|
+
const hash = calculateHash(originalCode, filename, !!moduleUrl, pluginsPrologue, pluginsEpilogue);
|
|
192
|
+
const { cachedCode, addToCache, serializedCache } = (0, import_compilationCache.getFromCompilationCache)(filename, hash, moduleUrl);
|
|
193
|
+
if (cachedCode !== void 0)
|
|
194
|
+
return { code: cachedCode, serializedCache };
|
|
195
|
+
process.env.BROWSERSLIST_IGNORE_OLD_DATA = "true";
|
|
196
|
+
const { babelTransform } = require("./babelBundle");
|
|
197
|
+
transformData = /* @__PURE__ */ new Map();
|
|
198
|
+
const babelResult = babelTransform(originalCode, filename, !!moduleUrl, pluginsPrologue, pluginsEpilogue);
|
|
199
|
+
if (!babelResult?.code)
|
|
200
|
+
return { code: originalCode, serializedCache };
|
|
201
|
+
const { code, map } = babelResult;
|
|
202
|
+
const added = addToCache(code, map, transformData);
|
|
203
|
+
return { code, serializedCache: added.serializedCache };
|
|
204
|
+
}
|
|
205
|
+
function calculateHash(content, filePath, isModule2, pluginsPrologue, pluginsEpilogue) {
|
|
206
|
+
const hash = import_crypto.default.createHash("sha1").update(isModule2 ? "esm" : "no_esm").update(content).update(filePath).update(version).update(pluginsPrologue.map((p) => p[0]).join(",")).update(pluginsEpilogue.map((p) => p[0]).join(",")).digest("hex");
|
|
207
|
+
return hash;
|
|
208
|
+
}
|
|
209
|
+
async function requireOrImport(file) {
|
|
210
|
+
installTransformIfNeeded();
|
|
211
|
+
const isModule = (0, import_util.fileIsModule)(file);
|
|
212
|
+
const esmImport = () => eval(`import(${JSON.stringify(import_url.default.pathToFileURL(file))})`);
|
|
213
|
+
if (isModule) {
|
|
214
|
+
return await esmImport().finally(async () => {
|
|
215
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
const result = require(file);
|
|
219
|
+
const depsCollector = (0, import_compilationCache.currentFileDepsCollector)();
|
|
220
|
+
if (depsCollector) {
|
|
221
|
+
const module2 = require.cache[file];
|
|
222
|
+
if (module2)
|
|
223
|
+
collectCJSDependencies(module2, depsCollector);
|
|
224
|
+
}
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
let transformInstalled = false;
|
|
228
|
+
function installTransformIfNeeded() {
|
|
229
|
+
if (transformInstalled)
|
|
230
|
+
return;
|
|
231
|
+
transformInstalled = true;
|
|
232
|
+
(0, import_compilationCache.installSourceMapSupport)();
|
|
233
|
+
const originalResolveFilename = import_module.default._resolveFilename;
|
|
234
|
+
function resolveFilename(specifier, parent, ...rest) {
|
|
235
|
+
if (parent) {
|
|
236
|
+
const resolved = resolveHook(parent.filename, specifier);
|
|
237
|
+
if (resolved !== void 0)
|
|
238
|
+
specifier = resolved;
|
|
239
|
+
}
|
|
240
|
+
return originalResolveFilename.call(this, specifier, parent, ...rest);
|
|
241
|
+
}
|
|
242
|
+
import_module.default._resolveFilename = resolveFilename;
|
|
243
|
+
(0, import_pirates.addHook)((code, filename) => {
|
|
244
|
+
return transformHook(code, filename).code;
|
|
245
|
+
}, shouldTransform, [".ts", ".tsx", ".js", ".jsx", ".mjs", ".mts", ".cjs", ".cts"]);
|
|
246
|
+
}
|
|
247
|
+
const collectCJSDependencies = (module2, dependencies) => {
|
|
248
|
+
module2.children.forEach((child) => {
|
|
249
|
+
if (!(0, import_compilationCache.belongsToNodeModules)(child.filename) && !dependencies.has(child.filename)) {
|
|
250
|
+
dependencies.add(child.filename);
|
|
251
|
+
collectCJSDependencies(child, dependencies);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
function wrapFunctionWithLocation(func) {
|
|
256
|
+
return (...args) => {
|
|
257
|
+
const oldPrepareStackTrace = Error.prepareStackTrace;
|
|
258
|
+
Error.prepareStackTrace = (error, stackFrames) => {
|
|
259
|
+
const frame = import_utilsBundle.sourceMapSupport.wrapCallSite(stackFrames[1]);
|
|
260
|
+
const fileName = frame.getFileName();
|
|
261
|
+
const file2 = fileName && fileName.startsWith("file://") ? import_url.default.fileURLToPath(fileName) : fileName;
|
|
262
|
+
return {
|
|
263
|
+
file: file2,
|
|
264
|
+
line: frame.getLineNumber(),
|
|
265
|
+
column: frame.getColumnNumber()
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
const oldStackTraceLimit = Error.stackTraceLimit;
|
|
269
|
+
Error.stackTraceLimit = 2;
|
|
270
|
+
const obj = {};
|
|
271
|
+
Error.captureStackTrace(obj);
|
|
272
|
+
const location = obj.stack;
|
|
273
|
+
Error.stackTraceLimit = oldStackTraceLimit;
|
|
274
|
+
Error.prepareStackTrace = oldPrepareStackTrace;
|
|
275
|
+
return func(location, ...args);
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function isRelativeSpecifier(specifier) {
|
|
279
|
+
return specifier === "." || specifier === ".." || specifier.startsWith("./") || specifier.startsWith("../");
|
|
280
|
+
}
|
|
281
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
282
|
+
0 && (module.exports = {
|
|
283
|
+
requireOrImport,
|
|
284
|
+
resolveHook,
|
|
285
|
+
setSingleTSConfig,
|
|
286
|
+
setTransformConfig,
|
|
287
|
+
setTransformData,
|
|
288
|
+
shouldTransform,
|
|
289
|
+
singleTSConfig,
|
|
290
|
+
transformConfig,
|
|
291
|
+
transformHook,
|
|
292
|
+
wrapFunctionWithLocation
|
|
293
|
+
});
|
|
@@ -0,0 +1,403 @@
|
|
|
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 util_exports = {};
|
|
30
|
+
__export(util_exports, {
|
|
31
|
+
addSuffixToFilePath: () => addSuffixToFilePath,
|
|
32
|
+
ansiRegex: () => ansiRegex,
|
|
33
|
+
createFileFiltersFromArguments: () => createFileFiltersFromArguments,
|
|
34
|
+
createFileMatcher: () => createFileMatcher,
|
|
35
|
+
createFileMatcherFromArguments: () => createFileMatcherFromArguments,
|
|
36
|
+
createTitleMatcher: () => createTitleMatcher,
|
|
37
|
+
debugTest: () => debugTest,
|
|
38
|
+
errorWithFile: () => errorWithFile,
|
|
39
|
+
expectTypes: () => expectTypes,
|
|
40
|
+
fileExistsAsync: () => fileExistsAsync,
|
|
41
|
+
fileIsModule: () => fileIsModule,
|
|
42
|
+
filterStackFile: () => filterStackFile,
|
|
43
|
+
filterStackTrace: () => filterStackTrace,
|
|
44
|
+
filteredStackTrace: () => filteredStackTrace,
|
|
45
|
+
forceRegExp: () => forceRegExp,
|
|
46
|
+
formatLocation: () => formatLocation,
|
|
47
|
+
getContainedPath: () => getContainedPath,
|
|
48
|
+
getPackageJsonPath: () => getPackageJsonPath,
|
|
49
|
+
mergeObjects: () => mergeObjects,
|
|
50
|
+
normalizeAndSaveAttachment: () => normalizeAndSaveAttachment,
|
|
51
|
+
parseLocationArg: () => parseLocationArg,
|
|
52
|
+
relativeFilePath: () => relativeFilePath,
|
|
53
|
+
removeDirAndLogToConsole: () => removeDirAndLogToConsole,
|
|
54
|
+
resolveImportSpecifierAfterMapping: () => resolveImportSpecifierAfterMapping,
|
|
55
|
+
resolveReporterOutputPath: () => resolveReporterOutputPath,
|
|
56
|
+
sanitizeFilePathBeforeExtension: () => sanitizeFilePathBeforeExtension,
|
|
57
|
+
serializeError: () => serializeError,
|
|
58
|
+
stripAnsiEscapes: () => stripAnsiEscapes,
|
|
59
|
+
trimLongString: () => trimLongString,
|
|
60
|
+
windowsFilesystemFriendlyLength: () => windowsFilesystemFriendlyLength
|
|
61
|
+
});
|
|
62
|
+
module.exports = __toCommonJS(util_exports);
|
|
63
|
+
var import_fs = __toESM(require("fs"));
|
|
64
|
+
var import_path = __toESM(require("path"));
|
|
65
|
+
var import_url = __toESM(require("url"));
|
|
66
|
+
var import_util = __toESM(require("util"));
|
|
67
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
68
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
69
|
+
const PLAYWRIGHT_TEST_PATH = import_path.default.join(__dirname, "..");
|
|
70
|
+
const PLAYWRIGHT_CORE_PATH = import_path.default.dirname(require.resolve("playwright-core/package.json"));
|
|
71
|
+
function filterStackTrace(e) {
|
|
72
|
+
const name = e.name ? e.name + ": " : "";
|
|
73
|
+
const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
|
|
74
|
+
if (process.env.PWDEBUGIMPL)
|
|
75
|
+
return { message: name + e.message, stack: e.stack || "", cause };
|
|
76
|
+
const stackLines = (0, import_utils.stringifyStackFrames)(filteredStackTrace(e.stack?.split("\n") || []));
|
|
77
|
+
return {
|
|
78
|
+
message: name + e.message,
|
|
79
|
+
stack: `${name}${e.message}${stackLines.map((line) => "\n" + line).join("")}`,
|
|
80
|
+
cause
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function filterStackFile(file) {
|
|
84
|
+
if (!process.env.PWDEBUGIMPL && file.startsWith(PLAYWRIGHT_TEST_PATH))
|
|
85
|
+
return false;
|
|
86
|
+
if (!process.env.PWDEBUGIMPL && file.startsWith(PLAYWRIGHT_CORE_PATH))
|
|
87
|
+
return false;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
function filteredStackTrace(rawStack) {
|
|
91
|
+
const frames = [];
|
|
92
|
+
for (const line of rawStack) {
|
|
93
|
+
const frame = (0, import_utils.parseStackFrame)(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
|
|
94
|
+
if (!frame || !frame.file)
|
|
95
|
+
continue;
|
|
96
|
+
if (!filterStackFile(frame.file))
|
|
97
|
+
continue;
|
|
98
|
+
frames.push(frame);
|
|
99
|
+
}
|
|
100
|
+
return frames;
|
|
101
|
+
}
|
|
102
|
+
function serializeError(error) {
|
|
103
|
+
if (error instanceof Error)
|
|
104
|
+
return filterStackTrace(error);
|
|
105
|
+
return {
|
|
106
|
+
value: import_util.default.inspect(error)
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function parseLocationArg(arg) {
|
|
110
|
+
const match = /^(.*?):(\d+):?(\d+)?$/.exec(arg);
|
|
111
|
+
return {
|
|
112
|
+
file: match ? match[1] : arg,
|
|
113
|
+
line: match ? parseInt(match[2], 10) : null,
|
|
114
|
+
column: match?.[3] ? parseInt(match[3], 10) : null
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function createFileFiltersFromArguments(args) {
|
|
118
|
+
return args.map((arg) => {
|
|
119
|
+
const parsed = parseLocationArg(arg);
|
|
120
|
+
return { re: forceRegExp(parsed.file), line: parsed.line, column: parsed.column };
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function createFileMatcherFromArguments(args) {
|
|
124
|
+
const filters = createFileFiltersFromArguments(args);
|
|
125
|
+
return createFileMatcher(filters.map((filter) => filter.re || filter.exact || ""));
|
|
126
|
+
}
|
|
127
|
+
function createFileMatcher(patterns) {
|
|
128
|
+
const reList = [];
|
|
129
|
+
const filePatterns = [];
|
|
130
|
+
for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
|
|
131
|
+
if ((0, import_utils.isRegExp)(pattern)) {
|
|
132
|
+
reList.push(pattern);
|
|
133
|
+
} else {
|
|
134
|
+
if (!pattern.startsWith("**/"))
|
|
135
|
+
filePatterns.push("**/" + pattern);
|
|
136
|
+
else
|
|
137
|
+
filePatterns.push(pattern);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return (filePath) => {
|
|
141
|
+
for (const re of reList) {
|
|
142
|
+
re.lastIndex = 0;
|
|
143
|
+
if (re.test(filePath))
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
if (import_path.default.sep === "\\") {
|
|
147
|
+
const fileURL = import_url.default.pathToFileURL(filePath).href;
|
|
148
|
+
for (const re of reList) {
|
|
149
|
+
re.lastIndex = 0;
|
|
150
|
+
if (re.test(fileURL))
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
for (const pattern of filePatterns) {
|
|
155
|
+
if ((0, import_utilsBundle.minimatch)(filePath, pattern, { nocase: true, dot: true }))
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function createTitleMatcher(patterns) {
|
|
162
|
+
const reList = Array.isArray(patterns) ? patterns : [patterns];
|
|
163
|
+
return (value) => {
|
|
164
|
+
for (const re of reList) {
|
|
165
|
+
re.lastIndex = 0;
|
|
166
|
+
if (re.test(value))
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
return false;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function mergeObjects(a, b, c) {
|
|
173
|
+
const result = { ...a };
|
|
174
|
+
for (const x of [b, c].filter(Boolean)) {
|
|
175
|
+
for (const [name, value] of Object.entries(x)) {
|
|
176
|
+
if (!Object.is(value, void 0))
|
|
177
|
+
result[name] = value;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
function forceRegExp(pattern) {
|
|
183
|
+
const match = pattern.match(/^\/(.*)\/([gi]*)$/);
|
|
184
|
+
if (match)
|
|
185
|
+
return new RegExp(match[1], match[2]);
|
|
186
|
+
return new RegExp(pattern, "gi");
|
|
187
|
+
}
|
|
188
|
+
function relativeFilePath(file) {
|
|
189
|
+
if (!import_path.default.isAbsolute(file))
|
|
190
|
+
return file;
|
|
191
|
+
return import_path.default.relative(process.cwd(), file);
|
|
192
|
+
}
|
|
193
|
+
function formatLocation(location) {
|
|
194
|
+
return relativeFilePath(location.file) + ":" + location.line + ":" + location.column;
|
|
195
|
+
}
|
|
196
|
+
function errorWithFile(file, message) {
|
|
197
|
+
return new Error(`${relativeFilePath(file)}: ${message}`);
|
|
198
|
+
}
|
|
199
|
+
function expectTypes(receiver, types, matcherName) {
|
|
200
|
+
if (typeof receiver !== "object" || !types.includes(receiver.constructor.name)) {
|
|
201
|
+
const commaSeparated = types.slice();
|
|
202
|
+
const lastType = commaSeparated.pop();
|
|
203
|
+
const typesString = commaSeparated.length ? commaSeparated.join(", ") + " or " + lastType : lastType;
|
|
204
|
+
throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const windowsFilesystemFriendlyLength = 60;
|
|
208
|
+
function trimLongString(s, length = 100) {
|
|
209
|
+
if (s.length <= length)
|
|
210
|
+
return s;
|
|
211
|
+
const hash = (0, import_utils.calculateSha1)(s);
|
|
212
|
+
const middle = `-${hash.substring(0, 5)}-`;
|
|
213
|
+
const start = Math.floor((length - middle.length) / 2);
|
|
214
|
+
const end = length - middle.length - start;
|
|
215
|
+
return s.substring(0, start) + middle + s.slice(-end);
|
|
216
|
+
}
|
|
217
|
+
function addSuffixToFilePath(filePath, suffix) {
|
|
218
|
+
const ext = import_path.default.extname(filePath);
|
|
219
|
+
const base = filePath.substring(0, filePath.length - ext.length);
|
|
220
|
+
return base + suffix + ext;
|
|
221
|
+
}
|
|
222
|
+
function sanitizeFilePathBeforeExtension(filePath, ext) {
|
|
223
|
+
ext ??= import_path.default.extname(filePath);
|
|
224
|
+
const base = filePath.substring(0, filePath.length - ext.length);
|
|
225
|
+
return (0, import_utils.sanitizeForFilePath)(base) + ext;
|
|
226
|
+
}
|
|
227
|
+
function getContainedPath(parentPath, subPath = "") {
|
|
228
|
+
const resolvedPath = import_path.default.resolve(parentPath, subPath);
|
|
229
|
+
if (resolvedPath === parentPath || resolvedPath.startsWith(parentPath + import_path.default.sep))
|
|
230
|
+
return resolvedPath;
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
const debugTest = (0, import_utilsBundle.debug)("pw:test");
|
|
234
|
+
const folderToPackageJsonPath = /* @__PURE__ */ new Map();
|
|
235
|
+
function getPackageJsonPath(folderPath) {
|
|
236
|
+
const cached = folderToPackageJsonPath.get(folderPath);
|
|
237
|
+
if (cached !== void 0)
|
|
238
|
+
return cached;
|
|
239
|
+
const packageJsonPath = import_path.default.join(folderPath, "package.json");
|
|
240
|
+
if (import_fs.default.existsSync(packageJsonPath)) {
|
|
241
|
+
folderToPackageJsonPath.set(folderPath, packageJsonPath);
|
|
242
|
+
return packageJsonPath;
|
|
243
|
+
}
|
|
244
|
+
const parentFolder = import_path.default.dirname(folderPath);
|
|
245
|
+
if (folderPath === parentFolder) {
|
|
246
|
+
folderToPackageJsonPath.set(folderPath, "");
|
|
247
|
+
return "";
|
|
248
|
+
}
|
|
249
|
+
const result = getPackageJsonPath(parentFolder);
|
|
250
|
+
folderToPackageJsonPath.set(folderPath, result);
|
|
251
|
+
return result;
|
|
252
|
+
}
|
|
253
|
+
function resolveReporterOutputPath(defaultValue, configDir, configValue) {
|
|
254
|
+
if (configValue)
|
|
255
|
+
return import_path.default.resolve(configDir, configValue);
|
|
256
|
+
let basePath = getPackageJsonPath(configDir);
|
|
257
|
+
basePath = basePath ? import_path.default.dirname(basePath) : process.cwd();
|
|
258
|
+
return import_path.default.resolve(basePath, defaultValue);
|
|
259
|
+
}
|
|
260
|
+
async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
|
|
261
|
+
if (options.path === void 0 && options.body === void 0)
|
|
262
|
+
return { name, contentType: "text/plain" };
|
|
263
|
+
if ((options.path !== void 0 ? 1 : 0) + (options.body !== void 0 ? 1 : 0) !== 1)
|
|
264
|
+
throw new Error(`Exactly one of "path" and "body" must be specified`);
|
|
265
|
+
if (options.path !== void 0) {
|
|
266
|
+
const hash = (0, import_utils.calculateSha1)(options.path);
|
|
267
|
+
if (!(0, import_utils.isString)(name))
|
|
268
|
+
throw new Error('"name" should be string.');
|
|
269
|
+
const sanitizedNamePrefix = (0, import_utils.sanitizeForFilePath)(name) + "-";
|
|
270
|
+
const dest = import_path.default.join(outputPath, "attachments", sanitizedNamePrefix + hash + import_path.default.extname(options.path));
|
|
271
|
+
await import_fs.default.promises.mkdir(import_path.default.dirname(dest), { recursive: true });
|
|
272
|
+
await import_fs.default.promises.copyFile(options.path, dest);
|
|
273
|
+
const contentType = options.contentType ?? (import_utilsBundle.mime.getType(import_path.default.basename(options.path)) || "application/octet-stream");
|
|
274
|
+
return { name, contentType, path: dest };
|
|
275
|
+
} else {
|
|
276
|
+
const contentType = options.contentType ?? (typeof options.body === "string" ? "text/plain" : "application/octet-stream");
|
|
277
|
+
return { name, contentType, body: typeof options.body === "string" ? Buffer.from(options.body) : options.body };
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function fileIsModule(file) {
|
|
281
|
+
if (file.endsWith(".mjs") || file.endsWith(".mts"))
|
|
282
|
+
return true;
|
|
283
|
+
if (file.endsWith(".cjs") || file.endsWith(".cts"))
|
|
284
|
+
return false;
|
|
285
|
+
const folder = import_path.default.dirname(file);
|
|
286
|
+
return folderIsModule(folder);
|
|
287
|
+
}
|
|
288
|
+
function folderIsModule(folder) {
|
|
289
|
+
const packageJsonPath = getPackageJsonPath(folder);
|
|
290
|
+
if (!packageJsonPath)
|
|
291
|
+
return false;
|
|
292
|
+
return require(packageJsonPath).type === "module";
|
|
293
|
+
}
|
|
294
|
+
const packageJsonMainFieldCache = /* @__PURE__ */ new Map();
|
|
295
|
+
function getMainFieldFromPackageJson(packageJsonPath) {
|
|
296
|
+
if (!packageJsonMainFieldCache.has(packageJsonPath)) {
|
|
297
|
+
let mainField;
|
|
298
|
+
try {
|
|
299
|
+
mainField = JSON.parse(import_fs.default.readFileSync(packageJsonPath, "utf8")).main;
|
|
300
|
+
} catch {
|
|
301
|
+
}
|
|
302
|
+
packageJsonMainFieldCache.set(packageJsonPath, mainField);
|
|
303
|
+
}
|
|
304
|
+
return packageJsonMainFieldCache.get(packageJsonPath);
|
|
305
|
+
}
|
|
306
|
+
const kExtLookups = /* @__PURE__ */ new Map([
|
|
307
|
+
[".js", [".jsx", ".ts", ".tsx"]],
|
|
308
|
+
[".jsx", [".tsx"]],
|
|
309
|
+
[".cjs", [".cts"]],
|
|
310
|
+
[".mjs", [".mts"]],
|
|
311
|
+
["", [".js", ".ts", ".jsx", ".tsx", ".cjs", ".mjs", ".cts", ".mts"]]
|
|
312
|
+
]);
|
|
313
|
+
function resolveImportSpecifierExtension(resolved) {
|
|
314
|
+
if (fileExists(resolved))
|
|
315
|
+
return resolved;
|
|
316
|
+
for (const [ext, others] of kExtLookups) {
|
|
317
|
+
if (!resolved.endsWith(ext))
|
|
318
|
+
continue;
|
|
319
|
+
for (const other of others) {
|
|
320
|
+
const modified = resolved.substring(0, resolved.length - ext.length) + other;
|
|
321
|
+
if (fileExists(modified))
|
|
322
|
+
return modified;
|
|
323
|
+
}
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function resolveImportSpecifierAfterMapping(resolved, afterPathMapping) {
|
|
328
|
+
const resolvedFile = resolveImportSpecifierExtension(resolved);
|
|
329
|
+
if (resolvedFile)
|
|
330
|
+
return resolvedFile;
|
|
331
|
+
if (dirExists(resolved)) {
|
|
332
|
+
const packageJsonPath = import_path.default.join(resolved, "package.json");
|
|
333
|
+
if (afterPathMapping) {
|
|
334
|
+
const mainField = getMainFieldFromPackageJson(packageJsonPath);
|
|
335
|
+
const mainFieldResolved = mainField ? resolveImportSpecifierExtension(import_path.default.resolve(resolved, mainField)) : void 0;
|
|
336
|
+
return mainFieldResolved || resolveImportSpecifierExtension(import_path.default.join(resolved, "index"));
|
|
337
|
+
}
|
|
338
|
+
if (fileExists(packageJsonPath))
|
|
339
|
+
return resolved;
|
|
340
|
+
const dirImport = import_path.default.join(resolved, "index");
|
|
341
|
+
return resolveImportSpecifierExtension(dirImport);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
function fileExists(resolved) {
|
|
345
|
+
return import_fs.default.statSync(resolved, { throwIfNoEntry: false })?.isFile();
|
|
346
|
+
}
|
|
347
|
+
async function fileExistsAsync(resolved) {
|
|
348
|
+
try {
|
|
349
|
+
const stat = await import_fs.default.promises.stat(resolved);
|
|
350
|
+
return stat.isFile();
|
|
351
|
+
} catch {
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function dirExists(resolved) {
|
|
356
|
+
return import_fs.default.statSync(resolved, { throwIfNoEntry: false })?.isDirectory();
|
|
357
|
+
}
|
|
358
|
+
async function removeDirAndLogToConsole(dir) {
|
|
359
|
+
try {
|
|
360
|
+
if (!import_fs.default.existsSync(dir))
|
|
361
|
+
return;
|
|
362
|
+
console.log(`Removing ${await import_fs.default.promises.realpath(dir)}`);
|
|
363
|
+
await import_fs.default.promises.rm(dir, { recursive: true, force: true });
|
|
364
|
+
} catch {
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const ansiRegex = new RegExp("([\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))", "g");
|
|
368
|
+
function stripAnsiEscapes(str) {
|
|
369
|
+
return str.replace(ansiRegex, "");
|
|
370
|
+
}
|
|
371
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
372
|
+
0 && (module.exports = {
|
|
373
|
+
addSuffixToFilePath,
|
|
374
|
+
ansiRegex,
|
|
375
|
+
createFileFiltersFromArguments,
|
|
376
|
+
createFileMatcher,
|
|
377
|
+
createFileMatcherFromArguments,
|
|
378
|
+
createTitleMatcher,
|
|
379
|
+
debugTest,
|
|
380
|
+
errorWithFile,
|
|
381
|
+
expectTypes,
|
|
382
|
+
fileExistsAsync,
|
|
383
|
+
fileIsModule,
|
|
384
|
+
filterStackFile,
|
|
385
|
+
filterStackTrace,
|
|
386
|
+
filteredStackTrace,
|
|
387
|
+
forceRegExp,
|
|
388
|
+
formatLocation,
|
|
389
|
+
getContainedPath,
|
|
390
|
+
getPackageJsonPath,
|
|
391
|
+
mergeObjects,
|
|
392
|
+
normalizeAndSaveAttachment,
|
|
393
|
+
parseLocationArg,
|
|
394
|
+
relativeFilePath,
|
|
395
|
+
removeDirAndLogToConsole,
|
|
396
|
+
resolveImportSpecifierAfterMapping,
|
|
397
|
+
resolveReporterOutputPath,
|
|
398
|
+
sanitizeFilePathBeforeExtension,
|
|
399
|
+
serializeError,
|
|
400
|
+
stripAnsiEscapes,
|
|
401
|
+
trimLongString,
|
|
402
|
+
windowsFilesystemFriendlyLength
|
|
403
|
+
});
|