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,145 @@
|
|
|
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 plannerTools_exports = {};
|
|
30
|
+
__export(plannerTools_exports, {
|
|
31
|
+
saveTestPlan: () => saveTestPlan,
|
|
32
|
+
setupPage: () => setupPage,
|
|
33
|
+
submitTestPlan: () => submitTestPlan
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(plannerTools_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_path = __toESM(require("path"));
|
|
38
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
39
|
+
var import_testTool = require("./testTool");
|
|
40
|
+
const setupPage = (0, import_testTool.defineTestTool)({
|
|
41
|
+
schema: {
|
|
42
|
+
name: "planner_setup_page",
|
|
43
|
+
title: "Setup planner page",
|
|
44
|
+
description: "Setup the page for test planning",
|
|
45
|
+
inputSchema: import_mcpBundle.z.object({
|
|
46
|
+
project: import_mcpBundle.z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
|
|
47
|
+
seedFile: import_mcpBundle.z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
|
|
48
|
+
}),
|
|
49
|
+
type: "readOnly"
|
|
50
|
+
},
|
|
51
|
+
handle: async (context, params) => {
|
|
52
|
+
const seed = await context.getOrCreateSeedFile(params.seedFile, params.project);
|
|
53
|
+
const { output, status } = await context.runSeedTest(seed.file, seed.projectName);
|
|
54
|
+
return { content: [{ type: "text", text: output }], isError: status !== "paused" };
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const planSchema = import_mcpBundle.z.object({
|
|
58
|
+
overview: import_mcpBundle.z.string().describe("A brief overview of the application to be tested"),
|
|
59
|
+
suites: import_mcpBundle.z.array(import_mcpBundle.z.object({
|
|
60
|
+
name: import_mcpBundle.z.string().describe("The name of the suite"),
|
|
61
|
+
seedFile: import_mcpBundle.z.string().describe("A seed file that was used to setup the page for testing."),
|
|
62
|
+
tests: import_mcpBundle.z.array(import_mcpBundle.z.object({
|
|
63
|
+
name: import_mcpBundle.z.string().describe("The name of the test"),
|
|
64
|
+
file: import_mcpBundle.z.string().describe('The file the test should be saved to, for example: "tests/<suite-name>/<test-name>.spec.ts".'),
|
|
65
|
+
steps: import_mcpBundle.z.array(import_mcpBundle.z.object({
|
|
66
|
+
perform: import_mcpBundle.z.string().optional().describe(`Action to perform. For example: 'Click on the "Submit" button'.`),
|
|
67
|
+
expect: import_mcpBundle.z.string().array().describe(`Expected result of the action where appropriate. For example: 'The page should show the "Thank you for your submission" message'`)
|
|
68
|
+
}))
|
|
69
|
+
}))
|
|
70
|
+
}))
|
|
71
|
+
});
|
|
72
|
+
const submitTestPlan = (0, import_testTool.defineTestTool)({
|
|
73
|
+
schema: {
|
|
74
|
+
name: "planner_submit_plan",
|
|
75
|
+
title: "Submit test plan",
|
|
76
|
+
description: "Submit the test plan to the test planner",
|
|
77
|
+
inputSchema: planSchema,
|
|
78
|
+
type: "readOnly"
|
|
79
|
+
},
|
|
80
|
+
handle: async (context, params) => {
|
|
81
|
+
return {
|
|
82
|
+
content: [{
|
|
83
|
+
type: "text",
|
|
84
|
+
text: JSON.stringify(params, null, 2)
|
|
85
|
+
}]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const saveTestPlan = (0, import_testTool.defineTestTool)({
|
|
90
|
+
schema: {
|
|
91
|
+
name: "planner_save_plan",
|
|
92
|
+
title: "Save test plan as markdown file",
|
|
93
|
+
description: "Save the test plan as a markdown file",
|
|
94
|
+
inputSchema: planSchema.extend({
|
|
95
|
+
name: import_mcpBundle.z.string().describe('The name of the test plan, for example: "Test Plan".'),
|
|
96
|
+
fileName: import_mcpBundle.z.string().describe('The file to save the test plan to, for example: "spec/test.plan.md". Relative to the workspace root.')
|
|
97
|
+
}),
|
|
98
|
+
type: "readOnly"
|
|
99
|
+
},
|
|
100
|
+
handle: async (context, params) => {
|
|
101
|
+
const lines = [];
|
|
102
|
+
lines.push(`# ${params.name}`);
|
|
103
|
+
lines.push(``);
|
|
104
|
+
lines.push(`## Application Overview`);
|
|
105
|
+
lines.push(``);
|
|
106
|
+
lines.push(params.overview);
|
|
107
|
+
lines.push(``);
|
|
108
|
+
lines.push(`## Test Scenarios`);
|
|
109
|
+
for (let i = 0; i < params.suites.length; i++) {
|
|
110
|
+
lines.push(``);
|
|
111
|
+
const suite = params.suites[i];
|
|
112
|
+
lines.push(`### ${i + 1}. ${suite.name}`);
|
|
113
|
+
lines.push(``);
|
|
114
|
+
lines.push(`**Seed:** \`${suite.seedFile}\``);
|
|
115
|
+
for (let j = 0; j < suite.tests.length; j++) {
|
|
116
|
+
lines.push(``);
|
|
117
|
+
const test = suite.tests[j];
|
|
118
|
+
lines.push(`#### ${i + 1}.${j + 1}. ${test.name}`);
|
|
119
|
+
lines.push(``);
|
|
120
|
+
lines.push(`**File:** \`${test.file}\``);
|
|
121
|
+
lines.push(``);
|
|
122
|
+
lines.push(`**Steps:**`);
|
|
123
|
+
for (let k = 0; k < test.steps.length; k++) {
|
|
124
|
+
lines.push(` ${k + 1}. ${test.steps[k].perform ?? "-"}`);
|
|
125
|
+
for (const expect of test.steps[k].expect)
|
|
126
|
+
lines.push(` - expect: ${expect}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
lines.push(``);
|
|
131
|
+
await import_fs.default.promises.writeFile(import_path.default.resolve(context.rootPath, params.fileName), lines.join("\n"));
|
|
132
|
+
return {
|
|
133
|
+
content: [{
|
|
134
|
+
type: "text",
|
|
135
|
+
text: `Test plan saved to ${params.fileName}`
|
|
136
|
+
}]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
141
|
+
0 && (module.exports = {
|
|
142
|
+
saveTestPlan,
|
|
143
|
+
setupPage,
|
|
144
|
+
submitTestPlan
|
|
145
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
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 seed_exports = {};
|
|
30
|
+
__export(seed_exports, {
|
|
31
|
+
defaultSeedFile: () => defaultSeedFile,
|
|
32
|
+
ensureSeedFile: () => ensureSeedFile,
|
|
33
|
+
findSeedFile: () => findSeedFile,
|
|
34
|
+
seedFileContent: () => seedFileContent,
|
|
35
|
+
seedProject: () => seedProject
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(seed_exports);
|
|
38
|
+
var import_fs = __toESM(require("fs"));
|
|
39
|
+
var import_path = __toESM(require("path"));
|
|
40
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
41
|
+
var import_projectUtils = require("../../runner/projectUtils");
|
|
42
|
+
function seedProject(config, projectName) {
|
|
43
|
+
if (!projectName)
|
|
44
|
+
return (0, import_projectUtils.findTopLevelProjects)(config)[0];
|
|
45
|
+
const project = config.projects.find((p) => p.project.name === projectName);
|
|
46
|
+
if (!project)
|
|
47
|
+
throw new Error(`Project ${projectName} not found`);
|
|
48
|
+
return project;
|
|
49
|
+
}
|
|
50
|
+
async function findSeedFile(project) {
|
|
51
|
+
const files = await (0, import_projectUtils.collectFilesForProject)(project);
|
|
52
|
+
return files.find((file) => import_path.default.basename(file).includes("seed"));
|
|
53
|
+
}
|
|
54
|
+
function defaultSeedFile(project) {
|
|
55
|
+
const testDir = project.project.testDir;
|
|
56
|
+
return import_path.default.resolve(testDir, "seed.spec.ts");
|
|
57
|
+
}
|
|
58
|
+
async function ensureSeedFile(project) {
|
|
59
|
+
const seedFile = await findSeedFile(project);
|
|
60
|
+
if (seedFile)
|
|
61
|
+
return seedFile;
|
|
62
|
+
const seedFilePath = defaultSeedFile(project);
|
|
63
|
+
await (0, import_utils.mkdirIfNeeded)(seedFilePath);
|
|
64
|
+
await import_fs.default.promises.writeFile(seedFilePath, seedFileContent);
|
|
65
|
+
return seedFilePath;
|
|
66
|
+
}
|
|
67
|
+
const seedFileContent = `import { test, expect } from '@playwright/test';
|
|
68
|
+
|
|
69
|
+
test.describe('Test group', () => {
|
|
70
|
+
test('seed', async ({ page }) => {
|
|
71
|
+
// generate code here.
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
`;
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
defaultSeedFile,
|
|
78
|
+
ensureSeedFile,
|
|
79
|
+
findSeedFile,
|
|
80
|
+
seedFileContent,
|
|
81
|
+
seedProject
|
|
82
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
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 streams_exports = {};
|
|
20
|
+
__export(streams_exports, {
|
|
21
|
+
StringWriteStream: () => StringWriteStream
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(streams_exports);
|
|
24
|
+
var import_stream = require("stream");
|
|
25
|
+
var import_util = require("../../util");
|
|
26
|
+
class StringWriteStream extends import_stream.Writable {
|
|
27
|
+
constructor(output, stdio) {
|
|
28
|
+
super();
|
|
29
|
+
this._output = output;
|
|
30
|
+
this._prefix = stdio === "stdout" ? "" : "[err] ";
|
|
31
|
+
}
|
|
32
|
+
_write(chunk, encoding, callback) {
|
|
33
|
+
let text = (0, import_util.stripAnsiEscapes)(chunk.toString());
|
|
34
|
+
if (text.endsWith("\n"))
|
|
35
|
+
text = text.slice(0, -1);
|
|
36
|
+
if (text)
|
|
37
|
+
this._output.push(this._prefix + text);
|
|
38
|
+
callback();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
StringWriteStream
|
|
44
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
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 testBackend_exports = {};
|
|
30
|
+
__export(testBackend_exports, {
|
|
31
|
+
TestServerBackend: () => TestServerBackend
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(testBackend_exports);
|
|
34
|
+
var import_mcpBundle = require("playwright-core/lib/mcpBundle");
|
|
35
|
+
var mcp = __toESM(require("../sdk/exports"));
|
|
36
|
+
var import_testContext = require("./testContext");
|
|
37
|
+
var testTools = __toESM(require("./testTools.js"));
|
|
38
|
+
var generatorTools = __toESM(require("./generatorTools.js"));
|
|
39
|
+
var plannerTools = __toESM(require("./plannerTools.js"));
|
|
40
|
+
var import_tools = require("../browser/tools");
|
|
41
|
+
class TestServerBackend {
|
|
42
|
+
constructor(configPath, options) {
|
|
43
|
+
this.name = "Playwright";
|
|
44
|
+
this.version = "0.0.1";
|
|
45
|
+
this._tools = [
|
|
46
|
+
plannerTools.saveTestPlan,
|
|
47
|
+
plannerTools.setupPage,
|
|
48
|
+
plannerTools.submitTestPlan,
|
|
49
|
+
generatorTools.setupPage,
|
|
50
|
+
generatorTools.generatorReadLog,
|
|
51
|
+
generatorTools.generatorWriteTest,
|
|
52
|
+
testTools.listTests,
|
|
53
|
+
testTools.runTests,
|
|
54
|
+
testTools.debugTest,
|
|
55
|
+
...import_tools.browserTools.map((tool) => wrapBrowserTool(tool))
|
|
56
|
+
];
|
|
57
|
+
this._options = options || {};
|
|
58
|
+
this._configPath = configPath;
|
|
59
|
+
}
|
|
60
|
+
async initialize(clientInfo) {
|
|
61
|
+
this._context = new import_testContext.TestContext(clientInfo, this._configPath, this._options);
|
|
62
|
+
}
|
|
63
|
+
async listTools() {
|
|
64
|
+
return this._tools.map((tool) => mcp.toMcpTool(tool.schema));
|
|
65
|
+
}
|
|
66
|
+
async callTool(name, args) {
|
|
67
|
+
const tool = this._tools.find((tool2) => tool2.schema.name === name);
|
|
68
|
+
if (!tool)
|
|
69
|
+
throw new Error(`Tool not found: ${name}. Available tools: ${this._tools.map((tool2) => tool2.schema.name).join(", ")}`);
|
|
70
|
+
try {
|
|
71
|
+
return await tool.handle(this._context, tool.schema.inputSchema.parse(args || {}));
|
|
72
|
+
} catch (e) {
|
|
73
|
+
return { content: [{ type: "text", text: String(e) }], isError: true };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
serverClosed() {
|
|
77
|
+
void this._context?.close();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const typesWithIntent = ["action", "assertion", "input"];
|
|
81
|
+
function wrapBrowserTool(tool) {
|
|
82
|
+
const inputSchema = typesWithIntent.includes(tool.schema.type) ? tool.schema.inputSchema.extend({
|
|
83
|
+
intent: import_mcpBundle.z.string().describe("The intent of the call, for example the test step description plan idea")
|
|
84
|
+
}) : tool.schema.inputSchema;
|
|
85
|
+
return {
|
|
86
|
+
schema: {
|
|
87
|
+
...tool.schema,
|
|
88
|
+
inputSchema
|
|
89
|
+
},
|
|
90
|
+
handle: async (context, params) => {
|
|
91
|
+
const response = await context.sendMessageToPausedTest({ callTool: { name: tool.schema.name, arguments: params } });
|
|
92
|
+
return response.callTool;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
97
|
+
0 && (module.exports = {
|
|
98
|
+
TestServerBackend
|
|
99
|
+
});
|
|
@@ -0,0 +1,285 @@
|
|
|
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 testContext_exports = {};
|
|
30
|
+
__export(testContext_exports, {
|
|
31
|
+
GeneratorJournal: () => GeneratorJournal,
|
|
32
|
+
TestContext: () => TestContext,
|
|
33
|
+
createScreen: () => createScreen
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(testContext_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_os = __toESM(require("os"));
|
|
38
|
+
var import_path = __toESM(require("path"));
|
|
39
|
+
var import_utils = require("playwright-core/lib/utils");
|
|
40
|
+
var import_base = require("../../reporters/base");
|
|
41
|
+
var import_list = __toESM(require("../../reporters/list"));
|
|
42
|
+
var import_streams = require("./streams");
|
|
43
|
+
var import_util = require("../../util");
|
|
44
|
+
var import_testRunner = require("../../runner/testRunner");
|
|
45
|
+
var import_seed = require("./seed");
|
|
46
|
+
var import_exports = require("../sdk/exports");
|
|
47
|
+
var import_configLoader = require("../../common/configLoader");
|
|
48
|
+
var import_response = require("../browser/response");
|
|
49
|
+
var import_log = require("../log");
|
|
50
|
+
class GeneratorJournal {
|
|
51
|
+
constructor(rootPath, plan, seed) {
|
|
52
|
+
this._rootPath = rootPath;
|
|
53
|
+
this._plan = plan;
|
|
54
|
+
this._seed = seed;
|
|
55
|
+
this._steps = [];
|
|
56
|
+
}
|
|
57
|
+
logStep(title, code) {
|
|
58
|
+
if (title)
|
|
59
|
+
this._steps.push({ title, code });
|
|
60
|
+
}
|
|
61
|
+
journal() {
|
|
62
|
+
const result = [];
|
|
63
|
+
result.push(`# Plan`);
|
|
64
|
+
result.push(this._plan);
|
|
65
|
+
result.push(`# Seed file: ${(0, import_utils.toPosixPath)(import_path.default.relative(this._rootPath, this._seed.file))}`);
|
|
66
|
+
result.push("```ts");
|
|
67
|
+
result.push(this._seed.content);
|
|
68
|
+
result.push("```");
|
|
69
|
+
result.push(`# Steps`);
|
|
70
|
+
result.push(this._steps.map((step) => `### ${step.title}
|
|
71
|
+
\`\`\`ts
|
|
72
|
+
${step.code}
|
|
73
|
+
\`\`\``).join("\n\n"));
|
|
74
|
+
result.push(bestPracticesMarkdown);
|
|
75
|
+
return result.join("\n\n");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
class TestContext {
|
|
79
|
+
constructor(clientInfo, configPath, options) {
|
|
80
|
+
this._clientInfo = clientInfo;
|
|
81
|
+
const rootPath = (0, import_exports.firstRootPath)(clientInfo);
|
|
82
|
+
this._configLocation = (0, import_configLoader.resolveConfigLocation)(configPath || rootPath);
|
|
83
|
+
this.rootPath = rootPath || this._configLocation.configDir;
|
|
84
|
+
if (options?.headless !== void 0)
|
|
85
|
+
this.computedHeaded = !options.headless;
|
|
86
|
+
else
|
|
87
|
+
this.computedHeaded = !process.env.CI && !(import_os.default.platform() === "linux" && !process.env.DISPLAY);
|
|
88
|
+
}
|
|
89
|
+
existingTestRunner() {
|
|
90
|
+
return this._testRunnerAndScreen?.testRunner;
|
|
91
|
+
}
|
|
92
|
+
async _cleanupTestRunner() {
|
|
93
|
+
if (!this._testRunnerAndScreen)
|
|
94
|
+
return;
|
|
95
|
+
await this._testRunnerAndScreen.testRunner.stopTests();
|
|
96
|
+
this._testRunnerAndScreen.claimStdio();
|
|
97
|
+
try {
|
|
98
|
+
await this._testRunnerAndScreen.testRunner.runGlobalTeardown();
|
|
99
|
+
} finally {
|
|
100
|
+
this._testRunnerAndScreen.releaseStdio();
|
|
101
|
+
this._testRunnerAndScreen = void 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async createTestRunner() {
|
|
105
|
+
await this._cleanupTestRunner();
|
|
106
|
+
const testRunner = new import_testRunner.TestRunner(this._configLocation, {});
|
|
107
|
+
await testRunner.initialize({});
|
|
108
|
+
const testPaused = new import_utils.ManualPromise();
|
|
109
|
+
const testRunnerAndScreen = {
|
|
110
|
+
...createScreen(),
|
|
111
|
+
testRunner,
|
|
112
|
+
waitForTestPaused: () => testPaused
|
|
113
|
+
};
|
|
114
|
+
this._testRunnerAndScreen = testRunnerAndScreen;
|
|
115
|
+
testRunner.on(import_testRunner.TestRunnerEvent.TestPaused, (params) => {
|
|
116
|
+
testRunnerAndScreen.sendMessageToPausedTest = params.sendMessage;
|
|
117
|
+
testPaused.resolve();
|
|
118
|
+
});
|
|
119
|
+
return testRunnerAndScreen;
|
|
120
|
+
}
|
|
121
|
+
async getOrCreateSeedFile(seedFile, projectName) {
|
|
122
|
+
const configDir = this._configLocation.configDir;
|
|
123
|
+
const { testRunner } = await this.createTestRunner();
|
|
124
|
+
const config = await testRunner.loadConfig();
|
|
125
|
+
const project = (0, import_seed.seedProject)(config, projectName);
|
|
126
|
+
if (!seedFile) {
|
|
127
|
+
seedFile = await (0, import_seed.ensureSeedFile)(project);
|
|
128
|
+
} else {
|
|
129
|
+
const candidateFiles = [];
|
|
130
|
+
const testDir = project.project.testDir;
|
|
131
|
+
candidateFiles.push(import_path.default.resolve(testDir, seedFile));
|
|
132
|
+
candidateFiles.push(import_path.default.resolve(configDir, seedFile));
|
|
133
|
+
candidateFiles.push(import_path.default.resolve(this.rootPath, seedFile));
|
|
134
|
+
let resolvedSeedFile;
|
|
135
|
+
for (const candidateFile of candidateFiles) {
|
|
136
|
+
if (await (0, import_util.fileExistsAsync)(candidateFile)) {
|
|
137
|
+
resolvedSeedFile = candidateFile;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (!resolvedSeedFile)
|
|
142
|
+
throw new Error("seed test not found.");
|
|
143
|
+
seedFile = resolvedSeedFile;
|
|
144
|
+
}
|
|
145
|
+
const seedFileContent = await import_fs.default.promises.readFile(seedFile, "utf8");
|
|
146
|
+
return {
|
|
147
|
+
file: seedFile,
|
|
148
|
+
content: seedFileContent,
|
|
149
|
+
projectName: project.project.name
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async runSeedTest(seedFile, projectName) {
|
|
153
|
+
const result = await this.runTestsWithGlobalSetupAndPossiblePause({
|
|
154
|
+
headed: this.computedHeaded,
|
|
155
|
+
locations: ["/" + (0, import_utils.escapeRegExp)(seedFile) + "/"],
|
|
156
|
+
projects: [projectName],
|
|
157
|
+
timeout: 0,
|
|
158
|
+
workers: 1,
|
|
159
|
+
pauseAtEnd: true,
|
|
160
|
+
disableConfigReporters: true,
|
|
161
|
+
failOnLoadErrors: true
|
|
162
|
+
});
|
|
163
|
+
if (result.status === "passed")
|
|
164
|
+
result.output += "\nError: seed test not found.";
|
|
165
|
+
else if (result.status !== "paused")
|
|
166
|
+
result.output += "\nError while running the seed test.";
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
async runTestsWithGlobalSetupAndPossiblePause(params) {
|
|
170
|
+
const configDir = this._configLocation.configDir;
|
|
171
|
+
const testRunnerAndScreen = await this.createTestRunner();
|
|
172
|
+
const { testRunner, screen, claimStdio, releaseStdio } = testRunnerAndScreen;
|
|
173
|
+
claimStdio();
|
|
174
|
+
try {
|
|
175
|
+
const setupReporter = new MCPListReporter({ configDir, screen, includeTestId: true });
|
|
176
|
+
const { status: status2 } = await testRunner.runGlobalSetup([setupReporter]);
|
|
177
|
+
if (status2 !== "passed")
|
|
178
|
+
return { output: testRunnerAndScreen.output.join("\n"), status: status2 };
|
|
179
|
+
} finally {
|
|
180
|
+
releaseStdio();
|
|
181
|
+
}
|
|
182
|
+
let status = "passed";
|
|
183
|
+
const cleanup = async () => {
|
|
184
|
+
claimStdio();
|
|
185
|
+
try {
|
|
186
|
+
const result = await testRunner.runGlobalTeardown();
|
|
187
|
+
if (status === "passed")
|
|
188
|
+
status = result.status;
|
|
189
|
+
} finally {
|
|
190
|
+
releaseStdio();
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
try {
|
|
194
|
+
const reporter = new MCPListReporter({ configDir, screen, includeTestId: true });
|
|
195
|
+
status = await Promise.race([
|
|
196
|
+
testRunner.runTests(reporter, params).then((result) => result.status),
|
|
197
|
+
testRunnerAndScreen.waitForTestPaused().then(() => "paused")
|
|
198
|
+
]);
|
|
199
|
+
if (status === "paused") {
|
|
200
|
+
const response = await testRunnerAndScreen.sendMessageToPausedTest({ request: { initialize: { clientInfo: this._clientInfo } } });
|
|
201
|
+
if (response.error)
|
|
202
|
+
throw new Error(response.error.message);
|
|
203
|
+
testRunnerAndScreen.output.push(response.response.initialize.pausedMessage);
|
|
204
|
+
return { output: testRunnerAndScreen.output.join("\n"), status };
|
|
205
|
+
}
|
|
206
|
+
} catch (e) {
|
|
207
|
+
status = "failed";
|
|
208
|
+
testRunnerAndScreen.output.push(String(e));
|
|
209
|
+
await cleanup();
|
|
210
|
+
return { output: testRunnerAndScreen.output.join("\n"), status };
|
|
211
|
+
}
|
|
212
|
+
await cleanup();
|
|
213
|
+
return { output: testRunnerAndScreen.output.join("\n"), status };
|
|
214
|
+
}
|
|
215
|
+
async close() {
|
|
216
|
+
await this._cleanupTestRunner().catch(import_log.logUnhandledError);
|
|
217
|
+
}
|
|
218
|
+
async sendMessageToPausedTest(request) {
|
|
219
|
+
const sendMessage = this._testRunnerAndScreen?.sendMessageToPausedTest;
|
|
220
|
+
if (!sendMessage)
|
|
221
|
+
throw new Error("Must setup test before interacting with the page");
|
|
222
|
+
const result = await sendMessage({ request });
|
|
223
|
+
if (result.error)
|
|
224
|
+
throw new Error(result.error.message);
|
|
225
|
+
if (typeof request?.callTool?.arguments?.["intent"] === "string") {
|
|
226
|
+
const response = (0, import_response.parseResponse)(result.response.callTool);
|
|
227
|
+
if (response && !response.isError && response.code)
|
|
228
|
+
this.generatorJournal?.logStep(request.callTool.arguments["intent"], response.code);
|
|
229
|
+
}
|
|
230
|
+
return result.response;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function createScreen() {
|
|
234
|
+
const output = [];
|
|
235
|
+
const stdout = new import_streams.StringWriteStream(output, "stdout");
|
|
236
|
+
const stderr = new import_streams.StringWriteStream(output, "stderr");
|
|
237
|
+
const screen = {
|
|
238
|
+
...import_base.terminalScreen,
|
|
239
|
+
isTTY: false,
|
|
240
|
+
colors: import_utils.noColors,
|
|
241
|
+
stdout,
|
|
242
|
+
stderr
|
|
243
|
+
};
|
|
244
|
+
const originalStdoutWrite = process.stdout.write;
|
|
245
|
+
const originalStderrWrite = process.stderr.write;
|
|
246
|
+
const claimStdio = () => {
|
|
247
|
+
process.stdout.write = (chunk) => {
|
|
248
|
+
stdout.write(chunk);
|
|
249
|
+
return true;
|
|
250
|
+
};
|
|
251
|
+
process.stderr.write = (chunk) => {
|
|
252
|
+
stderr.write(chunk);
|
|
253
|
+
return true;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
const releaseStdio = () => {
|
|
257
|
+
process.stdout.write = originalStdoutWrite;
|
|
258
|
+
process.stderr.write = originalStderrWrite;
|
|
259
|
+
};
|
|
260
|
+
return { screen, claimStdio, releaseStdio, output };
|
|
261
|
+
}
|
|
262
|
+
const bestPracticesMarkdown = `
|
|
263
|
+
# Best practices
|
|
264
|
+
- Do not improvise, do not add directives that were not asked for
|
|
265
|
+
- Use clear, descriptive assertions to validate the expected behavior
|
|
266
|
+
- Use reliable locators from this log
|
|
267
|
+
- Use local variables for locators that are used multiple times
|
|
268
|
+
- Use Playwright waiting assertions and best practices from this log
|
|
269
|
+
- NEVER! use page.waitForLoadState()
|
|
270
|
+
- NEVER! use page.waitForNavigation()
|
|
271
|
+
- NEVER! use page.waitForTimeout()
|
|
272
|
+
- NEVER! use page.evaluate()
|
|
273
|
+
`;
|
|
274
|
+
class MCPListReporter extends import_list.default {
|
|
275
|
+
async onTestPaused() {
|
|
276
|
+
await new Promise(() => {
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
281
|
+
0 && (module.exports = {
|
|
282
|
+
GeneratorJournal,
|
|
283
|
+
TestContext,
|
|
284
|
+
createScreen
|
|
285
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
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 testTool_exports = {};
|
|
20
|
+
__export(testTool_exports, {
|
|
21
|
+
defineTestTool: () => defineTestTool
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(testTool_exports);
|
|
24
|
+
function defineTestTool(tool) {
|
|
25
|
+
return tool;
|
|
26
|
+
}
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
defineTestTool
|
|
30
|
+
});
|