rubycrawl 0.1.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.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/Gemfile +11 -0
- data/LICENSE +21 -0
- data/README.md +585 -0
- data/Rakefile +8 -0
- data/bin/console +9 -0
- data/bin/setup +4 -0
- data/lib/rubycrawl/errors.rb +18 -0
- data/lib/rubycrawl/helpers.rb +66 -0
- data/lib/rubycrawl/markdown_converter.rb +37 -0
- data/lib/rubycrawl/railtie.rb +12 -0
- data/lib/rubycrawl/result.rb +40 -0
- data/lib/rubycrawl/service_client.rb +86 -0
- data/lib/rubycrawl/site_crawler.rb +113 -0
- data/lib/rubycrawl/tasks/install.rake +85 -0
- data/lib/rubycrawl/url_normalizer.rb +68 -0
- data/lib/rubycrawl/version.rb +5 -0
- data/lib/rubycrawl.rb +141 -0
- data/node/.gitignore +2 -0
- data/node/.npmrc +1 -0
- data/node/README.md +19 -0
- data/node/node_modules/.bin/playwright +1 -0
- data/node/node_modules/.bin/playwright-core +1 -0
- data/node/node_modules/.package-lock.json +65 -0
- data/node/node_modules/dotenv/CHANGELOG.md +520 -0
- data/node/node_modules/dotenv/LICENSE +23 -0
- data/node/node_modules/dotenv/README-es.md +411 -0
- data/node/node_modules/dotenv/README.md +645 -0
- data/node/node_modules/dotenv/SECURITY.md +1 -0
- data/node/node_modules/dotenv/config.d.ts +1 -0
- data/node/node_modules/dotenv/config.js +9 -0
- data/node/node_modules/dotenv/lib/cli-options.js +17 -0
- data/node/node_modules/dotenv/lib/env-options.js +28 -0
- data/node/node_modules/dotenv/lib/main.d.ts +162 -0
- data/node/node_modules/dotenv/lib/main.js +386 -0
- data/node/node_modules/dotenv/package.json +62 -0
- data/node/node_modules/playwright/LICENSE +202 -0
- data/node/node_modules/playwright/NOTICE +5 -0
- data/node/node_modules/playwright/README.md +168 -0
- data/node/node_modules/playwright/ThirdPartyNotices.txt +5042 -0
- data/node/node_modules/playwright/cli.js +19 -0
- data/node/node_modules/playwright/index.d.ts +17 -0
- data/node/node_modules/playwright/index.js +17 -0
- data/node/node_modules/playwright/index.mjs +18 -0
- data/node/node_modules/playwright/jsx-runtime.js +42 -0
- data/node/node_modules/playwright/jsx-runtime.mjs +21 -0
- data/node/node_modules/playwright/lib/agents/agentParser.js +89 -0
- data/node/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- data/node/node_modules/playwright/lib/agents/generateAgents.js +348 -0
- data/node/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- data/node/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- data/node/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- data/node/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- data/node/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +55 -0
- data/node/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- data/node/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +73 -0
- data/node/node_modules/playwright/lib/common/config.js +282 -0
- data/node/node_modules/playwright/lib/common/configLoader.js +344 -0
- data/node/node_modules/playwright/lib/common/esmLoaderHost.js +104 -0
- data/node/node_modules/playwright/lib/common/expectBundle.js +28 -0
- data/node/node_modules/playwright/lib/common/expectBundleImpl.js +407 -0
- data/node/node_modules/playwright/lib/common/fixtures.js +302 -0
- data/node/node_modules/playwright/lib/common/globals.js +58 -0
- data/node/node_modules/playwright/lib/common/ipc.js +60 -0
- data/node/node_modules/playwright/lib/common/poolBuilder.js +85 -0
- data/node/node_modules/playwright/lib/common/process.js +132 -0
- data/node/node_modules/playwright/lib/common/suiteUtils.js +140 -0
- data/node/node_modules/playwright/lib/common/test.js +321 -0
- data/node/node_modules/playwright/lib/common/testLoader.js +101 -0
- data/node/node_modules/playwright/lib/common/testType.js +298 -0
- data/node/node_modules/playwright/lib/common/validators.js +68 -0
- data/node/node_modules/playwright/lib/fsWatcher.js +67 -0
- data/node/node_modules/playwright/lib/index.js +726 -0
- data/node/node_modules/playwright/lib/internalsForTest.js +42 -0
- data/node/node_modules/playwright/lib/isomorphic/events.js +77 -0
- data/node/node_modules/playwright/lib/isomorphic/folders.js +30 -0
- data/node/node_modules/playwright/lib/isomorphic/stringInternPool.js +69 -0
- data/node/node_modules/playwright/lib/isomorphic/teleReceiver.js +521 -0
- data/node/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +157 -0
- data/node/node_modules/playwright/lib/isomorphic/testServerConnection.js +225 -0
- data/node/node_modules/playwright/lib/isomorphic/testServerInterface.js +16 -0
- data/node/node_modules/playwright/lib/isomorphic/testTree.js +329 -0
- data/node/node_modules/playwright/lib/isomorphic/types.d.js +16 -0
- data/node/node_modules/playwright/lib/loader/loaderMain.js +59 -0
- data/node/node_modules/playwright/lib/matchers/expect.js +311 -0
- data/node/node_modules/playwright/lib/matchers/matcherHint.js +44 -0
- data/node/node_modules/playwright/lib/matchers/matchers.js +383 -0
- data/node/node_modules/playwright/lib/matchers/toBeTruthy.js +75 -0
- data/node/node_modules/playwright/lib/matchers/toEqual.js +100 -0
- data/node/node_modules/playwright/lib/matchers/toHaveURL.js +101 -0
- data/node/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +159 -0
- data/node/node_modules/playwright/lib/matchers/toMatchSnapshot.js +342 -0
- data/node/node_modules/playwright/lib/matchers/toMatchText.js +99 -0
- data/node/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +329 -0
- data/node/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +84 -0
- data/node/node_modules/playwright/lib/mcp/browser/config.js +421 -0
- data/node/node_modules/playwright/lib/mcp/browser/context.js +244 -0
- data/node/node_modules/playwright/lib/mcp/browser/response.js +278 -0
- data/node/node_modules/playwright/lib/mcp/browser/sessionLog.js +75 -0
- data/node/node_modules/playwright/lib/mcp/browser/tab.js +343 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/common.js +65 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/console.js +46 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +60 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +61 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/files.js +58 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/form.js +63 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/install.js +72 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +107 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/mouse.js +107 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/navigate.js +71 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/network.js +63 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/open.js +57 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/pdf.js +49 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/runCode.js +78 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +93 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +173 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/tabs.js +67 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/tool.js +47 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/tracing.js +74 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/utils.js +94 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/verify.js +143 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools/wait.js +63 -0
- data/node/node_modules/playwright/lib/mcp/browser/tools.js +84 -0
- data/node/node_modules/playwright/lib/mcp/browser/watchdog.js +44 -0
- data/node/node_modules/playwright/lib/mcp/config.d.js +16 -0
- data/node/node_modules/playwright/lib/mcp/extension/cdpRelay.js +351 -0
- data/node/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +76 -0
- data/node/node_modules/playwright/lib/mcp/extension/protocol.js +28 -0
- data/node/node_modules/playwright/lib/mcp/index.js +61 -0
- data/node/node_modules/playwright/lib/mcp/log.js +35 -0
- data/node/node_modules/playwright/lib/mcp/program.js +111 -0
- data/node/node_modules/playwright/lib/mcp/sdk/exports.js +28 -0
- data/node/node_modules/playwright/lib/mcp/sdk/http.js +152 -0
- data/node/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +71 -0
- data/node/node_modules/playwright/lib/mcp/sdk/server.js +223 -0
- data/node/node_modules/playwright/lib/mcp/sdk/tool.js +47 -0
- data/node/node_modules/playwright/lib/mcp/terminal/cli.js +296 -0
- data/node/node_modules/playwright/lib/mcp/terminal/command.js +56 -0
- data/node/node_modules/playwright/lib/mcp/terminal/commands.js +333 -0
- data/node/node_modules/playwright/lib/mcp/terminal/daemon.js +129 -0
- data/node/node_modules/playwright/lib/mcp/terminal/help.json +32 -0
- data/node/node_modules/playwright/lib/mcp/terminal/helpGenerator.js +88 -0
- data/node/node_modules/playwright/lib/mcp/terminal/socketConnection.js +80 -0
- data/node/node_modules/playwright/lib/mcp/test/browserBackend.js +98 -0
- data/node/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- data/node/node_modules/playwright/lib/mcp/test/plannerTools.js +145 -0
- data/node/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- data/node/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- data/node/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- data/node/node_modules/playwright/lib/mcp/test/testContext.js +285 -0
- data/node/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- data/node/node_modules/playwright/lib/mcp/test/testTools.js +108 -0
- data/node/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +198 -0
- data/node/node_modules/playwright/lib/plugins/index.js +28 -0
- data/node/node_modules/playwright/lib/plugins/webServerPlugin.js +237 -0
- data/node/node_modules/playwright/lib/program.js +417 -0
- data/node/node_modules/playwright/lib/reporters/base.js +634 -0
- data/node/node_modules/playwright/lib/reporters/blob.js +138 -0
- data/node/node_modules/playwright/lib/reporters/dot.js +99 -0
- data/node/node_modules/playwright/lib/reporters/empty.js +32 -0
- data/node/node_modules/playwright/lib/reporters/github.js +128 -0
- data/node/node_modules/playwright/lib/reporters/html.js +633 -0
- data/node/node_modules/playwright/lib/reporters/internalReporter.js +138 -0
- data/node/node_modules/playwright/lib/reporters/json.js +254 -0
- data/node/node_modules/playwright/lib/reporters/junit.js +232 -0
- data/node/node_modules/playwright/lib/reporters/line.js +131 -0
- data/node/node_modules/playwright/lib/reporters/list.js +253 -0
- data/node/node_modules/playwright/lib/reporters/listModeReporter.js +69 -0
- data/node/node_modules/playwright/lib/reporters/markdown.js +144 -0
- data/node/node_modules/playwright/lib/reporters/merge.js +558 -0
- data/node/node_modules/playwright/lib/reporters/multiplexer.js +112 -0
- data/node/node_modules/playwright/lib/reporters/reporterV2.js +102 -0
- data/node/node_modules/playwright/lib/reporters/teleEmitter.js +317 -0
- data/node/node_modules/playwright/lib/reporters/versions/blobV1.js +16 -0
- data/node/node_modules/playwright/lib/runner/dispatcher.js +530 -0
- data/node/node_modules/playwright/lib/runner/failureTracker.js +72 -0
- data/node/node_modules/playwright/lib/runner/lastRun.js +77 -0
- data/node/node_modules/playwright/lib/runner/loadUtils.js +334 -0
- data/node/node_modules/playwright/lib/runner/loaderHost.js +89 -0
- data/node/node_modules/playwright/lib/runner/processHost.js +180 -0
- data/node/node_modules/playwright/lib/runner/projectUtils.js +241 -0
- data/node/node_modules/playwright/lib/runner/rebase.js +189 -0
- data/node/node_modules/playwright/lib/runner/reporters.js +138 -0
- data/node/node_modules/playwright/lib/runner/sigIntWatcher.js +96 -0
- data/node/node_modules/playwright/lib/runner/storage.js +91 -0
- data/node/node_modules/playwright/lib/runner/taskRunner.js +127 -0
- data/node/node_modules/playwright/lib/runner/tasks.js +410 -0
- data/node/node_modules/playwright/lib/runner/testGroups.js +125 -0
- data/node/node_modules/playwright/lib/runner/testRunner.js +398 -0
- data/node/node_modules/playwright/lib/runner/testServer.js +269 -0
- data/node/node_modules/playwright/lib/runner/uiModeReporter.js +30 -0
- data/node/node_modules/playwright/lib/runner/vcs.js +72 -0
- data/node/node_modules/playwright/lib/runner/watchMode.js +396 -0
- data/node/node_modules/playwright/lib/runner/workerHost.js +104 -0
- data/node/node_modules/playwright/lib/third_party/pirates.js +62 -0
- data/node/node_modules/playwright/lib/third_party/tsconfig-loader.js +103 -0
- data/node/node_modules/playwright/lib/transform/babelBundle.js +46 -0
- data/node/node_modules/playwright/lib/transform/babelBundleImpl.js +461 -0
- data/node/node_modules/playwright/lib/transform/compilationCache.js +274 -0
- data/node/node_modules/playwright/lib/transform/esmLoader.js +103 -0
- data/node/node_modules/playwright/lib/transform/md.js +221 -0
- data/node/node_modules/playwright/lib/transform/portTransport.js +67 -0
- data/node/node_modules/playwright/lib/transform/transform.js +303 -0
- data/node/node_modules/playwright/lib/util.js +400 -0
- data/node/node_modules/playwright/lib/utilsBundle.js +50 -0
- data/node/node_modules/playwright/lib/utilsBundleImpl.js +103 -0
- data/node/node_modules/playwright/lib/worker/fixtureRunner.js +262 -0
- data/node/node_modules/playwright/lib/worker/testInfo.js +536 -0
- data/node/node_modules/playwright/lib/worker/testTracing.js +345 -0
- data/node/node_modules/playwright/lib/worker/timeoutManager.js +174 -0
- data/node/node_modules/playwright/lib/worker/util.js +31 -0
- data/node/node_modules/playwright/lib/worker/workerMain.js +530 -0
- data/node/node_modules/playwright/package.json +72 -0
- data/node/node_modules/playwright/test.d.ts +18 -0
- data/node/node_modules/playwright/test.js +24 -0
- data/node/node_modules/playwright/test.mjs +34 -0
- data/node/node_modules/playwright/types/test.d.ts +10251 -0
- data/node/node_modules/playwright/types/testReporter.d.ts +822 -0
- data/node/node_modules/playwright-core/LICENSE +202 -0
- data/node/node_modules/playwright-core/NOTICE +5 -0
- data/node/node_modules/playwright-core/README.md +3 -0
- data/node/node_modules/playwright-core/ThirdPartyNotices.txt +4076 -0
- data/node/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- data/node/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- data/node/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- data/node/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- data/node/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- data/node/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- data/node/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- data/node/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- data/node/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- data/node/node_modules/playwright-core/browsers.json +79 -0
- data/node/node_modules/playwright-core/cli.js +18 -0
- data/node/node_modules/playwright-core/index.d.ts +17 -0
- data/node/node_modules/playwright-core/index.js +32 -0
- data/node/node_modules/playwright-core/index.mjs +28 -0
- data/node/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
- data/node/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
- data/node/node_modules/playwright-core/lib/cli/driver.js +97 -0
- data/node/node_modules/playwright-core/lib/cli/program.js +589 -0
- data/node/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
- data/node/node_modules/playwright-core/lib/client/android.js +361 -0
- data/node/node_modules/playwright-core/lib/client/api.js +137 -0
- data/node/node_modules/playwright-core/lib/client/artifact.js +79 -0
- data/node/node_modules/playwright-core/lib/client/browser.js +161 -0
- data/node/node_modules/playwright-core/lib/client/browserContext.js +582 -0
- data/node/node_modules/playwright-core/lib/client/browserType.js +185 -0
- data/node/node_modules/playwright-core/lib/client/cdpSession.js +51 -0
- data/node/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
- data/node/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
- data/node/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
- data/node/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
- data/node/node_modules/playwright-core/lib/client/clock.js +68 -0
- data/node/node_modules/playwright-core/lib/client/connection.js +318 -0
- data/node/node_modules/playwright-core/lib/client/consoleMessage.js +58 -0
- data/node/node_modules/playwright-core/lib/client/coverage.js +44 -0
- data/node/node_modules/playwright-core/lib/client/dialog.js +56 -0
- data/node/node_modules/playwright-core/lib/client/download.js +62 -0
- data/node/node_modules/playwright-core/lib/client/electron.js +138 -0
- data/node/node_modules/playwright-core/lib/client/elementHandle.js +284 -0
- data/node/node_modules/playwright-core/lib/client/errors.js +77 -0
- data/node/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
- data/node/node_modules/playwright-core/lib/client/events.js +103 -0
- data/node/node_modules/playwright-core/lib/client/fetch.js +368 -0
- data/node/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
- data/node/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
- data/node/node_modules/playwright-core/lib/client/frame.js +409 -0
- data/node/node_modules/playwright-core/lib/client/harRouter.js +87 -0
- data/node/node_modules/playwright-core/lib/client/input.js +84 -0
- data/node/node_modules/playwright-core/lib/client/jsHandle.js +109 -0
- data/node/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
- data/node/node_modules/playwright-core/lib/client/localUtils.js +60 -0
- data/node/node_modules/playwright-core/lib/client/locator.js +369 -0
- data/node/node_modules/playwright-core/lib/client/network.js +747 -0
- data/node/node_modules/playwright-core/lib/client/page.js +745 -0
- data/node/node_modules/playwright-core/lib/client/pageAgent.js +64 -0
- data/node/node_modules/playwright-core/lib/client/platform.js +77 -0
- data/node/node_modules/playwright-core/lib/client/playwright.js +71 -0
- data/node/node_modules/playwright-core/lib/client/selectors.js +55 -0
- data/node/node_modules/playwright-core/lib/client/stream.js +39 -0
- data/node/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
- data/node/node_modules/playwright-core/lib/client/tracing.js +119 -0
- data/node/node_modules/playwright-core/lib/client/types.js +28 -0
- data/node/node_modules/playwright-core/lib/client/video.js +59 -0
- data/node/node_modules/playwright-core/lib/client/waiter.js +142 -0
- data/node/node_modules/playwright-core/lib/client/webError.js +39 -0
- data/node/node_modules/playwright-core/lib/client/webSocket.js +93 -0
- data/node/node_modules/playwright-core/lib/client/worker.js +85 -0
- data/node/node_modules/playwright-core/lib/client/writableStream.js +39 -0
- data/node/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
- data/node/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
- data/node/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
- data/node/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
- data/node/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
- data/node/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
- data/node/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
- data/node/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
- data/node/node_modules/playwright-core/lib/inprocess.js +3 -0
- data/node/node_modules/playwright-core/lib/mcpBundle.js +84 -0
- data/node/node_modules/playwright-core/lib/mcpBundleImpl/index.js +147 -0
- data/node/node_modules/playwright-core/lib/outofprocess.js +76 -0
- data/node/node_modules/playwright-core/lib/protocol/serializers.js +197 -0
- data/node/node_modules/playwright-core/lib/protocol/validator.js +2969 -0
- data/node/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
- data/node/node_modules/playwright-core/lib/remote/playwrightConnection.js +129 -0
- data/node/node_modules/playwright-core/lib/remote/playwrightServer.js +334 -0
- data/node/node_modules/playwright-core/lib/server/agent/actionRunner.js +335 -0
- data/node/node_modules/playwright-core/lib/server/agent/actions.js +128 -0
- data/node/node_modules/playwright-core/lib/server/agent/codegen.js +111 -0
- data/node/node_modules/playwright-core/lib/server/agent/context.js +150 -0
- data/node/node_modules/playwright-core/lib/server/agent/expectTools.js +156 -0
- data/node/node_modules/playwright-core/lib/server/agent/pageAgent.js +204 -0
- data/node/node_modules/playwright-core/lib/server/agent/performTools.js +262 -0
- data/node/node_modules/playwright-core/lib/server/agent/tool.js +109 -0
- data/node/node_modules/playwright-core/lib/server/android/android.js +465 -0
- data/node/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
- data/node/node_modules/playwright-core/lib/server/artifact.js +127 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +549 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +148 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +213 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiDeserializer.js +116 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +267 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +128 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +383 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiPage.js +583 -0
- data/node/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
- data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +180 -0
- data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- data/node/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- data/node/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
- data/node/node_modules/playwright-core/lib/server/browser.js +149 -0
- data/node/node_modules/playwright-core/lib/server/browserContext.js +702 -0
- data/node/node_modules/playwright-core/lib/server/browserType.js +336 -0
- data/node/node_modules/playwright-core/lib/server/callLog.js +82 -0
- data/node/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- data/node/node_modules/playwright-core/lib/server/chromium/chromium.js +395 -0
- data/node/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crBrowser.js +511 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crConnection.js +197 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crDevTools.js +111 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +707 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crPage.js +1001 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
- data/node/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +136 -0
- data/node/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
- data/node/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
- data/node/node_modules/playwright-core/lib/server/clock.js +149 -0
- data/node/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
- data/node/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
- data/node/node_modules/playwright-core/lib/server/codegen/javascript.js +247 -0
- data/node/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
- data/node/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
- data/node/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
- data/node/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
- data/node/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
- data/node/node_modules/playwright-core/lib/server/console.js +57 -0
- data/node/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
- data/node/node_modules/playwright-core/lib/server/debugController.js +191 -0
- data/node/node_modules/playwright-core/lib/server/debugger.js +119 -0
- data/node/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
- data/node/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
- data/node/node_modules/playwright-core/lib/server/dialog.js +116 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +384 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +118 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +364 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +89 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +213 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/pageAgentDispatcher.js +96 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +393 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
- data/node/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- data/node/node_modules/playwright-core/lib/server/dom.js +815 -0
- data/node/node_modules/playwright-core/lib/server/download.js +70 -0
- data/node/node_modules/playwright-core/lib/server/electron/electron.js +273 -0
- data/node/node_modules/playwright-core/lib/server/electron/loader.js +29 -0
- data/node/node_modules/playwright-core/lib/server/errors.js +69 -0
- data/node/node_modules/playwright-core/lib/server/fetch.js +621 -0
- data/node/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
- data/node/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
- data/node/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +418 -0
- data/node/node_modules/playwright-core/lib/server/firefox/ffConnection.js +142 -0
- data/node/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
- data/node/node_modules/playwright-core/lib/server/firefox/ffInput.js +159 -0
- data/node/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
- data/node/node_modules/playwright-core/lib/server/firefox/ffPage.js +497 -0
- data/node/node_modules/playwright-core/lib/server/firefox/firefox.js +114 -0
- data/node/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
- data/node/node_modules/playwright-core/lib/server/formData.js +147 -0
- data/node/node_modules/playwright-core/lib/server/frameSelectors.js +160 -0
- data/node/node_modules/playwright-core/lib/server/frames.js +1471 -0
- data/node/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
- data/node/node_modules/playwright-core/lib/server/har/harTracer.js +607 -0
- data/node/node_modules/playwright-core/lib/server/harBackend.js +157 -0
- data/node/node_modules/playwright-core/lib/server/helper.js +96 -0
- data/node/node_modules/playwright-core/lib/server/index.js +58 -0
- data/node/node_modules/playwright-core/lib/server/input.js +277 -0
- data/node/node_modules/playwright-core/lib/server/instrumentation.js +72 -0
- data/node/node_modules/playwright-core/lib/server/javascript.js +291 -0
- data/node/node_modules/playwright-core/lib/server/launchApp.js +128 -0
- data/node/node_modules/playwright-core/lib/server/localUtils.js +214 -0
- data/node/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
- data/node/node_modules/playwright-core/lib/server/network.js +667 -0
- data/node/node_modules/playwright-core/lib/server/page.js +830 -0
- data/node/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
- data/node/node_modules/playwright-core/lib/server/playwright.js +69 -0
- data/node/node_modules/playwright-core/lib/server/progress.js +132 -0
- data/node/node_modules/playwright-core/lib/server/protocolError.js +52 -0
- data/node/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
- data/node/node_modules/playwright-core/lib/server/recorder/recorderApp.js +366 -0
- data/node/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
- data/node/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
- data/node/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
- data/node/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
- data/node/node_modules/playwright-core/lib/server/recorder.js +499 -0
- data/node/node_modules/playwright-core/lib/server/registry/browserFetcher.js +177 -0
- data/node/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
- data/node/node_modules/playwright-core/lib/server/registry/index.js +1422 -0
- data/node/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1280 -0
- data/node/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +127 -0
- data/node/node_modules/playwright-core/lib/server/screencast.js +190 -0
- data/node/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
- data/node/node_modules/playwright-core/lib/server/selectors.js +112 -0
- data/node/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
- data/node/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
- data/node/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
- data/node/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +561 -0
- data/node/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +604 -0
- data/node/node_modules/playwright-core/lib/server/trace/viewer/traceParser.js +72 -0
- data/node/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +245 -0
- data/node/node_modules/playwright-core/lib/server/transport.js +181 -0
- data/node/node_modules/playwright-core/lib/server/types.js +28 -0
- data/node/node_modules/playwright-core/lib/server/usKeyboardLayout.js +145 -0
- data/node/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
- data/node/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
- data/node/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
- data/node/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
- data/node/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
- data/node/node_modules/playwright-core/lib/server/utils/env.js +73 -0
- data/node/node_modules/playwright-core/lib/server/utils/eventsHelper.js +39 -0
- data/node/node_modules/playwright-core/lib/server/utils/expectUtils.js +123 -0
- data/node/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
- data/node/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
- data/node/node_modules/playwright-core/lib/server/utils/hostPlatform.js +123 -0
- data/node/node_modules/playwright-core/lib/server/utils/httpServer.js +203 -0
- data/node/node_modules/playwright-core/lib/server/utils/imageUtils.js +141 -0
- data/node/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
- data/node/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
- data/node/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
- data/node/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
- data/node/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
- data/node/node_modules/playwright-core/lib/server/utils/network.js +242 -0
- data/node/node_modules/playwright-core/lib/server/utils/nodePlatform.js +154 -0
- data/node/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
- data/node/node_modules/playwright-core/lib/server/utils/processLauncher.js +241 -0
- data/node/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
- data/node/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
- data/node/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
- data/node/node_modules/playwright-core/lib/server/utils/task.js +51 -0
- data/node/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
- data/node/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
- data/node/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
- data/node/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
- data/node/node_modules/playwright-core/lib/server/videoRecorder.js +124 -0
- data/node/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
- data/node/node_modules/playwright-core/lib/server/webkit/webkit.js +108 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +335 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkConnection.js +144 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +197 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkPage.js +1158 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
- data/node/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +105 -0
- data/node/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +455 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/lruCache.js +51 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +459 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +330 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +204 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/entries.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotRenderer.js +499 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/traceLoader.js +131 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModel.js +365 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModernizer.js +400 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +58 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +190 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- data/node/node_modules/playwright-core/lib/utils/isomorphic/yaml.js +84 -0
- data/node/node_modules/playwright-core/lib/utils.js +111 -0
- data/node/node_modules/playwright-core/lib/utilsBundle.js +109 -0
- data/node/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
- data/node/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +1066 -0
- data/node/node_modules/playwright-core/lib/vite/htmlReport/index.html +84 -0
- data/node/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
- data/node/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DadYNm1I.js +32 -0
- data/node/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- data/node/node_modules/playwright-core/lib/vite/recorder/assets/index-BSjZa4pk.css +1 -0
- data/node/node_modules/playwright-core/lib/vite/recorder/assets/index-BhTWtUlo.js +193 -0
- data/node/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- data/node/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-a5XoALAZ.js +32 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-CJSZINFr.js +266 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +1 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/index.BVu7tZDe.css +1 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/index.Bk2uYQRV.js +2 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/index.html +43 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +21 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +5 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CQJ9SCIQ.js +5 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +17 -0
- data/node/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- data/node/node_modules/playwright-core/lib/zipBundle.js +34 -0
- data/node/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
- data/node/node_modules/playwright-core/package.json +43 -0
- data/node/node_modules/playwright-core/types/protocol.d.ts +23824 -0
- data/node/node_modules/playwright-core/types/structs.d.ts +45 -0
- data/node/node_modules/playwright-core/types/types.d.ts +22843 -0
- data/node/package-lock.json +72 -0
- data/node/package.json +14 -0
- data/node/src/index.js +215 -0
- data/rubycrawl.gemspec +29 -0
- data/spec/rubycrawl_spec.rb +51 -0
- data/spec/spec_helper.rb +11 -0
- metadata +645 -0
|
@@ -0,0 +1,278 @@
|
|
|
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 response_exports = {};
|
|
30
|
+
__export(response_exports, {
|
|
31
|
+
Response: () => Response,
|
|
32
|
+
parseResponse: () => parseResponse,
|
|
33
|
+
renderTabMarkdown: () => renderTabMarkdown,
|
|
34
|
+
renderTabsMarkdown: () => renderTabsMarkdown,
|
|
35
|
+
requestDebug: () => requestDebug
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(response_exports);
|
|
38
|
+
var import_fs = __toESM(require("fs"));
|
|
39
|
+
var import_path = __toESM(require("path"));
|
|
40
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
41
|
+
var import_tab = require("./tab");
|
|
42
|
+
var import_utils = require("./tools/utils");
|
|
43
|
+
const requestDebug = (0, import_utilsBundle.debug)("pw:mcp:request");
|
|
44
|
+
class Response {
|
|
45
|
+
constructor(ordinal, context, toolName, toolArgs) {
|
|
46
|
+
this._results = [];
|
|
47
|
+
this._errors = [];
|
|
48
|
+
this._code = [];
|
|
49
|
+
this._images = [];
|
|
50
|
+
this._includeSnapshot = "none";
|
|
51
|
+
this._ordinal = ordinal;
|
|
52
|
+
this._context = context;
|
|
53
|
+
this.toolName = toolName;
|
|
54
|
+
this.toolArgs = toolArgs;
|
|
55
|
+
}
|
|
56
|
+
static {
|
|
57
|
+
this._ordinal = 0;
|
|
58
|
+
}
|
|
59
|
+
static create(context, toolName, toolArgs) {
|
|
60
|
+
return new Response(++Response._ordinal, context, toolName, toolArgs);
|
|
61
|
+
}
|
|
62
|
+
addTextResult(result) {
|
|
63
|
+
this._results.push({ text: result });
|
|
64
|
+
}
|
|
65
|
+
async addResult(result) {
|
|
66
|
+
if (result.data && !result.suggestedFilename)
|
|
67
|
+
result.suggestedFilename = (0, import_utils.dateAsFileName)(result.ext ?? "bin");
|
|
68
|
+
if (this._context.config.outputMode === "file") {
|
|
69
|
+
if (!result.suggestedFilename)
|
|
70
|
+
result.suggestedFilename = (0, import_utils.dateAsFileName)(result.ext ?? (result.text ? "txt" : "bin"));
|
|
71
|
+
}
|
|
72
|
+
const entry = { text: result.text, data: result.data, title: result.title };
|
|
73
|
+
if (result.suggestedFilename)
|
|
74
|
+
entry.filename = await this._context.outputFile(result.suggestedFilename, { origin: "llm", title: result.title ?? "Saved result" });
|
|
75
|
+
this._results.push(entry);
|
|
76
|
+
return { fileName: entry.filename };
|
|
77
|
+
}
|
|
78
|
+
addError(error) {
|
|
79
|
+
this._errors.push(error);
|
|
80
|
+
}
|
|
81
|
+
addCode(code) {
|
|
82
|
+
this._code.push(code);
|
|
83
|
+
}
|
|
84
|
+
addImage(image) {
|
|
85
|
+
this._images.push(image);
|
|
86
|
+
}
|
|
87
|
+
setIncludeSnapshot() {
|
|
88
|
+
this._includeSnapshot = this._context.config.snapshot.mode;
|
|
89
|
+
}
|
|
90
|
+
setIncludeFullSnapshot(includeSnapshotFileName) {
|
|
91
|
+
this._includeSnapshot = "full";
|
|
92
|
+
this._includeSnapshotFileName = includeSnapshotFileName;
|
|
93
|
+
}
|
|
94
|
+
async build() {
|
|
95
|
+
const rootPath = this._context.firstRootPath();
|
|
96
|
+
const sections = [];
|
|
97
|
+
const addSection = (title) => {
|
|
98
|
+
const section = { title, content: [] };
|
|
99
|
+
sections.push(section);
|
|
100
|
+
return section.content;
|
|
101
|
+
};
|
|
102
|
+
if (this._errors.length) {
|
|
103
|
+
const text = addSection("Error");
|
|
104
|
+
text.push("### Error");
|
|
105
|
+
text.push(this._errors.join("\n"));
|
|
106
|
+
}
|
|
107
|
+
if (this._results.length) {
|
|
108
|
+
const text = addSection("Result");
|
|
109
|
+
for (const result of this._results) {
|
|
110
|
+
if (result.filename) {
|
|
111
|
+
text.push(`- [${result.title}](${rootPath ? import_path.default.relative(rootPath, result.filename) : result.filename})`);
|
|
112
|
+
if (result.data)
|
|
113
|
+
await import_fs.default.promises.writeFile(result.filename, result.data);
|
|
114
|
+
else if (result.text)
|
|
115
|
+
await import_fs.default.promises.writeFile(result.filename, this._redactText(result.text));
|
|
116
|
+
} else if (result.text) {
|
|
117
|
+
text.push(result.text);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (this._context.config.codegen !== "none" && this._code.length) {
|
|
122
|
+
const text = addSection("Ran Playwright code");
|
|
123
|
+
text.push(...this._code);
|
|
124
|
+
}
|
|
125
|
+
const tabSnapshot = this._context.currentTab() ? await this._context.currentTabOrDie().captureSnapshot() : void 0;
|
|
126
|
+
const tabHeaders = await Promise.all(this._context.tabs().map((tab) => tab.headerSnapshot()));
|
|
127
|
+
if (tabHeaders.some((header) => header.changed)) {
|
|
128
|
+
if (tabHeaders.length !== 1) {
|
|
129
|
+
const text2 = addSection("Open tabs");
|
|
130
|
+
text2.push(...renderTabsMarkdown(tabHeaders));
|
|
131
|
+
}
|
|
132
|
+
const text = addSection("Page");
|
|
133
|
+
text.push(...renderTabMarkdown(tabHeaders[0]));
|
|
134
|
+
}
|
|
135
|
+
if (tabSnapshot?.modalStates.length) {
|
|
136
|
+
const text = addSection("Modal state");
|
|
137
|
+
text.push(...(0, import_tab.renderModalStates)(tabSnapshot.modalStates));
|
|
138
|
+
}
|
|
139
|
+
if (tabSnapshot && this._includeSnapshot === "full") {
|
|
140
|
+
let fileName;
|
|
141
|
+
if (this._includeSnapshotFileName)
|
|
142
|
+
fileName = await this._context.outputFile(this._includeSnapshotFileName, { origin: "llm", title: "Saved snapshot" });
|
|
143
|
+
else if (this._context.config.outputMode === "file")
|
|
144
|
+
fileName = await this._context.outputFile(`snapshot-${this._ordinal}.yml`, { origin: "code", title: "Saved snapshot" });
|
|
145
|
+
if (fileName) {
|
|
146
|
+
await import_fs.default.promises.writeFile(fileName, tabSnapshot.ariaSnapshot);
|
|
147
|
+
const text = addSection("Snapshot");
|
|
148
|
+
text.push(`- File: ${rootPath ? import_path.default.relative(rootPath, fileName) : fileName}`);
|
|
149
|
+
} else {
|
|
150
|
+
const text = addSection("Snapshot");
|
|
151
|
+
text.push("```yaml");
|
|
152
|
+
text.push(tabSnapshot.ariaSnapshot);
|
|
153
|
+
text.push("```");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (tabSnapshot && this._includeSnapshot === "incremental") {
|
|
157
|
+
const text = addSection("Snapshot");
|
|
158
|
+
text.push("```yaml");
|
|
159
|
+
if (tabSnapshot.ariaSnapshotDiff !== void 0)
|
|
160
|
+
text.push(tabSnapshot.ariaSnapshotDiff);
|
|
161
|
+
else
|
|
162
|
+
text.push(tabSnapshot.ariaSnapshot);
|
|
163
|
+
text.push("```");
|
|
164
|
+
}
|
|
165
|
+
if (tabSnapshot?.events.filter((event) => event.type !== "request").length) {
|
|
166
|
+
const text = addSection("Events");
|
|
167
|
+
for (const event of tabSnapshot.events) {
|
|
168
|
+
if (event.type === "console") {
|
|
169
|
+
if ((0, import_tab.shouldIncludeMessage)(this._context.config.console.level, event.message.type))
|
|
170
|
+
text.push(`- ${trimMiddle(event.message.toString(), 100)}`);
|
|
171
|
+
} else if (event.type === "download-start") {
|
|
172
|
+
text.push(`- Downloading file ${event.download.download.suggestedFilename()} ...`);
|
|
173
|
+
} else if (event.type === "download-finish") {
|
|
174
|
+
text.push(`- Downloaded file ${event.download.download.suggestedFilename()} to "${rootPath ? import_path.default.relative(rootPath, event.download.outputFile) : event.download.outputFile}"`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const allText = sections.flatMap((section) => {
|
|
179
|
+
const content2 = [];
|
|
180
|
+
content2.push(`### ${section.title}`);
|
|
181
|
+
content2.push(...section.content);
|
|
182
|
+
content2.push("");
|
|
183
|
+
return content2;
|
|
184
|
+
}).join("\n");
|
|
185
|
+
const content = [
|
|
186
|
+
{
|
|
187
|
+
type: "text",
|
|
188
|
+
text: this._redactText(allText)
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
if (this._context.config.imageResponses !== "omit") {
|
|
192
|
+
for (const image of this._images)
|
|
193
|
+
content.push({ type: "image", data: image.data.toString("base64"), mimeType: image.contentType });
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
content,
|
|
197
|
+
...this._errors.length > 0 ? { isError: true } : {}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
_redactText(text) {
|
|
201
|
+
for (const [secretName, secretValue] of Object.entries(this._context.config.secrets ?? {}))
|
|
202
|
+
text = text.replaceAll(secretValue, `<secret>${secretName}</secret>`);
|
|
203
|
+
return text;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function renderTabMarkdown(tab) {
|
|
207
|
+
const lines = [`- Page URL: ${tab.url}`];
|
|
208
|
+
if (tab.title)
|
|
209
|
+
lines.push(`- Page Title: ${tab.title}`);
|
|
210
|
+
return lines;
|
|
211
|
+
}
|
|
212
|
+
function renderTabsMarkdown(tabs) {
|
|
213
|
+
if (!tabs.length)
|
|
214
|
+
return ['No open tabs. Use the "browser_navigate" tool to navigate to a page first.'];
|
|
215
|
+
const lines = [];
|
|
216
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
217
|
+
const tab = tabs[i];
|
|
218
|
+
const current = tab.current ? " (current)" : "";
|
|
219
|
+
lines.push(`- ${i}:${current} [${tab.title}](${tab.url})`);
|
|
220
|
+
}
|
|
221
|
+
return lines;
|
|
222
|
+
}
|
|
223
|
+
function trimMiddle(text, maxLength) {
|
|
224
|
+
if (text.length <= maxLength)
|
|
225
|
+
return text;
|
|
226
|
+
return text.slice(0, Math.floor(maxLength / 2)) + "..." + text.slice(-3 - Math.floor(maxLength / 2));
|
|
227
|
+
}
|
|
228
|
+
function parseSections(text) {
|
|
229
|
+
const sections = /* @__PURE__ */ new Map();
|
|
230
|
+
const sectionHeaders = text.split(/^### /m).slice(1);
|
|
231
|
+
for (const section of sectionHeaders) {
|
|
232
|
+
const firstNewlineIndex = section.indexOf("\n");
|
|
233
|
+
if (firstNewlineIndex === -1)
|
|
234
|
+
continue;
|
|
235
|
+
const sectionName = section.substring(0, firstNewlineIndex);
|
|
236
|
+
const sectionContent = section.substring(firstNewlineIndex + 1).trim();
|
|
237
|
+
sections.set(sectionName, sectionContent);
|
|
238
|
+
}
|
|
239
|
+
return sections;
|
|
240
|
+
}
|
|
241
|
+
function parseResponse(response) {
|
|
242
|
+
if (response.content?.[0].type !== "text")
|
|
243
|
+
return void 0;
|
|
244
|
+
const text = response.content[0].text;
|
|
245
|
+
const sections = parseSections(text);
|
|
246
|
+
const error = sections.get("Error");
|
|
247
|
+
const result = sections.get("Result");
|
|
248
|
+
const code = sections.get("Ran Playwright code");
|
|
249
|
+
const tabs = sections.get("Open tabs");
|
|
250
|
+
const page = sections.get("Page");
|
|
251
|
+
const snapshot = sections.get("Snapshot");
|
|
252
|
+
const events = sections.get("Events");
|
|
253
|
+
const modalState = sections.get("Modal state");
|
|
254
|
+
const codeNoFrame = code?.replace(/^```js\n/, "").replace(/\n```$/, "");
|
|
255
|
+
const isError = response.isError;
|
|
256
|
+
const attachments = response.content.length > 1 ? response.content.slice(1) : void 0;
|
|
257
|
+
return {
|
|
258
|
+
result,
|
|
259
|
+
error,
|
|
260
|
+
code: codeNoFrame,
|
|
261
|
+
tabs,
|
|
262
|
+
page,
|
|
263
|
+
snapshot,
|
|
264
|
+
events,
|
|
265
|
+
modalState,
|
|
266
|
+
isError,
|
|
267
|
+
attachments,
|
|
268
|
+
text
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
272
|
+
0 && (module.exports = {
|
|
273
|
+
Response,
|
|
274
|
+
parseResponse,
|
|
275
|
+
renderTabMarkdown,
|
|
276
|
+
renderTabsMarkdown,
|
|
277
|
+
requestDebug
|
|
278
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
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 sessionLog_exports = {};
|
|
30
|
+
__export(sessionLog_exports, {
|
|
31
|
+
SessionLog: () => SessionLog
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(sessionLog_exports);
|
|
34
|
+
var import_fs = __toESM(require("fs"));
|
|
35
|
+
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_config = require("./config");
|
|
37
|
+
var import_response = require("./response");
|
|
38
|
+
class SessionLog {
|
|
39
|
+
constructor(sessionFolder) {
|
|
40
|
+
this._sessionFileQueue = Promise.resolve();
|
|
41
|
+
this._folder = sessionFolder;
|
|
42
|
+
this._file = import_path.default.join(this._folder, "session.md");
|
|
43
|
+
}
|
|
44
|
+
static async create(config, clientInfo) {
|
|
45
|
+
const sessionFolder = await (0, import_config.outputFile)(config, clientInfo, `session-${Date.now()}`, { origin: "code", title: "Saving session" });
|
|
46
|
+
await import_fs.default.promises.mkdir(sessionFolder, { recursive: true });
|
|
47
|
+
console.error(`Session: ${sessionFolder}`);
|
|
48
|
+
return new SessionLog(sessionFolder);
|
|
49
|
+
}
|
|
50
|
+
logResponse(toolName, toolArgs, responseObject) {
|
|
51
|
+
const parsed = (0, import_response.parseResponse)(responseObject);
|
|
52
|
+
if (parsed)
|
|
53
|
+
delete parsed.text;
|
|
54
|
+
const lines = [""];
|
|
55
|
+
lines.push(
|
|
56
|
+
`### Tool call: ${toolName}`,
|
|
57
|
+
`- Args`,
|
|
58
|
+
"```json",
|
|
59
|
+
JSON.stringify(toolArgs, null, 2),
|
|
60
|
+
"```"
|
|
61
|
+
);
|
|
62
|
+
if (parsed) {
|
|
63
|
+
lines.push(`- Result`);
|
|
64
|
+
lines.push("```json");
|
|
65
|
+
lines.push(JSON.stringify(parsed, null, 2));
|
|
66
|
+
lines.push("```");
|
|
67
|
+
}
|
|
68
|
+
lines.push("");
|
|
69
|
+
this._sessionFileQueue = this._sessionFileQueue.then(() => import_fs.default.promises.appendFile(this._file, lines.join("\n")));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
+
0 && (module.exports = {
|
|
74
|
+
SessionLog
|
|
75
|
+
});
|
|
@@ -0,0 +1,343 @@
|
|
|
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 tab_exports = {};
|
|
20
|
+
__export(tab_exports, {
|
|
21
|
+
Tab: () => Tab,
|
|
22
|
+
TabEvents: () => TabEvents,
|
|
23
|
+
renderModalStates: () => renderModalStates,
|
|
24
|
+
shouldIncludeMessage: () => shouldIncludeMessage
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(tab_exports);
|
|
27
|
+
var import_events = require("events");
|
|
28
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
29
|
+
var import_utils2 = require("./tools/utils");
|
|
30
|
+
var import_log = require("../log");
|
|
31
|
+
var import_dialogs = require("./tools/dialogs");
|
|
32
|
+
var import_files = require("./tools/files");
|
|
33
|
+
var import_transform = require("../../transform/transform");
|
|
34
|
+
const TabEvents = {
|
|
35
|
+
modalState: "modalState"
|
|
36
|
+
};
|
|
37
|
+
class Tab extends import_events.EventEmitter {
|
|
38
|
+
constructor(context, page, onPageClose) {
|
|
39
|
+
super();
|
|
40
|
+
this._lastHeader = { title: "about:blank", url: "about:blank", current: false };
|
|
41
|
+
this._consoleMessages = [];
|
|
42
|
+
this._downloads = [];
|
|
43
|
+
this._requests = /* @__PURE__ */ new Set();
|
|
44
|
+
this._modalStates = [];
|
|
45
|
+
this._needsFullSnapshot = false;
|
|
46
|
+
this._eventEntries = [];
|
|
47
|
+
this._recentEventEntries = [];
|
|
48
|
+
this.context = context;
|
|
49
|
+
this.page = page;
|
|
50
|
+
this._onPageClose = onPageClose;
|
|
51
|
+
page.on("console", (event) => this._handleConsoleMessage(messageToConsoleMessage(event)));
|
|
52
|
+
page.on("pageerror", (error) => this._handleConsoleMessage(pageErrorToConsoleMessage(error)));
|
|
53
|
+
page.on("request", (request) => this._handleRequest(request));
|
|
54
|
+
page.on("close", () => this._onClose());
|
|
55
|
+
page.on("filechooser", (chooser) => {
|
|
56
|
+
this.setModalState({
|
|
57
|
+
type: "fileChooser",
|
|
58
|
+
description: "File chooser",
|
|
59
|
+
fileChooser: chooser,
|
|
60
|
+
clearedBy: import_files.uploadFile.schema.name
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
page.on("dialog", (dialog) => this._dialogShown(dialog));
|
|
64
|
+
page.on("download", (download) => {
|
|
65
|
+
void this._downloadStarted(download);
|
|
66
|
+
});
|
|
67
|
+
page.setDefaultNavigationTimeout(this.context.config.timeouts.navigation);
|
|
68
|
+
page.setDefaultTimeout(this.context.config.timeouts.action);
|
|
69
|
+
page[tabSymbol] = this;
|
|
70
|
+
this._initializedPromise = this._initialize();
|
|
71
|
+
}
|
|
72
|
+
static forPage(page) {
|
|
73
|
+
return page[tabSymbol];
|
|
74
|
+
}
|
|
75
|
+
static async collectConsoleMessages(page) {
|
|
76
|
+
const result = [];
|
|
77
|
+
const messages = await page.consoleMessages().catch(() => []);
|
|
78
|
+
for (const message of messages)
|
|
79
|
+
result.push(messageToConsoleMessage(message));
|
|
80
|
+
const errors = await page.pageErrors().catch(() => []);
|
|
81
|
+
for (const error of errors)
|
|
82
|
+
result.push(pageErrorToConsoleMessage(error));
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
async _initialize() {
|
|
86
|
+
for (const message of await Tab.collectConsoleMessages(this.page))
|
|
87
|
+
this._handleConsoleMessage(message);
|
|
88
|
+
const requests = await this.page.requests().catch(() => []);
|
|
89
|
+
for (const request of requests)
|
|
90
|
+
this._requests.add(request);
|
|
91
|
+
for (const initPage of this.context.config.browser.initPage || []) {
|
|
92
|
+
try {
|
|
93
|
+
const { default: func } = await (0, import_transform.requireOrImport)(initPage);
|
|
94
|
+
await func({ page: this.page });
|
|
95
|
+
} catch (e) {
|
|
96
|
+
(0, import_log.logUnhandledError)(e);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
modalStates() {
|
|
101
|
+
return this._modalStates;
|
|
102
|
+
}
|
|
103
|
+
setModalState(modalState) {
|
|
104
|
+
this._modalStates.push(modalState);
|
|
105
|
+
this.emit(TabEvents.modalState, modalState);
|
|
106
|
+
}
|
|
107
|
+
clearModalState(modalState) {
|
|
108
|
+
this._modalStates = this._modalStates.filter((state) => state !== modalState);
|
|
109
|
+
}
|
|
110
|
+
_dialogShown(dialog) {
|
|
111
|
+
this.setModalState({
|
|
112
|
+
type: "dialog",
|
|
113
|
+
description: `"${dialog.type()}" dialog with message "${dialog.message()}"`,
|
|
114
|
+
dialog,
|
|
115
|
+
clearedBy: import_dialogs.handleDialog.schema.name
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
async _downloadStarted(download) {
|
|
119
|
+
const entry = {
|
|
120
|
+
download,
|
|
121
|
+
finished: false,
|
|
122
|
+
outputFile: await this.context.outputFile(download.suggestedFilename(), { origin: "web", title: "Saving download" })
|
|
123
|
+
};
|
|
124
|
+
this._downloads.push(entry);
|
|
125
|
+
this._addLogEntry({ type: "download-start", wallTime: Date.now(), download: entry });
|
|
126
|
+
await download.saveAs(entry.outputFile);
|
|
127
|
+
entry.finished = true;
|
|
128
|
+
this._addLogEntry({ type: "download-finish", wallTime: Date.now(), download: entry });
|
|
129
|
+
}
|
|
130
|
+
_clearCollectedArtifacts() {
|
|
131
|
+
this._consoleMessages.length = 0;
|
|
132
|
+
this._downloads.length = 0;
|
|
133
|
+
this._requests.clear();
|
|
134
|
+
this._eventEntries.length = 0;
|
|
135
|
+
this._recentEventEntries.length = 0;
|
|
136
|
+
}
|
|
137
|
+
_handleRequest(request) {
|
|
138
|
+
this._requests.add(request);
|
|
139
|
+
this._addLogEntry({ type: "request", wallTime: Date.now(), request });
|
|
140
|
+
}
|
|
141
|
+
_handleConsoleMessage(message) {
|
|
142
|
+
this._consoleMessages.push(message);
|
|
143
|
+
this._addLogEntry({ type: "console", wallTime: Date.now(), message });
|
|
144
|
+
}
|
|
145
|
+
_addLogEntry(entry) {
|
|
146
|
+
this._eventEntries.push(entry);
|
|
147
|
+
this._recentEventEntries.push(entry);
|
|
148
|
+
}
|
|
149
|
+
_onClose() {
|
|
150
|
+
this._clearCollectedArtifacts();
|
|
151
|
+
this._onPageClose(this);
|
|
152
|
+
}
|
|
153
|
+
async headerSnapshot() {
|
|
154
|
+
let title;
|
|
155
|
+
await this._raceAgainstModalStates(async () => {
|
|
156
|
+
title = await (0, import_utils2.callOnPageNoTrace)(this.page, (page) => page.title());
|
|
157
|
+
});
|
|
158
|
+
if (this._lastHeader.title !== title || this._lastHeader.url !== this.page.url() || this._lastHeader.current !== this.isCurrentTab()) {
|
|
159
|
+
this._lastHeader = { title: title ?? "", url: this.page.url(), current: this.isCurrentTab() };
|
|
160
|
+
return { ...this._lastHeader, changed: true };
|
|
161
|
+
}
|
|
162
|
+
return { ...this._lastHeader, changed: false };
|
|
163
|
+
}
|
|
164
|
+
isCurrentTab() {
|
|
165
|
+
return this === this.context.currentTab();
|
|
166
|
+
}
|
|
167
|
+
async waitForLoadState(state, options) {
|
|
168
|
+
await this._initializedPromise;
|
|
169
|
+
await (0, import_utils2.callOnPageNoTrace)(this.page, (page) => page.waitForLoadState(state, options).catch(import_log.logUnhandledError));
|
|
170
|
+
}
|
|
171
|
+
async navigate(url) {
|
|
172
|
+
await this._initializedPromise;
|
|
173
|
+
this._clearCollectedArtifacts();
|
|
174
|
+
const { promise: downloadEvent, abort: abortDownloadEvent } = (0, import_utils2.eventWaiter)(this.page, "download", 3e3);
|
|
175
|
+
try {
|
|
176
|
+
await this.page.goto(url, { waitUntil: "domcontentloaded" });
|
|
177
|
+
abortDownloadEvent();
|
|
178
|
+
} catch (_e) {
|
|
179
|
+
const e = _e;
|
|
180
|
+
const mightBeDownload = e.message.includes("net::ERR_ABORTED") || e.message.includes("Download is starting");
|
|
181
|
+
if (!mightBeDownload)
|
|
182
|
+
throw e;
|
|
183
|
+
const download = await downloadEvent;
|
|
184
|
+
if (!download)
|
|
185
|
+
throw e;
|
|
186
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
await this.waitForLoadState("load", { timeout: 5e3 });
|
|
190
|
+
}
|
|
191
|
+
async consoleMessages(level) {
|
|
192
|
+
await this._initializedPromise;
|
|
193
|
+
return this._consoleMessages.filter((message) => shouldIncludeMessage(level, message.type));
|
|
194
|
+
}
|
|
195
|
+
async requests() {
|
|
196
|
+
await this._initializedPromise;
|
|
197
|
+
return this._requests;
|
|
198
|
+
}
|
|
199
|
+
async captureSnapshot() {
|
|
200
|
+
await this._initializedPromise;
|
|
201
|
+
let tabSnapshot;
|
|
202
|
+
const modalStates = await this._raceAgainstModalStates(async () => {
|
|
203
|
+
const snapshot = await this.page._snapshotForAI({ track: "response" });
|
|
204
|
+
tabSnapshot = {
|
|
205
|
+
ariaSnapshot: snapshot.full,
|
|
206
|
+
ariaSnapshotDiff: this._needsFullSnapshot ? void 0 : snapshot.incremental,
|
|
207
|
+
modalStates: [],
|
|
208
|
+
events: []
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
if (tabSnapshot) {
|
|
212
|
+
tabSnapshot.events = this._recentEventEntries;
|
|
213
|
+
this._recentEventEntries = [];
|
|
214
|
+
}
|
|
215
|
+
this._needsFullSnapshot = !tabSnapshot;
|
|
216
|
+
return tabSnapshot ?? {
|
|
217
|
+
ariaSnapshot: "",
|
|
218
|
+
ariaSnapshotDiff: "",
|
|
219
|
+
modalStates,
|
|
220
|
+
events: []
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
_javaScriptBlocked() {
|
|
224
|
+
return this._modalStates.some((state) => state.type === "dialog");
|
|
225
|
+
}
|
|
226
|
+
async _raceAgainstModalStates(action) {
|
|
227
|
+
if (this.modalStates().length)
|
|
228
|
+
return this.modalStates();
|
|
229
|
+
const promise = new import_utils.ManualPromise();
|
|
230
|
+
const listener = (modalState) => promise.resolve([modalState]);
|
|
231
|
+
this.once(TabEvents.modalState, listener);
|
|
232
|
+
return await Promise.race([
|
|
233
|
+
action().then(() => {
|
|
234
|
+
this.off(TabEvents.modalState, listener);
|
|
235
|
+
return [];
|
|
236
|
+
}),
|
|
237
|
+
promise
|
|
238
|
+
]);
|
|
239
|
+
}
|
|
240
|
+
async waitForCompletion(callback) {
|
|
241
|
+
await this._initializedPromise;
|
|
242
|
+
await this._raceAgainstModalStates(() => (0, import_utils2.waitForCompletion)(this, callback));
|
|
243
|
+
}
|
|
244
|
+
async refLocator(params) {
|
|
245
|
+
await this._initializedPromise;
|
|
246
|
+
return (await this.refLocators([params]))[0];
|
|
247
|
+
}
|
|
248
|
+
async refLocators(params) {
|
|
249
|
+
await this._initializedPromise;
|
|
250
|
+
return Promise.all(params.map(async (param) => {
|
|
251
|
+
try {
|
|
252
|
+
let locator = this.page.locator(`aria-ref=${param.ref}`);
|
|
253
|
+
if (param.element)
|
|
254
|
+
locator = locator.describe(param.element);
|
|
255
|
+
const { resolvedSelector } = await locator._resolveSelector();
|
|
256
|
+
return { locator, resolved: (0, import_utils.asLocator)("javascript", resolvedSelector) };
|
|
257
|
+
} catch (e) {
|
|
258
|
+
throw new Error(`Ref ${param.ref} not found in the current page snapshot. Try capturing new snapshot.`);
|
|
259
|
+
}
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
262
|
+
async waitForTimeout(time) {
|
|
263
|
+
if (this._javaScriptBlocked()) {
|
|
264
|
+
await new Promise((f) => setTimeout(f, time));
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
await (0, import_utils2.callOnPageNoTrace)(this.page, (page) => {
|
|
268
|
+
return page.evaluate(() => new Promise((f) => setTimeout(f, 1e3))).catch(() => {
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function messageToConsoleMessage(message) {
|
|
274
|
+
return {
|
|
275
|
+
type: message.type(),
|
|
276
|
+
text: message.text(),
|
|
277
|
+
toString: () => `[${message.type().toUpperCase()}] ${message.text()} @ ${message.location().url}:${message.location().lineNumber}`
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function pageErrorToConsoleMessage(errorOrValue) {
|
|
281
|
+
if (errorOrValue instanceof Error) {
|
|
282
|
+
return {
|
|
283
|
+
type: "error",
|
|
284
|
+
text: errorOrValue.message,
|
|
285
|
+
toString: () => errorOrValue.stack || errorOrValue.message
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
type: "error",
|
|
290
|
+
text: String(errorOrValue),
|
|
291
|
+
toString: () => String(errorOrValue)
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function renderModalStates(modalStates) {
|
|
295
|
+
const result = [];
|
|
296
|
+
if (modalStates.length === 0)
|
|
297
|
+
result.push("- There is no modal state present");
|
|
298
|
+
for (const state of modalStates)
|
|
299
|
+
result.push(`- [${state.description}]: can be handled by the "${state.clearedBy}" tool`);
|
|
300
|
+
return result;
|
|
301
|
+
}
|
|
302
|
+
const consoleMessageLevels = ["error", "warning", "info", "debug"];
|
|
303
|
+
function shouldIncludeMessage(thresholdLevel, type) {
|
|
304
|
+
const messageLevel = consoleLevelForMessageType(type);
|
|
305
|
+
return consoleMessageLevels.indexOf(messageLevel) <= consoleMessageLevels.indexOf(thresholdLevel);
|
|
306
|
+
}
|
|
307
|
+
function consoleLevelForMessageType(type) {
|
|
308
|
+
switch (type) {
|
|
309
|
+
case "assert":
|
|
310
|
+
case "error":
|
|
311
|
+
return "error";
|
|
312
|
+
case "warning":
|
|
313
|
+
return "warning";
|
|
314
|
+
case "count":
|
|
315
|
+
case "dir":
|
|
316
|
+
case "dirxml":
|
|
317
|
+
case "info":
|
|
318
|
+
case "log":
|
|
319
|
+
case "table":
|
|
320
|
+
case "time":
|
|
321
|
+
case "timeEnd":
|
|
322
|
+
return "info";
|
|
323
|
+
case "clear":
|
|
324
|
+
case "debug":
|
|
325
|
+
case "endGroup":
|
|
326
|
+
case "profile":
|
|
327
|
+
case "profileEnd":
|
|
328
|
+
case "startGroup":
|
|
329
|
+
case "startGroupCollapsed":
|
|
330
|
+
case "trace":
|
|
331
|
+
return "debug";
|
|
332
|
+
default:
|
|
333
|
+
return "info";
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const tabSymbol = Symbol("tabSymbol");
|
|
337
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
338
|
+
0 && (module.exports = {
|
|
339
|
+
Tab,
|
|
340
|
+
TabEvents,
|
|
341
|
+
renderModalStates,
|
|
342
|
+
shouldIncludeMessage
|
|
343
|
+
});
|