@skyramp/mcp 0.0.63 β 0.0.64-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +23 -6
- package/build/playwright/PlaywrightTraceService.js +74 -0
- package/build/playwright/index.js +3 -0
- package/build/playwright/registerPlaywrightTools.js +117 -0
- package/build/playwright/traceRecordingPrompt.js +54 -0
- package/build/prompts/startTraceCollectionPrompts.js +4 -2
- package/build/prompts/test-recommendation/recommendationSections.js +88 -212
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +336 -85
- package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +58 -15
- package/build/prompts/testGenerationPrompt.js +1 -1
- package/build/prompts/testbot/testbot-prompts.js +44 -22
- package/build/services/ModularizationService.js +1 -1
- package/build/services/TestExecutionService.js +1 -1
- package/build/services/TestGenerationService.js +8 -1
- package/build/services/TestGenerationService.test.js +11 -11
- package/build/tools/code-refactor/modularizationTool.js +50 -8
- package/build/tools/generate-tests/generateContractRestTool.js +125 -12
- package/build/tools/generate-tests/generateIntegrationRestTool.js +83 -1
- package/build/tools/generate-tests/generateUIRestTool.js +10 -2
- package/build/tools/submitReportTool.js +26 -7
- package/build/tools/submitReportTool.test.js +1 -1
- package/build/tools/test-management/analyzeChangesTool.js +9 -4
- package/build/tools/trace/startTraceCollectionTool.js +6 -9
- package/build/tools/trace/stopTraceCollectionTool.js +2 -2
- package/build/types/RepositoryAnalysis.js +3 -1
- package/build/utils/normalizeParams.js +45 -0
- package/build/utils/scenarioDrafting.js +418 -93
- package/build/utils/scenarioDrafting.test.js +190 -2
- package/build/utils/trace-parser.js +49 -22
- package/node_modules/playwright/ThirdPartyNotices.txt +7456 -0
- package/node_modules/playwright/cli.js +19 -0
- package/node_modules/playwright/index.d.ts +17 -0
- package/node_modules/playwright/index.js +17 -0
- package/node_modules/playwright/index.mjs +18 -0
- package/node_modules/playwright/jsx-runtime.js +42 -0
- package/node_modules/playwright/jsx-runtime.mjs +21 -0
- package/node_modules/playwright/lib/agents/agentParser.js +89 -0
- package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- package/node_modules/playwright/lib/agents/generateAgents.js +348 -0
- package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +55 -0
- package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +73 -0
- package/node_modules/playwright/lib/common/config.js +282 -0
- package/node_modules/playwright/lib/common/configLoader.js +344 -0
- package/node_modules/playwright/lib/common/esmLoaderHost.js +104 -0
- package/node_modules/playwright/lib/common/expectBundle.js +28 -0
- package/node_modules/playwright/lib/common/expectBundleImpl.js +407 -0
- package/node_modules/playwright/lib/common/fixtures.js +302 -0
- package/node_modules/playwright/lib/common/globals.js +58 -0
- package/node_modules/playwright/lib/common/ipc.js +60 -0
- package/node_modules/playwright/lib/common/poolBuilder.js +85 -0
- package/node_modules/playwright/lib/common/process.js +132 -0
- package/node_modules/playwright/lib/common/suiteUtils.js +140 -0
- package/node_modules/playwright/lib/common/test.js +321 -0
- package/node_modules/playwright/lib/common/testLoader.js +101 -0
- package/node_modules/playwright/lib/common/testType.js +298 -0
- package/node_modules/playwright/lib/common/validators.js +68 -0
- package/node_modules/playwright/lib/fsWatcher.js +67 -0
- package/node_modules/playwright/lib/index.js +726 -0
- package/node_modules/playwright/lib/internalsForTest.js +42 -0
- package/node_modules/playwright/lib/isomorphic/events.js +77 -0
- package/node_modules/playwright/lib/isomorphic/folders.js +30 -0
- package/node_modules/playwright/lib/isomorphic/stringInternPool.js +69 -0
- package/node_modules/playwright/lib/isomorphic/teleReceiver.js +521 -0
- package/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +157 -0
- package/node_modules/playwright/lib/isomorphic/testServerConnection.js +225 -0
- package/node_modules/playwright/lib/isomorphic/testServerInterface.js +16 -0
- package/node_modules/playwright/lib/isomorphic/testTree.js +329 -0
- package/node_modules/playwright/lib/isomorphic/types.d.js +16 -0
- package/node_modules/playwright/lib/loader/loaderMain.js +59 -0
- package/node_modules/playwright/lib/matchers/expect.js +311 -0
- package/node_modules/playwright/lib/matchers/matcherHint.js +44 -0
- package/node_modules/playwright/lib/matchers/matchers.js +383 -0
- package/node_modules/playwright/lib/matchers/toBeTruthy.js +75 -0
- package/node_modules/playwright/lib/matchers/toEqual.js +100 -0
- package/node_modules/playwright/lib/matchers/toHaveURL.js +101 -0
- package/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +159 -0
- package/node_modules/playwright/lib/matchers/toMatchSnapshot.js +342 -0
- package/node_modules/playwright/lib/matchers/toMatchText.js +99 -0
- package/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +329 -0
- package/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +84 -0
- package/node_modules/playwright/lib/mcp/browser/config.js +421 -0
- package/node_modules/playwright/lib/mcp/browser/context.js +296 -0
- package/node_modules/playwright/lib/mcp/browser/response.js +278 -0
- package/node_modules/playwright/lib/mcp/browser/sessionLog.js +75 -0
- package/node_modules/playwright/lib/mcp/browser/tab.js +343 -0
- package/node_modules/playwright/lib/mcp/browser/tools/common.js +65 -0
- package/node_modules/playwright/lib/mcp/browser/tools/console.js +46 -0
- package/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +60 -0
- package/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +61 -0
- package/node_modules/playwright/lib/mcp/browser/tools/files.js +58 -0
- package/node_modules/playwright/lib/mcp/browser/tools/form.js +63 -0
- package/node_modules/playwright/lib/mcp/browser/tools/install.js +72 -0
- package/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +107 -0
- package/node_modules/playwright/lib/mcp/browser/tools/mouse.js +107 -0
- package/node_modules/playwright/lib/mcp/browser/tools/navigate.js +71 -0
- package/node_modules/playwright/lib/mcp/browser/tools/network.js +63 -0
- package/node_modules/playwright/lib/mcp/browser/tools/open.js +57 -0
- package/node_modules/playwright/lib/mcp/browser/tools/pdf.js +49 -0
- package/node_modules/playwright/lib/mcp/browser/tools/runCode.js +78 -0
- package/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +93 -0
- package/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +173 -0
- package/node_modules/playwright/lib/mcp/browser/tools/tabs.js +67 -0
- package/node_modules/playwright/lib/mcp/browser/tools/tool.js +47 -0
- package/node_modules/playwright/lib/mcp/browser/tools/tracing.js +74 -0
- package/node_modules/playwright/lib/mcp/browser/tools/utils.js +94 -0
- package/node_modules/playwright/lib/mcp/browser/tools/verify.js +143 -0
- package/node_modules/playwright/lib/mcp/browser/tools/wait.js +63 -0
- package/node_modules/playwright/lib/mcp/browser/tools.js +84 -0
- package/node_modules/playwright/lib/mcp/browser/watchdog.js +44 -0
- package/node_modules/playwright/lib/mcp/config.d.js +16 -0
- package/node_modules/playwright/lib/mcp/extension/cdpRelay.js +351 -0
- package/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +76 -0
- package/node_modules/playwright/lib/mcp/extension/protocol.js +28 -0
- package/node_modules/playwright/lib/mcp/index.js +61 -0
- package/node_modules/playwright/lib/mcp/log.js +35 -0
- package/node_modules/playwright/lib/mcp/program.js +111 -0
- package/node_modules/playwright/lib/mcp/sdk/exports.js +28 -0
- package/node_modules/playwright/lib/mcp/sdk/http.js +152 -0
- package/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +71 -0
- package/node_modules/playwright/lib/mcp/sdk/server.js +223 -0
- package/node_modules/playwright/lib/mcp/sdk/tool.js +47 -0
- package/node_modules/playwright/lib/mcp/skyramp/exportTool.js +88 -0
- package/node_modules/playwright/lib/mcp/skyramp/index.js +36 -0
- package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +236 -0
- package/node_modules/playwright/lib/mcp/skyramp/types.js +31 -0
- package/node_modules/playwright/lib/mcp/terminal/cli.js +296 -0
- package/node_modules/playwright/lib/mcp/terminal/command.js +56 -0
- package/node_modules/playwright/lib/mcp/terminal/commands.js +333 -0
- package/node_modules/playwright/lib/mcp/terminal/daemon.js +129 -0
- package/node_modules/playwright/lib/mcp/terminal/help.json +32 -0
- package/node_modules/playwright/lib/mcp/terminal/helpGenerator.js +88 -0
- package/node_modules/playwright/lib/mcp/terminal/socketConnection.js +80 -0
- package/node_modules/playwright/lib/mcp/test/browserBackend.js +98 -0
- package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- package/node_modules/playwright/lib/mcp/test/plannerTools.js +145 -0
- package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- package/node_modules/playwright/lib/mcp/test/skyRampExport.js +313 -0
- package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- package/node_modules/playwright/lib/mcp/test/testContext.js +285 -0
- package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- package/node_modules/playwright/lib/mcp/test/testTools.js +108 -0
- package/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +198 -0
- package/node_modules/playwright/lib/plugins/index.js +28 -0
- package/node_modules/playwright/lib/plugins/webServerPlugin.js +237 -0
- package/node_modules/playwright/lib/program.js +417 -0
- package/node_modules/playwright/lib/reporters/base.js +634 -0
- package/node_modules/playwright/lib/reporters/blob.js +138 -0
- package/node_modules/playwright/lib/reporters/dot.js +99 -0
- package/node_modules/playwright/lib/reporters/empty.js +32 -0
- package/node_modules/playwright/lib/reporters/github.js +128 -0
- package/node_modules/playwright/lib/reporters/html.js +633 -0
- package/node_modules/playwright/lib/reporters/internalReporter.js +138 -0
- package/node_modules/playwright/lib/reporters/json.js +254 -0
- package/node_modules/playwright/lib/reporters/junit.js +232 -0
- package/node_modules/playwright/lib/reporters/line.js +131 -0
- package/node_modules/playwright/lib/reporters/list.js +253 -0
- package/node_modules/playwright/lib/reporters/listModeReporter.js +69 -0
- package/node_modules/playwright/lib/reporters/markdown.js +144 -0
- package/node_modules/playwright/lib/reporters/merge.js +558 -0
- package/node_modules/playwright/lib/reporters/multiplexer.js +112 -0
- package/node_modules/playwright/lib/reporters/reporterV2.js +102 -0
- package/node_modules/playwright/lib/reporters/teleEmitter.js +317 -0
- package/node_modules/playwright/lib/reporters/versions/blobV1.js +16 -0
- package/node_modules/playwright/lib/runner/dispatcher.js +530 -0
- package/node_modules/playwright/lib/runner/failureTracker.js +72 -0
- package/node_modules/playwright/lib/runner/lastRun.js +77 -0
- package/node_modules/playwright/lib/runner/loadUtils.js +334 -0
- package/node_modules/playwright/lib/runner/loaderHost.js +89 -0
- package/node_modules/playwright/lib/runner/processHost.js +180 -0
- package/node_modules/playwright/lib/runner/projectUtils.js +241 -0
- package/node_modules/playwright/lib/runner/rebase.js +189 -0
- package/node_modules/playwright/lib/runner/reporters.js +138 -0
- package/node_modules/playwright/lib/runner/sigIntWatcher.js +96 -0
- package/node_modules/playwright/lib/runner/storage.js +91 -0
- package/node_modules/playwright/lib/runner/taskRunner.js +127 -0
- package/node_modules/playwright/lib/runner/tasks.js +410 -0
- package/node_modules/playwright/lib/runner/testGroups.js +125 -0
- package/node_modules/playwright/lib/runner/testRunner.js +398 -0
- package/node_modules/playwright/lib/runner/testServer.js +269 -0
- package/node_modules/playwright/lib/runner/uiModeReporter.js +30 -0
- package/node_modules/playwright/lib/runner/vcs.js +72 -0
- package/node_modules/playwright/lib/runner/watchMode.js +396 -0
- package/node_modules/playwright/lib/runner/workerHost.js +104 -0
- package/node_modules/playwright/lib/third_party/pirates.js +62 -0
- package/node_modules/playwright/lib/third_party/tsconfig-loader.js +103 -0
- package/node_modules/playwright/lib/transform/babelBundle.js +46 -0
- package/node_modules/playwright/lib/transform/babelBundleImpl.js +461 -0
- package/node_modules/playwright/lib/transform/compilationCache.js +274 -0
- package/node_modules/playwright/lib/transform/esmLoader.js +103 -0
- package/node_modules/playwright/lib/transform/md.js +221 -0
- package/node_modules/playwright/lib/transform/portTransport.js +67 -0
- package/node_modules/playwright/lib/transform/transform.js +303 -0
- package/node_modules/playwright/lib/util.js +400 -0
- package/node_modules/playwright/lib/utilsBundle.js +50 -0
- package/node_modules/playwright/lib/utilsBundleImpl.js +103 -0
- package/node_modules/playwright/lib/worker/fixtureRunner.js +262 -0
- package/node_modules/playwright/lib/worker/testInfo.js +536 -0
- package/node_modules/playwright/lib/worker/testTracing.js +345 -0
- package/node_modules/playwright/lib/worker/timeoutManager.js +174 -0
- package/node_modules/playwright/lib/worker/util.js +31 -0
- package/node_modules/playwright/lib/worker/workerMain.js +530 -0
- package/node_modules/playwright/package.json +73 -0
- package/node_modules/playwright/test.d.ts +18 -0
- package/node_modules/playwright/test.js +24 -0
- package/node_modules/playwright/test.mjs +34 -0
- package/node_modules/playwright/types/test.d.ts +10251 -0
- package/node_modules/playwright/types/testReporter.d.ts +822 -0
- package/node_modules/playwright-core/LICENSE +202 -0
- package/node_modules/playwright-core/NOTICE +5 -0
- package/node_modules/playwright-core/README.md +3 -0
- package/node_modules/playwright-core/ThirdPartyNotices.txt +4076 -0
- package/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/browsers.json +79 -0
- package/node_modules/playwright-core/cli.js +18 -0
- package/node_modules/playwright-core/index.d.ts +17 -0
- package/node_modules/playwright-core/index.js +32 -0
- package/node_modules/playwright-core/index.mjs +28 -0
- package/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
- package/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
- package/node_modules/playwright-core/lib/cli/driver.js +97 -0
- package/node_modules/playwright-core/lib/cli/program.js +589 -0
- package/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
- package/node_modules/playwright-core/lib/client/android.js +361 -0
- package/node_modules/playwright-core/lib/client/api.js +137 -0
- package/node_modules/playwright-core/lib/client/artifact.js +79 -0
- package/node_modules/playwright-core/lib/client/browser.js +161 -0
- package/node_modules/playwright-core/lib/client/browserContext.js +582 -0
- package/node_modules/playwright-core/lib/client/browserType.js +185 -0
- package/node_modules/playwright-core/lib/client/cdpSession.js +51 -0
- package/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
- package/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
- package/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
- package/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
- package/node_modules/playwright-core/lib/client/clock.js +68 -0
- package/node_modules/playwright-core/lib/client/connection.js +318 -0
- package/node_modules/playwright-core/lib/client/consoleMessage.js +58 -0
- package/node_modules/playwright-core/lib/client/coverage.js +44 -0
- package/node_modules/playwright-core/lib/client/dialog.js +56 -0
- package/node_modules/playwright-core/lib/client/download.js +62 -0
- package/node_modules/playwright-core/lib/client/electron.js +138 -0
- package/node_modules/playwright-core/lib/client/elementHandle.js +284 -0
- package/node_modules/playwright-core/lib/client/errors.js +77 -0
- package/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
- package/node_modules/playwright-core/lib/client/events.js +103 -0
- package/node_modules/playwright-core/lib/client/fetch.js +368 -0
- package/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
- package/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
- package/node_modules/playwright-core/lib/client/frame.js +409 -0
- package/node_modules/playwright-core/lib/client/harRouter.js +87 -0
- package/node_modules/playwright-core/lib/client/input.js +84 -0
- package/node_modules/playwright-core/lib/client/jsHandle.js +109 -0
- package/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
- package/node_modules/playwright-core/lib/client/localUtils.js +60 -0
- package/node_modules/playwright-core/lib/client/locator.js +369 -0
- package/node_modules/playwright-core/lib/client/network.js +747 -0
- package/node_modules/playwright-core/lib/client/page.js +745 -0
- package/node_modules/playwright-core/lib/client/pageAgent.js +64 -0
- package/node_modules/playwright-core/lib/client/platform.js +77 -0
- package/node_modules/playwright-core/lib/client/playwright.js +71 -0
- package/node_modules/playwright-core/lib/client/selectors.js +55 -0
- package/node_modules/playwright-core/lib/client/stream.js +39 -0
- package/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
- package/node_modules/playwright-core/lib/client/tracing.js +119 -0
- package/node_modules/playwright-core/lib/client/types.js +28 -0
- package/node_modules/playwright-core/lib/client/video.js +59 -0
- package/node_modules/playwright-core/lib/client/waiter.js +142 -0
- package/node_modules/playwright-core/lib/client/webError.js +39 -0
- package/node_modules/playwright-core/lib/client/webSocket.js +93 -0
- package/node_modules/playwright-core/lib/client/worker.js +85 -0
- package/node_modules/playwright-core/lib/client/writableStream.js +39 -0
- package/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
- package/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
- package/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
- package/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
- package/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
- package/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
- package/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
- package/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
- package/node_modules/playwright-core/lib/inprocess.js +3 -0
- package/node_modules/playwright-core/lib/mcpBundle.js +84 -0
- package/node_modules/playwright-core/lib/mcpBundleImpl/index.js +147 -0
- package/node_modules/playwright-core/lib/outofprocess.js +76 -0
- package/node_modules/playwright-core/lib/protocol/serializers.js +197 -0
- package/node_modules/playwright-core/lib/protocol/validator.js +2969 -0
- package/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
- package/node_modules/playwright-core/lib/remote/playwrightConnection.js +129 -0
- package/node_modules/playwright-core/lib/remote/playwrightServer.js +334 -0
- package/node_modules/playwright-core/lib/server/agent/actionRunner.js +335 -0
- package/node_modules/playwright-core/lib/server/agent/actions.js +128 -0
- package/node_modules/playwright-core/lib/server/agent/codegen.js +111 -0
- package/node_modules/playwright-core/lib/server/agent/context.js +150 -0
- package/node_modules/playwright-core/lib/server/agent/expectTools.js +156 -0
- package/node_modules/playwright-core/lib/server/agent/pageAgent.js +204 -0
- package/node_modules/playwright-core/lib/server/agent/performTools.js +262 -0
- package/node_modules/playwright-core/lib/server/agent/tool.js +109 -0
- package/node_modules/playwright-core/lib/server/android/android.js +465 -0
- package/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
- package/node_modules/playwright-core/lib/server/artifact.js +127 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +549 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +149 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +213 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiDeserializer.js +116 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +267 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +128 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +383 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiPage.js +583 -0
- package/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
- package/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- package/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +180 -0
- package/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- package/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
- package/node_modules/playwright-core/lib/server/browser.js +149 -0
- package/node_modules/playwright-core/lib/server/browserContext.js +702 -0
- package/node_modules/playwright-core/lib/server/browserType.js +336 -0
- package/node_modules/playwright-core/lib/server/callLog.js +82 -0
- package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/node_modules/playwright-core/lib/server/chromium/chromium.js +397 -0
- package/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
- package/node_modules/playwright-core/lib/server/chromium/crBrowser.js +520 -0
- package/node_modules/playwright-core/lib/server/chromium/crConnection.js +197 -0
- package/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
- package/node_modules/playwright-core/lib/server/chromium/crDevTools.js +111 -0
- package/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
- package/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
- package/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
- package/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +707 -0
- package/node_modules/playwright-core/lib/server/chromium/crPage.js +1001 -0
- package/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
- package/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
- package/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +136 -0
- package/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
- package/node_modules/playwright-core/lib/server/clock.js +149 -0
- package/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
- package/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
- package/node_modules/playwright-core/lib/server/codegen/javascript.js +247 -0
- package/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
- package/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
- package/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
- package/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
- package/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
- package/node_modules/playwright-core/lib/server/console.js +57 -0
- package/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
- package/node_modules/playwright-core/lib/server/debugController.js +191 -0
- package/node_modules/playwright-core/lib/server/debugger.js +119 -0
- package/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
- package/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
- package/node_modules/playwright-core/lib/server/dialog.js +116 -0
- package/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
- package/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +384 -0
- package/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +118 -0
- package/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
- package/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
- package/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +364 -0
- package/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +89 -0
- package/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- package/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
- package/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- package/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- package/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
- package/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +213 -0
- package/node_modules/playwright-core/lib/server/dispatchers/pageAgentDispatcher.js +96 -0
- package/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +393 -0
- package/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- package/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
- package/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/node_modules/playwright-core/lib/server/dom.js +815 -0
- package/node_modules/playwright-core/lib/server/download.js +70 -0
- package/node_modules/playwright-core/lib/server/electron/electron.js +273 -0
- package/node_modules/playwright-core/lib/server/electron/loader.js +29 -0
- package/node_modules/playwright-core/lib/server/errors.js +69 -0
- package/node_modules/playwright-core/lib/server/fetch.js +621 -0
- package/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
- package/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
- package/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +418 -0
- package/node_modules/playwright-core/lib/server/firefox/ffConnection.js +142 -0
- package/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
- package/node_modules/playwright-core/lib/server/firefox/ffInput.js +159 -0
- package/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
- package/node_modules/playwright-core/lib/server/firefox/ffPage.js +497 -0
- package/node_modules/playwright-core/lib/server/firefox/firefox.js +114 -0
- package/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
- package/node_modules/playwright-core/lib/server/formData.js +147 -0
- package/node_modules/playwright-core/lib/server/frameSelectors.js +160 -0
- package/node_modules/playwright-core/lib/server/frames.js +1471 -0
- package/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
- package/node_modules/playwright-core/lib/server/har/harTracer.js +607 -0
- package/node_modules/playwright-core/lib/server/harBackend.js +157 -0
- package/node_modules/playwright-core/lib/server/helper.js +96 -0
- package/node_modules/playwright-core/lib/server/index.js +58 -0
- package/node_modules/playwright-core/lib/server/input.js +277 -0
- package/node_modules/playwright-core/lib/server/instrumentation.js +72 -0
- package/node_modules/playwright-core/lib/server/javascript.js +291 -0
- package/node_modules/playwright-core/lib/server/launchApp.js +128 -0
- package/node_modules/playwright-core/lib/server/localUtils.js +214 -0
- package/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
- package/node_modules/playwright-core/lib/server/network.js +667 -0
- package/node_modules/playwright-core/lib/server/page.js +830 -0
- package/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
- package/node_modules/playwright-core/lib/server/playwright.js +69 -0
- package/node_modules/playwright-core/lib/server/progress.js +132 -0
- package/node_modules/playwright-core/lib/server/protocolError.js +52 -0
- package/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
- package/node_modules/playwright-core/lib/server/recorder/recorderApp.js +366 -0
- package/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
- package/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
- package/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
- package/node_modules/playwright-core/lib/server/recorder.js +499 -0
- package/node_modules/playwright-core/lib/server/registry/browserFetcher.js +177 -0
- package/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
- package/node_modules/playwright-core/lib/server/registry/index.js +1422 -0
- package/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1280 -0
- package/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +127 -0
- package/node_modules/playwright-core/lib/server/screencast.js +190 -0
- package/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
- package/node_modules/playwright-core/lib/server/selectors.js +112 -0
- package/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
- package/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
- package/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
- package/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +561 -0
- package/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +604 -0
- package/node_modules/playwright-core/lib/server/trace/viewer/traceParser.js +72 -0
- package/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +245 -0
- package/node_modules/playwright-core/lib/server/transport.js +181 -0
- package/node_modules/playwright-core/lib/server/types.js +28 -0
- package/node_modules/playwright-core/lib/server/usKeyboardLayout.js +145 -0
- package/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
- package/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
- package/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
- package/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
- package/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
- package/node_modules/playwright-core/lib/server/utils/env.js +73 -0
- package/node_modules/playwright-core/lib/server/utils/eventsHelper.js +39 -0
- package/node_modules/playwright-core/lib/server/utils/expectUtils.js +123 -0
- package/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
- package/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
- package/node_modules/playwright-core/lib/server/utils/hostPlatform.js +138 -0
- package/node_modules/playwright-core/lib/server/utils/httpServer.js +203 -0
- package/node_modules/playwright-core/lib/server/utils/imageUtils.js +141 -0
- package/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
- package/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
- package/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
- package/node_modules/playwright-core/lib/server/utils/network.js +242 -0
- package/node_modules/playwright-core/lib/server/utils/nodePlatform.js +154 -0
- package/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
- package/node_modules/playwright-core/lib/server/utils/processLauncher.js +241 -0
- package/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
- package/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
- package/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
- package/node_modules/playwright-core/lib/server/utils/task.js +51 -0
- package/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
- package/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
- package/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
- package/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
- package/node_modules/playwright-core/lib/server/videoRecorder.js +124 -0
- package/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
- package/node_modules/playwright-core/lib/server/webkit/webkit.js +108 -0
- package/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +335 -0
- package/node_modules/playwright-core/lib/server/webkit/wkConnection.js +144 -0
- package/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
- package/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
- package/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +197 -0
- package/node_modules/playwright-core/lib/server/webkit/wkPage.js +1159 -0
- package/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +105 -0
- package/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +455 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/lruCache.js +51 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +459 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +330 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +204 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/entries.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotRenderer.js +499 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/traceLoader.js +131 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModel.js +365 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/traceModernizer.js +400 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +58 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +190 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- package/node_modules/playwright-core/lib/utils/isomorphic/yaml.js +84 -0
- package/node_modules/playwright-core/lib/utils.js +111 -0
- package/node_modules/playwright-core/lib/utilsBundle.js +109 -0
- package/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
- package/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +1066 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/index.html +84 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DYBRYzYX.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DadYNm1I.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-BSjZa4pk.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-BhTWtUlo.js +193 -0
- package/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-a5XoALAZ.js +32 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-CJSZINFr.js +266 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.BDwrLSGN.js +2 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.BVu7tZDe.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.html +43 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +21 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +5 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CQJ9SCIQ.js +5 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +17 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- package/node_modules/playwright-core/lib/zipBundle.js +34 -0
- package/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
- package/node_modules/playwright-core/package.json +43 -0
- package/node_modules/playwright-core/types/protocol.d.ts +23824 -0
- package/node_modules/playwright-core/types/structs.d.ts +45 -0
- package/node_modules/playwright-core/types/types.d.ts +22843 -0
- package/package.json +6 -2
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { logger } from "../../utils/logger.js";
|
|
4
4
|
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
5
5
|
import { MAX_TESTS_TO_GENERATE, MAX_RECOMMENDATIONS, MAX_CRITICAL_TESTS, PATH_PARAM_UUID_GUIDANCE } from "../test-recommendation/recommendationSections.js";
|
|
6
|
-
function getTestbotPrompt(prTitle, prDescription, diffFile, testDirectory, summaryOutputFile, repositoryPath, baseBranch, maxRecommendations = MAX_RECOMMENDATIONS, maxGenerate = MAX_TESTS_TO_GENERATE,
|
|
6
|
+
function getTestbotPrompt(prTitle, prDescription, diffFile, testDirectory, summaryOutputFile, repositoryPath, baseBranch, maxRecommendations = MAX_RECOMMENDATIONS, maxGenerate = MAX_TESTS_TO_GENERATE, _maxCritical = MAX_CRITICAL_TESTS, prNumber, userPrompt) {
|
|
7
7
|
const promptSection = userPrompt ? `## Follow-up Request via @skyramp-testbot
|
|
8
8
|
|
|
9
9
|
<USER_PROMPT>
|
|
@@ -32,12 +32,7 @@ Use those recommendations as your baseline. Only add or remove tests that the us
|
|
|
32
32
|
Read the diff at \`${diffFile}\`.
|
|
33
33
|
If all changed files are non-application (CI/CD, docs, lock files, config only) β skip to Step 4 (Submit Report) with empty arrays.
|
|
34
34
|
|
|
35
|
-
Otherwise:
|
|
36
|
-
1. Call \`skyramp_analyze_repository\` with \`repositoryPath\`: "${repositoryPath}", \`analysisScope\`: "current_branch_diff"${baseBranch ? `\n , \`baseBranch\`: "${baseBranch}"` : ''}
|
|
37
|
-
2. Call \`skyramp_recommend_tests\` with the returned \`sessionId\`.
|
|
38
|
-
It returns 10 ranked recommendations. Walk through them in rank order and generate
|
|
39
|
-
up to 4 tests. Any recommendation you skip or cannot generate goes to
|
|
40
|
-
\`additionalRecommendations\`.`;
|
|
35
|
+
Otherwise: proceed to the numbered steps below.`;
|
|
41
36
|
return `<TITLE>${prTitle}</TITLE>
|
|
42
37
|
<DESCRIPTION>${prDescription}</DESCRIPTION>
|
|
43
38
|
<CODE CHANGES>${diffFile}</CODE CHANGES>
|
|
@@ -53,7 +48,7 @@ working tree. Step 2/3 handles their maintenance (drift detection, health checks
|
|
|
53
48
|
Only generate tests for NEW endpoints or code paths not already covered by existing bot
|
|
54
49
|
tests. The analyze tool uses PR comment history to avoid duplicates.
|
|
55
50
|
|
|
56
|
-
1. Call \`skyramp_analyze_changes\` with \`repositoryPath\`: "${repositoryPath}", \`scope\`: "branch_diff", \`topN\`: ${maxRecommendations}${prNumber ? `, \`prNumber\`: ${prNumber}` : ""} β discovers existing Skyramp tests, scans endpoints changed in the diff, loads workspace config, and returns ${maxRecommendations} ranked ADD recommendations.${prNumber ? " Uses PR comment history to avoid re-recommending already-generated tests." : ""}
|
|
51
|
+
1. Call \`skyramp_analyze_changes\` with \`repositoryPath\`: "${repositoryPath}", \`scope\`: "branch_diff", \`topN\`: ${maxRecommendations}${baseBranch ? `, \`baseBranch\`: "${baseBranch}"` : ""}${prNumber ? `, \`prNumber\`: ${prNumber}` : ""} β discovers existing Skyramp tests, scans endpoints changed in the diff, loads workspace config, and returns ${maxRecommendations} ranked ADD recommendations.${prNumber ? " Uses PR comment history to avoid re-recommending already-generated tests." : ""}
|
|
57
52
|
2. Call \`skyramp_analyze_test_health\` with the \`stateFile\` from step 1 (skip if zero existing tests found) β scores each existing test for drift against the diff and assigns UPDATE / REGENERATE / VERIFY / ADD actions.
|
|
58
53
|
|
|
59
54
|
---
|
|
@@ -93,10 +88,11 @@ Test/Endpoint | Action | Reason
|
|
|
93
88
|
## Step 3: Act
|
|
94
89
|
|
|
95
90
|
Execute the actions from Step 2.
|
|
96
|
-
- **Total generated**:
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
99
|
-
-
|
|
91
|
+
- **Total generated**: Follow the **"Budget: N generate"** line in the Execution Plan returned by the analysis (section "## Execution Plan", "Budget: N generate + M additional = T total"). Generate exactly the GENERATE-tagged items in that plan. Do NOT generate fewer.
|
|
92
|
+
- **UI test priority**: If the diff contains frontend/UI changes (e.g. \`.tsx\`, \`.jsx\`, \`.vue\`, \`.svelte\` files), you MUST attempt to generate at least one UI test. Use \`browser_navigate\` to the app's base URL β if the app responds, record a trace and generate the test. Only skip if the app is unreachable. This takes priority over generating additional backend-only tests.
|
|
93
|
+
- **Critical categories first**: At least 1 of the generated tests MUST be from a critical category (new_endpoint, security_boundary, business_rule, data_integrity, breaking_change) if such candidates exist in the GENERATE set.
|
|
94
|
+
- **Fill remaining slots**: Generate GENERATE-tagged items in the exact order listed. Do not skip or reorder.
|
|
95
|
+
- Critical-category tests are already ranked first by the pre-computed scores β follow the plan order.
|
|
100
96
|
|
|
101
97
|
### UPDATE
|
|
102
98
|
Edit the existing test file directly:
|
|
@@ -111,6 +107,16 @@ Use the same filename so it overwrites the old file.
|
|
|
111
107
|
### ADD
|
|
112
108
|
Generate a net-new test. Use a unique descriptive filename to avoid overwriting existing files.
|
|
113
109
|
|
|
110
|
+
**Auth β determine ONCE, apply to EVERY tool call:**
|
|
111
|
+
1. Start from the Execution Plan returned by \`skyramp_analyze_changes\` β it includes pre-resolved auth params.
|
|
112
|
+
2. **Override check (MANDATORY when workspace shows \`authType: none\` or \`authHeader: ""\`):** Read the source code for auth middleware β \`HTTPBearer\`, \`EnsureSessionDep\`, \`jwt.verify\`, \`@UseGuards\`, \`Depends(get_current_user)\`, \`passport\`, session middleware. If found, the workspace config is misconfigured β override with the correct \`authHeader\` and \`authScheme\` regardless.
|
|
113
|
+
3. **For \`Authorization\` Bearer APIs:** pass \`authScheme: "Bearer"\` (or the correct scheme) to \`skyramp_scenario_test_generation\` and \`skyramp_contract_test_generation\` β this embeds auth in the generated test file so the executor sends the correct header at run time. **NEVER pass \`authToken\` with a fabricated value** β omitting \`authToken\` auto-inserts \`SKYRAMP_PLACEHOLDER_TOKEN\` correctly.
|
|
114
|
+
**Exception β \`skyramp_integration_test_generation\` with \`scenarioFile\` only:**
|
|
115
|
+
- If workspace has \`api.authType\` set: omit auth params entirely β passing auth here alongside workspace \`authType\` causes "Auth header and auth type cannot be supported at the same time".
|
|
116
|
+
- If workspace has no \`api.authType\`: pass \`authHeader\` only (no \`authScheme\`).
|
|
117
|
+
4. **For non-Authorization headers** (e.g. \`X-Api-Key\`, \`Cookie\`): pass \`authHeader\` only β placeholder is auto-generated. Do NOT invent a token value.
|
|
118
|
+
5. Only pass \`authHeader: ""\` if you can confirm the endpoint is truly unauthenticated.
|
|
119
|
+
|
|
114
120
|
**How to generate each type (for ADD and REGENERATE):**
|
|
115
121
|
- **Integration**: call \`skyramp_scenario_test_generation\` per step (sequentially), then \`skyramp_integration_test_generation\` with the scenario file.
|
|
116
122
|
Scenario JSON goes in the same \`outputDir\` (e.g. \`tests/scenario_<name>.json\`), not \`.skyramp/\`.
|
|
@@ -120,15 +126,31 @@ Generate a net-new test. Use a unique descriptive filename to avoid overwriting
|
|
|
120
126
|
For client-facing APIs consumed by frontend: add \`consumerMode: true\`.
|
|
121
127
|
For critical service boundaries: pass both \`providerMode\` and \`consumerMode\`.
|
|
122
128
|
- ${PATH_PARAM_UUID_GUIDANCE}
|
|
123
|
-
- **
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
- **UI**: First check for existing Playwright trace \`.zip\` files in the repo (Testbot scans recursively up to 5 directory levels β \`${testDirectory}\`, \`frontend/\`, \`public/\`, \`.skyramp/\`, or any subdirectory).
|
|
130
|
+
If a relevant trace exists (covers the UI changes in this PR), use it directly with \`skyramp_ui_test_generation\`.
|
|
131
|
+
If NO relevant trace exists, record one using Playwright browser tools:
|
|
132
|
+
1. \`browser_navigate\` to the app's base URL (from workspace config \`api.baseUrl\`)
|
|
133
|
+
2. \`browser_snapshot\` to see the current page (ARIA tree)
|
|
134
|
+
3. Use \`browser_click\`, \`browser_type\`, \`browser_fill_form\`, etc. to perform the user interactions described in the test recommendation
|
|
135
|
+
4. \`browser_snapshot\` after each interaction that changes the page
|
|
136
|
+
5. \`skyramp_export_zip\` with an **absolute** output path: \`<repositoryPath>/.skyramp/<test_name>_trace.zip\`
|
|
137
|
+
6. \`skyramp_ui_test_generation\` with \`playwrightInput\` set to the **absolute** path of the exported zip
|
|
138
|
+
If \`browser_navigate\` fails (app not running / connection refused), move to \`additionalRecommendations\` with the failure reason.
|
|
139
|
+
Record at most 1-2 UI traces per run to stay within tool call budget.
|
|
140
|
+
Tips: Use \`browser_snapshot\` liberally. For custom dropdowns (Radix, MUI): click combobox β snapshot β click option (NOT \`browser_select_option\`).
|
|
141
|
+
- **E2E**: Only if BOTH a backend trace \`.json\` AND a Playwright \`.zip\` already exist in the repo. Without both, move to \`additionalRecommendations\`.
|
|
128
142
|
- Skip smoke tests entirely.
|
|
129
143
|
|
|
130
144
|
**Scenario quality:** Verify preconditions before each step (e.g. create before update).
|
|
131
145
|
|
|
146
|
+
### Failure Recovery (MANDATORY)
|
|
147
|
+
If a test generation tool call fails:
|
|
148
|
+
1. **Retry once** with the same parameters.
|
|
149
|
+
2. If it fails again, **skip** that candidate and move to the next ranked candidate.
|
|
150
|
+
3. If all candidates in the GENERATE set fail, fall back to generating the **simplest possible test**: a single contract test for the highest-scored endpoint (GET β 200 or POST β 201).
|
|
151
|
+
4. You MUST generate **at least 1 test** for any PR that touches application code. Zero generated tests is NOT acceptable.
|
|
152
|
+
5. Log skipped candidates in \`issuesFound\` with the error message.
|
|
153
|
+
|
|
132
154
|
**After generation, fix chaining only:**
|
|
133
155
|
- Path params like \`id = 'id'\` β \`skyramp.get_response_value(prev_response, "id")\`
|
|
134
156
|
- Hardcoded IDs in request bodies β dynamic values from prior response
|
|
@@ -151,7 +173,7 @@ Call \`skyramp_submit_report\` with \`summaryOutputFile\`: "${summaryOutputFile}
|
|
|
151
173
|
\`commitMessage\`: under 72 chars, e.g. "add integration tests for /products and /orders"
|
|
152
174
|
|
|
153
175
|
**newTestsCreated** β files that are new to the repo (ADD or REGENERATE actions, at most ${maxGenerate}):
|
|
154
|
-
\`testId
|
|
176
|
+
\`testId\` (human-readable kebab-case, e.g. \`contract-get-products\`), \`testType\`, \`category\`, \`endpoint\`, \`fileName\`, \`description\`, \`scenarioFile\`, \`reasoning\`
|
|
155
177
|
If no tests were generated, pass an empty array.
|
|
156
178
|
If you created a test and then fixed it (chaining, compilation, imports), report it only here.
|
|
157
179
|
|
|
@@ -161,12 +183,12 @@ Call \`skyramp_submit_report\` with \`summaryOutputFile\`: "${summaryOutputFile}
|
|
|
161
183
|
Do NOT include files that were newly created in this run (those go in \`newTestsCreated\`).
|
|
162
184
|
|
|
163
185
|
**additionalRecommendations** β items you could not act on (quota exceeded, missing traces, etc.):
|
|
164
|
-
\`testId
|
|
186
|
+
\`testId\` (human-readable kebab-case, e.g. \`integration-products-orders-workflow\`), \`testType\`, \`category\`, \`scenarioName\`, \`priority\` (high/medium/low β used for sorting, not displayed), \`description\`, \`steps\`, \`reasoning\`
|
|
165
187
|
Keep each \`description\` to one sentence. Omit \`requestBody\` and \`responseBody\` from steps.
|
|
166
188
|
Include at most 3 steps per recommendation.
|
|
167
|
-
If a test cannot be generated because
|
|
168
|
-
(not in \`issuesFound\`)
|
|
169
|
-
|
|
189
|
+
If a UI test cannot be generated because trace recording failed (app not accessible, browser error),
|
|
190
|
+
include it here (not in \`issuesFound\`) with the failure reason.
|
|
191
|
+
If an E2E test cannot be generated because the app was not running (browser_navigate failed), include it here with the failure reason.
|
|
170
192
|
|
|
171
193
|
**nextSteps** β actionable next steps when test failures suggest misconfiguration.
|
|
172
194
|
Each entry must be a single-line string (no embedded newlines).
|
|
@@ -9,7 +9,7 @@ export class ModularizationService {
|
|
|
9
9
|
testType: params.testType,
|
|
10
10
|
language: params.language,
|
|
11
11
|
});
|
|
12
|
-
const testType = params.testType;
|
|
12
|
+
const testType = (params.testType || TestType.UI);
|
|
13
13
|
// Check if the test type is one that should not be modularized
|
|
14
14
|
if (!params.isTraceBased) {
|
|
15
15
|
return {
|
|
@@ -8,7 +8,7 @@ import { logger } from "../utils/logger.js";
|
|
|
8
8
|
import { buildContainerEnv } from "./containerEnv.js";
|
|
9
9
|
const DEFAULT_TIMEOUT = 300000; // 5 minutes
|
|
10
10
|
const MAX_CONCURRENT_EXECUTIONS = 5;
|
|
11
|
-
export const EXECUTOR_DOCKER_IMAGE = "skyramp/executor:v1.3.
|
|
11
|
+
export const EXECUTOR_DOCKER_IMAGE = "skyramp/executor:v1.3.16";
|
|
12
12
|
const DOCKER_PLATFORM = "linux/amd64";
|
|
13
13
|
const EXECUTION_PROGRESS_INTERVAL = 10000; // 10 seconds between progress updates during execution
|
|
14
14
|
// Temp file with valid empty JSON β used instead of /dev/null for .json config files
|
|
@@ -6,6 +6,7 @@ import { getPathParameterValidationError, OUTPUT_DIR_FIELD_NAME, PATH_PARAMS_FIE
|
|
|
6
6
|
import { getEntryPoint } from "../utils/telemetry.js";
|
|
7
7
|
import { getLanguageSteps } from "../utils/language-helper.js";
|
|
8
8
|
import { logger } from "../utils/logger.js";
|
|
9
|
+
import { normalizeLanguageParams } from "../utils/normalizeParams.js";
|
|
9
10
|
export class TestGenerationService {
|
|
10
11
|
client;
|
|
11
12
|
constructor() {
|
|
@@ -13,6 +14,8 @@ export class TestGenerationService {
|
|
|
13
14
|
}
|
|
14
15
|
async generateTest(params) {
|
|
15
16
|
try {
|
|
17
|
+
// Normalize language/framework to handle LLM case variations
|
|
18
|
+
normalizeLanguageParams(params);
|
|
16
19
|
// Log prompt parameter using reusable utility
|
|
17
20
|
logger.info("Generating test", {
|
|
18
21
|
prompt: params.prompt,
|
|
@@ -220,7 +223,11 @@ The generated test file remains unchanged and ready to use as-is.
|
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
225
|
}
|
|
223
|
-
|
|
226
|
+
// Map authScheme β authType for the npm client which uses authType internally
|
|
227
|
+
if (generateOptions.authScheme !== undefined) {
|
|
228
|
+
generateOptions.authType = generateOptions.authScheme;
|
|
229
|
+
}
|
|
230
|
+
delete generateOptions.authScheme;
|
|
224
231
|
const result = await this.client.generateRestTest(generateOptions);
|
|
225
232
|
// Check if the result indicates failure
|
|
226
233
|
if (result && result.length > 0) {
|
|
@@ -92,7 +92,7 @@ describe("TestGenerationService β authType/authScheme not passed to library",
|
|
|
92
92
|
generateRestTest: mockGenerateRestTest,
|
|
93
93
|
}));
|
|
94
94
|
});
|
|
95
|
-
it("
|
|
95
|
+
it("maps authScheme to authType for the npm client", async () => {
|
|
96
96
|
const svc = new StubService();
|
|
97
97
|
svc.buildGenerationOptions = () => ({
|
|
98
98
|
authHeader: "Authorization",
|
|
@@ -105,8 +105,8 @@ describe("TestGenerationService β authType/authScheme not passed to library",
|
|
|
105
105
|
svc.handleApiAnalysis = async () => null;
|
|
106
106
|
await svc.generateTest({ ...BASE });
|
|
107
107
|
const callArgs = mockGenerateRestTest.mock.calls[0][0];
|
|
108
|
-
expect(callArgs.authType).
|
|
109
|
-
expect(callArgs.authScheme).
|
|
108
|
+
expect(callArgs.authType).toBe("Token");
|
|
109
|
+
expect(callArgs.authScheme).toBeUndefined();
|
|
110
110
|
expect(callArgs.authHeader).toBe("Authorization");
|
|
111
111
|
});
|
|
112
112
|
it("passes authHeader through to library without modification", async () => {
|
|
@@ -259,8 +259,8 @@ describe("TestGenerationService β trace-based auth in executeGeneration", () =
|
|
|
259
259
|
await svc.generateTest({ ...BASE });
|
|
260
260
|
const callArgs = mockGenerateRestTest.mock.calls[0][0];
|
|
261
261
|
expect(callArgs.authHeader).toBe("Authorization");
|
|
262
|
-
expect(callArgs.
|
|
263
|
-
expect(callArgs.
|
|
262
|
+
expect(callArgs.authType).toBe("Token");
|
|
263
|
+
expect(callArgs.authScheme).toBeUndefined();
|
|
264
264
|
});
|
|
265
265
|
it("populates X-Api-Key from trace with empty authScheme", async () => {
|
|
266
266
|
const traceFile = writeTrace([
|
|
@@ -284,8 +284,8 @@ describe("TestGenerationService β trace-based auth in executeGeneration", () =
|
|
|
284
284
|
await svc.generateTest({ ...BASE });
|
|
285
285
|
const callArgs = mockGenerateRestTest.mock.calls[0][0];
|
|
286
286
|
expect(callArgs.authHeader).toBe("X-Api-Key");
|
|
287
|
-
expect(callArgs.
|
|
288
|
-
expect(callArgs.
|
|
287
|
+
expect(callArgs.authType).toBe("");
|
|
288
|
+
expect(callArgs.authScheme).toBeUndefined();
|
|
289
289
|
});
|
|
290
290
|
it("overrides conflicting authScheme with trace value", async () => {
|
|
291
291
|
const traceFile = writeTrace([
|
|
@@ -309,8 +309,8 @@ describe("TestGenerationService β trace-based auth in executeGeneration", () =
|
|
|
309
309
|
await svc.generateTest({ ...BASE });
|
|
310
310
|
const callArgs = mockGenerateRestTest.mock.calls[0][0];
|
|
311
311
|
expect(callArgs.authHeader).toBe("Authorization");
|
|
312
|
-
expect(callArgs.
|
|
313
|
-
expect(callArgs.
|
|
312
|
+
expect(callArgs.authType).toBe("Token");
|
|
313
|
+
expect(callArgs.authScheme).toBeUndefined();
|
|
314
314
|
});
|
|
315
315
|
it("does not override auth when trace has no auth header", async () => {
|
|
316
316
|
const traceFile = writeTrace([
|
|
@@ -333,7 +333,7 @@ describe("TestGenerationService β trace-based auth in executeGeneration", () =
|
|
|
333
333
|
await svc.generateTest({ ...BASE });
|
|
334
334
|
const callArgs = mockGenerateRestTest.mock.calls[0][0];
|
|
335
335
|
expect(callArgs.authHeader).toBe("Authorization");
|
|
336
|
-
expect(callArgs.
|
|
337
|
-
expect(callArgs.
|
|
336
|
+
expect(callArgs.authType).toBe("Bearer");
|
|
337
|
+
expect(callArgs.authScheme).toBeUndefined();
|
|
338
338
|
});
|
|
339
339
|
});
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import fs from "fs";
|
|
2
3
|
import { logger } from "../../utils/logger.js";
|
|
3
4
|
import { TestType } from "../../types/TestTypes.js";
|
|
4
5
|
import { ModularizationService, } from "../../services/ModularizationService.js";
|
|
5
6
|
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
7
|
+
import { normalizeLanguageParams, resolveParamAliases, } from "../../utils/normalizeParams.js";
|
|
6
8
|
const modularizationSchema = {
|
|
7
9
|
testFile: z
|
|
8
10
|
.string()
|
|
9
11
|
.describe("The test file to process with modularization principles applied"),
|
|
10
|
-
language: z
|
|
12
|
+
language: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("The programming language of the test file. Inferred from file extension if not provided."),
|
|
11
16
|
testType: z
|
|
12
17
|
.enum([TestType.UI, TestType.E2E, TestType.INTEGRATION])
|
|
13
|
-
.
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Specifies the type of test (UI, E2E, or Integration). Defaults to 'ui'. DO NOT USE TEST NAME/DESCRIPTION AS TEST TYPE."),
|
|
14
20
|
isTraceBased: z
|
|
15
21
|
.boolean()
|
|
16
22
|
.default(false)
|
|
17
|
-
.describe("Whether the test is generated from traces.
|
|
23
|
+
.describe("Whether the test is generated from traces. MUST be set to true when the test was generated from a Playwright trace (browser_* tools + skyramp_export_zip) or from skyramp_start/stop_trace_collection."),
|
|
18
24
|
prompt: z
|
|
19
25
|
.string()
|
|
20
|
-
.
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("The prompt or code content to process. If not provided, the test file content is used."),
|
|
21
28
|
};
|
|
22
29
|
const TOOL_NAME = "skyramp_modularization";
|
|
23
30
|
export function registerModularizationTool(server) {
|
|
@@ -44,10 +51,45 @@ After modularization, if errors remain, call skyramp_fix_errors.
|
|
|
44
51
|
}, async (params) => {
|
|
45
52
|
let errorResult;
|
|
46
53
|
try {
|
|
54
|
+
// Resolve aliases and normalize
|
|
55
|
+
resolveParamAliases(params, {
|
|
56
|
+
testFilePath: "testFile",
|
|
57
|
+
file: "testFile",
|
|
58
|
+
});
|
|
59
|
+
normalizeLanguageParams(params);
|
|
60
|
+
// Infer language from file extension if not provided
|
|
61
|
+
if (!params.language && params.testFile) {
|
|
62
|
+
if (params.testFile.endsWith(".ts"))
|
|
63
|
+
params.language = "typescript";
|
|
64
|
+
else if (params.testFile.endsWith(".js"))
|
|
65
|
+
params.language = "javascript";
|
|
66
|
+
else if (params.testFile.endsWith(".py"))
|
|
67
|
+
params.language = "python";
|
|
68
|
+
else if (params.testFile.endsWith(".java"))
|
|
69
|
+
params.language = "java";
|
|
70
|
+
else
|
|
71
|
+
params.language = "typescript";
|
|
72
|
+
}
|
|
73
|
+
// Default testType to 'ui'
|
|
74
|
+
if (!params.testType)
|
|
75
|
+
params.testType = TestType.UI;
|
|
76
|
+
// For UI/E2E/Integration tests, always enable modularization.
|
|
77
|
+
// These test types are trace-based and benefit from modularization.
|
|
78
|
+
if (!params.isTraceBased && [TestType.UI, TestType.E2E, TestType.INTEGRATION].includes(params.testType))
|
|
79
|
+
params.isTraceBased = true;
|
|
80
|
+
// Default prompt to test file content
|
|
81
|
+
if (!params.prompt && params.testFile) {
|
|
82
|
+
try {
|
|
83
|
+
params.prompt = fs.readFileSync(params.testFile, "utf8");
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
params.prompt = `Modularize the test in ${params.testFile}`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
47
89
|
logger.info("Generating modularization", {
|
|
48
90
|
testFile: params.testFile,
|
|
49
91
|
language: params.language,
|
|
50
|
-
prompt: params.prompt,
|
|
92
|
+
prompt: params.prompt?.substring(0, 100),
|
|
51
93
|
testType: params.testType,
|
|
52
94
|
});
|
|
53
95
|
const service = new ModularizationService();
|
|
@@ -69,10 +111,10 @@ After modularization, if errors remain, call skyramp_fix_errors.
|
|
|
69
111
|
}
|
|
70
112
|
finally {
|
|
71
113
|
AnalyticsService.pushMCPToolEvent(TOOL_NAME, errorResult, {
|
|
72
|
-
prompt: params.prompt,
|
|
114
|
+
prompt: params.prompt ? `[${params.prompt.length} chars]` : "",
|
|
73
115
|
testFile: params.testFile,
|
|
74
|
-
language: params.language,
|
|
75
|
-
testType: params.testType,
|
|
116
|
+
language: params.language ?? "",
|
|
117
|
+
testType: params.testType ?? "",
|
|
76
118
|
});
|
|
77
119
|
}
|
|
78
120
|
});
|
|
@@ -96,16 +96,24 @@ export class ContractTestService extends TestGenerationService {
|
|
|
96
96
|
const result = await super.generateTest(params);
|
|
97
97
|
if (result.isError)
|
|
98
98
|
return result;
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
const content = [...result.content];
|
|
100
|
+
const sampleDataInstructions = this.buildSampleDataInstructions(params);
|
|
101
|
+
if (sampleDataInstructions) {
|
|
102
|
+
content.push({ type: "text", text: sampleDataInstructions });
|
|
103
|
+
}
|
|
104
|
+
if (params.providerMode) {
|
|
105
|
+
content.push({
|
|
106
|
+
type: "text",
|
|
107
|
+
text: this.buildAssertionEnhancementInstructions(),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (params.consumerMode) {
|
|
111
|
+
content.push({
|
|
112
|
+
type: "text",
|
|
113
|
+
text: this.buildConsumerStubReplacementInstructions(),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return { ...result, content };
|
|
109
117
|
}
|
|
110
118
|
buildSampleDataInstructions(params) {
|
|
111
119
|
const sections = [];
|
|
@@ -114,7 +122,7 @@ export class ContractTestService extends TestGenerationService {
|
|
|
114
122
|
sections.push("- **Parent provisioning request data**: the inline JSON/dict literals passed as request bodies inside setup/teardown functions that create parent resources.");
|
|
115
123
|
}
|
|
116
124
|
return `
|
|
117
|
-
βοΈ **CRITICAL
|
|
125
|
+
βοΈ **CRITICAL STEP 1 OF 2 β Do this immediately along with test generation:**
|
|
118
126
|
|
|
119
127
|
Inspect the following locations in the generated file and replace any placeholder values with realistic ones:
|
|
120
128
|
|
|
@@ -136,7 +144,7 @@ ${sections.join("\n")}
|
|
|
136
144
|
2. Find only the inline JSON/dict literals identified above.
|
|
137
145
|
3. Replace every placeholder value using the rules above.
|
|
138
146
|
4. Leave all realistic values unchanged.
|
|
139
|
-
5. Write the updated file.
|
|
147
|
+
5. Write the updated file. Then immediately proceed to STEP 2 OF 2.
|
|
140
148
|
|
|
141
149
|
**What NOT to do β any of these is a violation:**
|
|
142
150
|
- Do NOT change function signatures, method names, class names, imports, or variable names.
|
|
@@ -147,6 +155,111 @@ ${sections.join("\n")}
|
|
|
147
155
|
- Do NOT extract, hoist, or expose any request body or data as a global variable, module-level constant, or shared fixture β keep all data inline exactly where it already is.
|
|
148
156
|
- Do NOT reference or reuse request body data across functions for comparison or any other purpose.
|
|
149
157
|
- Do NOT make any other "improvements" beyond the value replacements described above.
|
|
158
|
+
`;
|
|
159
|
+
}
|
|
160
|
+
buildAssertionEnhancementInstructions() {
|
|
161
|
+
return `
|
|
162
|
+
βοΈ **CRITICAL STEP 2 OF 2 β Do this immediately along with test generation:**
|
|
163
|
+
|
|
164
|
+
**Enhance response body assertions in test functions immediately.** Do NOT proceed to test execution until this step is complete.
|
|
165
|
+
|
|
166
|
+
The generated contract test contains only basic assertions (status code, top-level schema checks). For each **test function** (NOT \`beforeAll\` or \`afterAll\`), inspect the response body assertions and add or strengthen them using the rules below.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
**IMPORTANT β How to access response body fields (use the SDK helpers, NOT dict/attribute access on the response variable):**
|
|
171
|
+
|
|
172
|
+
- **Python**: \`skyramp.get_response_value(<response_var>, "<json_path>")\`
|
|
173
|
+
- e.g. \`skyramp.get_response_value(products_POST_response, "id")\`
|
|
174
|
+
- e.g. \`skyramp.get_response_value(orders_POST_response, "items.0.product_id")\`
|
|
175
|
+
- **TypeScript (Playwright)**: \`getResponseValue(<response_var>, "<json_path>")\` (already imported from \`@skyramp/skyramp\`)
|
|
176
|
+
- e.g. \`getResponseValue(productsPostResponse, "id")\`
|
|
177
|
+
- **JavaScript (Playwright)**: \`getResponseValue(<response_var>, "<json_path>")\` (already imported from \`@skyramp/skyramp\`)
|
|
178
|
+
- e.g. \`getResponseValue(productsPostResponse, "id")\`
|
|
179
|
+
- **Java**: \`getValue(<response_var>, "<json_path>")\` (already imported)
|
|
180
|
+
- e.g. \`getValue(productsPostResponse, "id")\`
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
**What to assert after each request:**
|
|
185
|
+
|
|
186
|
+
1. **Non-null / non-empty fields** β After any POST or PUT that creates or updates a resource, assert that key identifying fields are present and non-empty:
|
|
187
|
+
- IDs, names, emails, and other primary fields must not be null/None/empty.
|
|
188
|
+
- Python: \`assert skyramp.get_response_value(products_POST_response, "id") is not None\`
|
|
189
|
+
- TypeScript: \`expect(getResponseValue(productsPostResponse, "id"), 'id').not.toBeNull();\`
|
|
190
|
+
- JavaScript: \`assert.notStrictEqual(getResponseValue(productsPostResponse, "id"), null, 'id should not be null');\`
|
|
191
|
+
- Java: \`assertNotNull(getValue(productsPostResponse, "id"));\`
|
|
192
|
+
|
|
193
|
+
2. **Echo-back values** β When the request body sends a value the response is expected to return unchanged (name, email, status, price, etc.), assert the response value equals the sent value:
|
|
194
|
+
- Python: \`assert skyramp.get_response_value(products_POST_response, "name") == "Skyramp Tester"\`
|
|
195
|
+
- TypeScript: \`expect(getResponseValue(productsPostResponse, "name"), 'name').toBe("Skyramp Tester");\`
|
|
196
|
+
- JavaScript: \`assert.strictEqual(getResponseValue(productsPostResponse, "name"), "Skyramp Tester", 'name should match request');\`
|
|
197
|
+
- Java: \`assertEquals("Skyramp Tester", getValue(productsPostResponse, "name"));\`
|
|
198
|
+
|
|
199
|
+
3. **Value ranges** β For numeric fields where a realistic range is inferable from the field name, schema constraints (minimum/maximum), or domain knowledge:
|
|
200
|
+
- Assert the value falls within the expected range.
|
|
201
|
+
- Python: \`assert skyramp.get_response_value(products_POST_response, "price") >= 0\`
|
|
202
|
+
- TypeScript: \`expect(getResponseValue(productsPostResponse, "price")).toBeGreaterThanOrEqual(0);\`
|
|
203
|
+
- JavaScript: \`assert.ok(getResponseValue(productsPostResponse, "price") >= 0, 'price should be non-negative');\`
|
|
204
|
+
- Include upper bounds when the OpenAPI schema defines them (e.g. \`maximum\`, \`minimum\`).
|
|
205
|
+
|
|
206
|
+
4. **Format/type constraints** β For string fields with a known format, assert the format rather than just the type:
|
|
207
|
+
- **UUID**: assert the value matches the UUID pattern (\`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\`).
|
|
208
|
+
- **Date / date-time**: assert the value is a valid ISO 8601 date or datetime string.
|
|
209
|
+
- **IP address**: assert the value matches IPv4 or IPv6 format.
|
|
210
|
+
- **Email**: assert the value contains \`@\` and a domain.
|
|
211
|
+
- **URL / URI**: assert the value starts with \`http://\` or \`https://\`.
|
|
212
|
+
- Use format info from the OpenAPI schema (\`format: uuid\`, \`format: date-time\`, etc.) to identify these fields.
|
|
213
|
+
|
|
214
|
+
5. **Specific known values** β For fields where the expected value can be determined from context:
|
|
215
|
+
- Check the OpenAPI schema for \`enum\`, \`const\`, or \`example\` values and assert accordingly.
|
|
216
|
+
- Python: \`assert skyramp.get_response_value(orders_POST_response, "status") == "pending"\`
|
|
217
|
+
- TypeScript: \`expect(getResponseValue(ordersPostResponse, "status"), 'status').toBe("pending");\`
|
|
218
|
+
- JavaScript: \`assert.strictEqual(getResponseValue(ordersPostResponse, "status"), "pending", 'status should be pending');\`
|
|
219
|
+
- Java: \`assertEquals("pending", getValue(ordersPostResponse, "status"));\`
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
**Scope rules:**
|
|
224
|
+
- Only modify test functions β do NOT touch \`beforeAll\`, \`afterAll\`, or any setup/teardown helper.
|
|
225
|
+
- Only add assertions that are clearly supported by the schema, field name, request body, or observable codebase evidence. Do not invent constraints.
|
|
226
|
+
- Add new assertions **immediately after** the existing status-code and schema assertions β do not restructure the test.
|
|
227
|
+
|
|
228
|
+
**What NOT to do β any of these is a violation:**
|
|
229
|
+
- Do NOT access response body fields via dict syntax (\`response["field"]\`) or attribute access (\`response.field\`) β always use the SDK helper (\`get_response_value\` / \`getResponseValue\` / \`getValue\`).
|
|
230
|
+
- Do NOT modify \`beforeAll\` or \`afterAll\` functions.
|
|
231
|
+
- Do NOT change existing assertions β only add new ones.
|
|
232
|
+
- Do NOT add assertions for fields where no constraint is clearly inferable.
|
|
233
|
+
- Do NOT restructure, reformat, or reorder any existing code.
|
|
234
|
+
- Do NOT add comments or docstrings.
|
|
235
|
+
- Do NOT change function signatures, imports, or variable names.
|
|
236
|
+
`;
|
|
237
|
+
}
|
|
238
|
+
buildConsumerStubReplacementInstructions() {
|
|
239
|
+
return `
|
|
240
|
+
βοΈ **CRITICAL NEXT STEP β Replace stub test function with real consumer-side code:**
|
|
241
|
+
|
|
242
|
+
The generated consumer contract test contains a stub test function that uses Skyramp's \`send_request\` library to directly call the mocked endpoint. The purpose of a consumer contract test is to verify that the consumer's own code correctly interacts with the mocked endpoint β not to call it directly. You must create a meaningful version of this test alongside the original stub.
|
|
243
|
+
|
|
244
|
+
**What to do:**
|
|
245
|
+
|
|
246
|
+
1. **Keep the original stub test function exactly as generated** β do not modify it.
|
|
247
|
+
|
|
248
|
+
2. **Duplicate the test function** and give the copy a distinct name (e.g., append \`_consumer\` or \`_real\` to the function name).
|
|
249
|
+
|
|
250
|
+
3. **In the duplicate only**, replace the stub function body (the \`send_request\` call and any surrounding boilerplate that directly hits the endpoint) with the actual consumer-side code that triggers the same endpoint:
|
|
251
|
+
- Search the codebase for the consumer code that calls this endpoint (look for the HTTP method + path pattern, SDK client calls, or service layer methods).
|
|
252
|
+
- Import or invoke that consumer code in place of the \`send_request\` stub.
|
|
253
|
+
- Ensure the mock is still active during the call so the response is intercepted by Skyramp.
|
|
254
|
+
|
|
255
|
+
4. **Preserve everything else in the duplicate unchanged**: mock setup, teardown, response assertions, test structure, imports (add only what is needed for the consumer code).
|
|
256
|
+
|
|
257
|
+
**Scope rules:**
|
|
258
|
+
- Do NOT modify the original stub test function or any other function in the file.
|
|
259
|
+
- Only change the stub call inside the duplicated test function β not assertions, mock configuration, or setup/teardown.
|
|
260
|
+
- If the consumer code cannot be found in the codebase, leave a clearly marked \`TODO\` comment in the duplicate's body and do not fabricate code.
|
|
261
|
+
- Do NOT restructure, reformat, or reorder any existing code outside the new duplicate function.
|
|
262
|
+
- Do NOT add comments or docstrings beyond the \`TODO\` if needed.
|
|
150
263
|
`;
|
|
151
264
|
}
|
|
152
265
|
validateInputs(params) {
|
|
@@ -25,6 +25,88 @@ export class IntegrationTestService extends TestGenerationService {
|
|
|
25
25
|
getTestType() {
|
|
26
26
|
return TestType.INTEGRATION;
|
|
27
27
|
}
|
|
28
|
+
async generateTest(params) {
|
|
29
|
+
const result = await super.generateTest(params);
|
|
30
|
+
if (result.isError)
|
|
31
|
+
return result;
|
|
32
|
+
const content = [...result.content];
|
|
33
|
+
content.push({
|
|
34
|
+
type: "text",
|
|
35
|
+
text: this.buildAssertionEnhancementInstructions(),
|
|
36
|
+
});
|
|
37
|
+
return { ...result, content };
|
|
38
|
+
}
|
|
39
|
+
buildAssertionEnhancementInstructions() {
|
|
40
|
+
return `
|
|
41
|
+
βοΈ **CRITICAL NEXT STEP β Enhance response body assertions after each request:**
|
|
42
|
+
|
|
43
|
+
The generated integration test contains only basic status-code assertions after each \`send_request\` / \`sendRequest\` call. For every request in the test (especially POST, PUT, and GET), add meaningful assertions on the response body using the rules below.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
**IMPORTANT β How to access response body fields (use the SDK helpers, NOT dict/attribute access on the response variable):**
|
|
48
|
+
|
|
49
|
+
- **Python**: \`skyramp.get_response_value(<response_var>, "<json_path>")\`
|
|
50
|
+
- e.g. \`skyramp.get_response_value(products_POST_response, "id")\`
|
|
51
|
+
- e.g. \`skyramp.get_response_value(orders_POST_response, "items.0.product_id")\`
|
|
52
|
+
- **TypeScript (Playwright)**: \`getResponseValue(<response_var>, "<json_path>")\` (already imported from \`@skyramp/skyramp\`)
|
|
53
|
+
- e.g. \`getResponseValue(productsPostResponse, "id")\`
|
|
54
|
+
- **JavaScript (Playwright)**: \`getResponseValue(<response_var>, "<json_path>")\` (already imported from \`@skyramp/skyramp\`)
|
|
55
|
+
- e.g. \`getResponseValue(productsPostResponse, "id")\`
|
|
56
|
+
- **Java**: \`getValue(<response_var>, "<json_path>")\` (already imported)
|
|
57
|
+
- e.g. \`getValue(productsPostResponse, "id")\`
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
**What to assert after each request:**
|
|
62
|
+
|
|
63
|
+
1. **Non-null / non-empty fields** β After any POST or PUT that creates or updates a resource, assert that key identifying fields are present and non-empty:
|
|
64
|
+
- IDs, names, emails, and other primary fields must not be null/None/empty.
|
|
65
|
+
- Python: \`assert skyramp.get_response_value(products_POST_response, "id") is not None\`
|
|
66
|
+
- TypeScript: \`expect(getResponseValue(productsPostResponse, "id"), 'id').not.toBeNull();\`
|
|
67
|
+
- JavaScript: \`assert.notStrictEqual(getResponseValue(productsPostResponse, "id"), null, 'id should not be null');\`
|
|
68
|
+
- Java: \`assertNotNull(getValue(productsPostResponse, "id"));\`
|
|
69
|
+
|
|
70
|
+
2. **Echo-back values** β When the request body sends a value the response is expected to return unchanged (name, email, status, price, etc.), assert the response value equals the sent value:
|
|
71
|
+
- Python: \`assert skyramp.get_response_value(products_POST_response, "name") == "Skyramp Tester"\`
|
|
72
|
+
- TypeScript: \`expect(getResponseValue(productsPostResponse, "name"), 'name').toBe("Skyramp Tester");\`
|
|
73
|
+
- JavaScript: \`assert.strictEqual(getResponseValue(productsPostResponse, "name"), "Skyramp Tester", 'name should match request');\`
|
|
74
|
+
- Java: \`assertEquals("Skyramp Tester", getValue(productsPostResponse, "name"));\`
|
|
75
|
+
|
|
76
|
+
3. **Chained values** β When a value extracted from a prior response (e.g., a POST-created ID) is already used in a subsequent request's \`path_params\` / \`data_override\`, also assert the later response echoes that value back where applicable:
|
|
77
|
+
- Python: \`assert skyramp.get_response_value(product_GET_response, "id") == skyramp.get_response_value(products_POST_response, "id")\`
|
|
78
|
+
- TypeScript: \`expect(getResponseValue(productGetResponse, "id"), 'id').toBe(getResponseValue(productsPostResponse, "id"));\`
|
|
79
|
+
|
|
80
|
+
4. **Value ranges** β For numeric fields where a realistic range is inferable from the field name or domain:
|
|
81
|
+
- Python: \`assert skyramp.get_response_value(products_POST_response, "price") >= 0\`
|
|
82
|
+
- TypeScript: \`expect(getResponseValue(productsPostResponse, "price")).toBeGreaterThanOrEqual(0);\`
|
|
83
|
+
- JavaScript: \`assert.ok(getResponseValue(productsPostResponse, "price") >= 0, 'price should be non-negative');\`
|
|
84
|
+
|
|
85
|
+
5. **Format/type constraints** β For string fields with a known format:
|
|
86
|
+
- **UUID**: assert the value matches \`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\` (use a regex check or string length check).
|
|
87
|
+
- **Date / date-time**: assert the value is a non-empty string parseable as an ISO 8601 date.
|
|
88
|
+
- **Email**: assert the value contains \`@\`.
|
|
89
|
+
- **URL**: assert the value starts with \`http://\` or \`https://\`.
|
|
90
|
+
|
|
91
|
+
6. **Specific known values** β For enum/status fields where only one outcome is valid for this flow:
|
|
92
|
+
- Python: \`assert skyramp.get_response_value(orders_POST_response, "status") == "pending"\`
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
**Scope rules:**
|
|
97
|
+
- Apply to every \`send_request\` / \`sendRequest\` call β including GET and DELETE if they return a body.
|
|
98
|
+
- Only add assertions that are clearly supported by the request body, prior response values, field names, or codebase evidence. Do not invent constraints.
|
|
99
|
+
- Add new assertions **immediately after** the existing status-code assertion for each request β do not move or remove anything.
|
|
100
|
+
|
|
101
|
+
**What NOT to do β any of these is a violation:**
|
|
102
|
+
- Do NOT access response body fields via dict syntax (\`response["field"]\`) or attribute access (\`response.field\`) β always use the SDK helper (\`get_response_value\` / \`getResponseValue\` / \`getValue\`).
|
|
103
|
+
- Do NOT remove or modify existing assertions.
|
|
104
|
+
- Do NOT add assertions for fields where no constraint is clearly inferable.
|
|
105
|
+
- Do NOT restructure, reformat, or reorder any existing code.
|
|
106
|
+
- Do NOT add comments or docstrings.
|
|
107
|
+
- Do NOT change function signatures, imports, or variable names.
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
28
110
|
buildGenerationOptions(params) {
|
|
29
111
|
return {
|
|
30
112
|
...super.buildBaseGenerationOptions(params),
|
|
@@ -33,7 +115,7 @@ export class IntegrationTestService extends TestGenerationService {
|
|
|
33
115
|
scenarioFile: params.scenarioFile,
|
|
34
116
|
};
|
|
35
117
|
}
|
|
36
|
-
async handleApiAnalysis(
|
|
118
|
+
async handleApiAnalysis(_params, _generateOptions) {
|
|
37
119
|
return null;
|
|
38
120
|
}
|
|
39
121
|
}
|