testdriverai 7.3.1 → 7.3.3
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/.claude/settings.local.json +7 -0
- package/.env.example +4 -0
- package/.github/workflows/acceptance-linux-scheduled.yaml +45 -0
- package/.github/workflows/acceptance-windows-scheduled.yaml +54 -0
- package/.github/workflows/acceptance.yaml +106 -0
- package/.github/workflows/publish.yaml +75 -0
- package/.github/workflows/test-init.yml +157 -0
- package/.github/workflows/testdriver.yml +170 -0
- package/.github/workflows/windows-self-hosted.yaml +82 -0
- package/.prettierignore +4 -0
- package/.prettierrc +1 -0
- package/CHANGELOG.md +158 -0
- package/SKILLs.md +17 -0
- package/agent/index.js +32 -3
- package/ai/.claude-plugin/plugin.json +9 -0
- package/docs/GITHUB_COMMENTS.md +330 -0
- package/docs/GITHUB_COMMENTS_ANNOUNCEMENT.md +167 -0
- package/docs/QUICK-START-GITHUB-COMMENTS.md +84 -0
- package/docs/TEST-GITHUB-COMMENTS.md +129 -0
- package/docs/_scripts/generate-skills.js +149 -0
- package/docs/_scripts/link-replacer.js +164 -0
- package/docs/_scripts/upload-docs-to-openai.js +284 -0
- package/docs/claude-mcp-plugin.mdx +160 -0
- package/docs/docs.json +394 -0
- package/docs/github-integration-setup.md +266 -0
- package/docs/guide/best-practices-polling.mdx +154 -0
- package/docs/images/content/account/newprojectsettings.png +0 -0
- package/docs/images/content/account/projectpage.png +0 -0
- package/docs/images/content/account/projectreplays.png +0 -0
- package/docs/images/content/account/team-manage.png +0 -0
- package/docs/images/content/account/teampage.png +0 -0
- package/docs/images/content/extension/cursor.svg +1 -0
- package/docs/images/content/extension/vscode.svg +57 -0
- package/docs/images/content/extension/windsurf.svg +3 -0
- package/docs/images/content/self-hosted/launchtemplateid.png +0 -0
- package/docs/images/content/side-by-side.png +0 -0
- package/docs/images/content/vscode/ide-full.png +0 -0
- package/docs/images/content/vscode/running.png +0 -0
- package/docs/images/content/vscode/vscode-2-assert.png +0 -0
- package/docs/images/content/vscode/vscode-agent-preview.png +0 -0
- package/docs/images/content/vscode/vscode-copilot-ask.png +0 -0
- package/docs/images/content/vscode/vscode-file-creation.png +0 -0
- package/docs/images/content/vscode/vscode-install.png +0 -0
- package/docs/images/content/vscode/vscode-overview.png +0 -0
- package/docs/images/content/vscode/vscode-setup-walkthrough.png +0 -0
- package/docs/images/content/vscode/vscode-stopchat.png +0 -0
- package/docs/images/content/vscode/vscode-stoptest.png +0 -0
- package/docs/images/content/vscode/vscode-tdservice.png +0 -0
- package/docs/images/content/vscode/vscode-test-output.png +0 -0
- package/docs/images/content/vscode/vscode-testhistory.png +0 -0
- package/docs/images/content/vscode/vscode-testpane-runtests.png +0 -0
- package/docs/images/content/vscode/vscode-testpane.png +0 -0
- package/docs/images/template/dark.png +0 -0
- package/docs/images/template/icon.png +0 -0
- package/docs/images/template/light.png +0 -0
- package/docs/snippets/calendar-link.mdx +4 -0
- package/docs/snippets/gitignore-warning.mdx +7 -0
- package/docs/snippets/lifecycle-warning.mdx +6 -0
- package/docs/snippets/test-prereqs.mdx +12 -0
- package/docs/snippets/tests/assert-replay.mdx +7 -0
- package/docs/snippets/tests/assert-yaml.mdx +8 -0
- package/docs/snippets/tests/exec-js-replay.mdx +7 -0
- package/docs/snippets/tests/exec-js-yaml.mdx +32 -0
- package/docs/snippets/tests/exec-shell-replay.mdx +7 -0
- package/docs/snippets/tests/exec-shell-yaml.mdx +15 -0
- package/docs/snippets/tests/hover-image-replay.mdx +7 -0
- package/docs/snippets/tests/hover-image-yaml.mdx +17 -0
- package/docs/snippets/tests/hover-text-replay.mdx +7 -0
- package/docs/snippets/tests/hover-text-with-description-replay.mdx +7 -0
- package/docs/snippets/tests/hover-text-with-description-yaml.mdx +24 -0
- package/docs/snippets/tests/hover-text-yaml.mdx +14 -0
- package/docs/snippets/tests/match-image-replay.mdx +7 -0
- package/docs/snippets/tests/match-image-yaml.mdx +17 -0
- package/docs/snippets/tests/press-keys-replay.mdx +7 -0
- package/docs/snippets/tests/press-keys-yaml.mdx +36 -0
- package/docs/snippets/tests/remember-replay.mdx +7 -0
- package/docs/snippets/tests/remember-yaml.mdx +28 -0
- package/docs/snippets/tests/scroll-replay.mdx +7 -0
- package/docs/snippets/tests/scroll-until-image-replay.mdx +7 -0
- package/docs/snippets/tests/scroll-until-image-yaml.mdx +14 -0
- package/docs/snippets/tests/scroll-until-text-replay.mdx +7 -0
- package/docs/snippets/tests/scroll-until-text-yaml.mdx +17 -0
- package/docs/snippets/tests/scroll-yaml.mdx +30 -0
- package/docs/snippets/tests/type-repeated-replay.mdx +7 -0
- package/docs/snippets/tests/type-repeated-yaml.mdx +22 -0
- package/docs/snippets/tests/type-replay.mdx +7 -0
- package/docs/snippets/tests/type-yaml.mdx +28 -0
- package/docs/snippets/tests/wait-for-image-replay.mdx +7 -0
- package/docs/snippets/tests/wait-for-image-yaml.mdx +18 -0
- package/docs/snippets/tests/wait-for-text-replay.mdx +7 -0
- package/docs/snippets/tests/wait-for-text-yaml.mdx +18 -0
- package/docs/snippets/tests/wait-replay.mdx +7 -0
- package/docs/snippets/tests/wait-yaml.mdx +13 -0
- package/docs/styles.css +65 -0
- package/docs/v6/account/dashboard.mdx +16 -0
- package/docs/v6/account/enterprise.mdx +110 -0
- package/docs/v6/account/pricing.mdx +33 -0
- package/docs/v6/account/projects.mdx +33 -0
- package/docs/v6/account/team.mdx +35 -0
- package/docs/v6/action/ami.mdx +109 -0
- package/docs/v6/action/performance.mdx +105 -0
- package/docs/v6/action/secrets.mdx +93 -0
- package/docs/v6/apps/chrome-extensions.mdx +48 -0
- package/docs/v6/apps/desktop-apps.mdx +93 -0
- package/docs/v6/apps/mobile-apps.mdx +26 -0
- package/docs/v6/apps/static-websites.mdx +54 -0
- package/docs/v6/apps/tauri-apps.mdx +361 -0
- package/docs/v6/bugs/jira.mdx +232 -0
- package/docs/v6/cli/overview.mdx +66 -0
- package/docs/v6/commands/assert.mdx +45 -0
- package/docs/v6/commands/exec.mdx +282 -0
- package/docs/v6/commands/focus-application.mdx +44 -0
- package/docs/v6/commands/hover-image.mdx +69 -0
- package/docs/v6/commands/hover-text.mdx +47 -0
- package/docs/v6/commands/if.mdx +53 -0
- package/docs/v6/commands/match-image.mdx +67 -0
- package/docs/v6/commands/press-keys.mdx +87 -0
- package/docs/v6/commands/remember.mdx +49 -0
- package/docs/v6/commands/run.mdx +44 -0
- package/docs/v6/commands/scroll-until-image.mdx +66 -0
- package/docs/v6/commands/scroll-until-text.mdx +60 -0
- package/docs/v6/commands/scroll.mdx +69 -0
- package/docs/v6/commands/type.mdx +45 -0
- package/docs/v6/commands/wait-for-image.mdx +54 -0
- package/docs/v6/commands/wait-for-text.mdx +48 -0
- package/docs/v6/commands/wait.mdx +45 -0
- package/docs/v6/exporting/junit.mdx +218 -0
- package/docs/v6/exporting/playwright.mdx +197 -0
- package/docs/v6/features/auto-healing.mdx +144 -0
- package/docs/v6/features/generation.mdx +116 -0
- package/docs/v6/features/parallel-testing.mdx +151 -0
- package/docs/v6/features/reusable-snippets.mdx +131 -0
- package/docs/v6/features/selectorless.mdx +80 -0
- package/docs/v6/features/visual-assertions.mdx +139 -0
- package/docs/v6/getting-started/ci.mdx +146 -0
- package/docs/v6/getting-started/cli.mdx +91 -0
- package/docs/v6/getting-started/editing.mdx +100 -0
- package/docs/v6/getting-started/playwright.mdx +342 -0
- package/docs/v6/getting-started/running.mdx +48 -0
- package/docs/v6/getting-started/self-hosting.mdx +408 -0
- package/docs/v6/getting-started/vscode.mdx +88 -0
- package/docs/v6/guide/assertions.mdx +189 -0
- package/docs/v6/guide/authentication.mdx +136 -0
- package/docs/v6/guide/code.mdx +65 -0
- package/docs/v6/guide/dashcam.mdx +118 -0
- package/docs/v6/guide/environment-variables.mdx +26 -0
- package/docs/v6/guide/lifecycle.mdx +242 -0
- package/docs/v6/guide/locating.mdx +141 -0
- package/docs/v6/guide/protips.mdx +43 -0
- package/docs/v6/guide/variables.mdx +143 -0
- package/docs/v6/guide/waiting.mdx +130 -0
- package/docs/v6/importing/csv.mdx +196 -0
- package/docs/v6/importing/gherkin.mdx +143 -0
- package/docs/v6/importing/jira.mdx +164 -0
- package/docs/v6/importing/testrail.mdx +162 -0
- package/docs/v6/integrations/electron.mdx +146 -0
- package/docs/v6/integrations/netlify.mdx +100 -0
- package/docs/v6/integrations/vercel.mdx +125 -0
- package/docs/v6/interactive/explore.mdx +99 -0
- package/docs/v6/interactive/run.mdx +52 -0
- package/docs/v6/interactive/save.mdx +63 -0
- package/docs/v6/overview/comparison.mdx +101 -0
- package/docs/v6/overview/faq.mdx +162 -0
- package/docs/v6/overview/performance.mdx +52 -0
- package/docs/v6/overview/quickstart.mdx +137 -0
- package/docs/v6/overview/what-is-testdriver.mdx +85 -0
- package/docs/v6/scenarios/ai-chatbot.mdx +28 -0
- package/docs/v6/scenarios/cookie-banner.mdx +32 -0
- package/docs/v6/scenarios/file-upload.mdx +33 -0
- package/docs/v6/scenarios/form-filling.mdx +32 -0
- package/docs/v6/scenarios/log-in.mdx +75 -0
- package/docs/v6/scenarios/pdf-generation.mdx +25 -0
- package/docs/v6/scenarios/spell-check.mdx +22 -0
- package/docs/v6/security/action.mdx +84 -0
- package/docs/v6/security/agent.mdx +73 -0
- package/docs/v6/security/platform.mdx +77 -0
- package/docs/v6/tutorials/advanced-test.mdx +81 -0
- package/docs/v6/tutorials/basic-test.mdx +45 -0
- package/docs/v7/_drafts/agents.mdx +852 -0
- package/docs/v7/_drafts/architecture.mdx +399 -0
- package/docs/v7/_drafts/auto-cache-key.mdx +167 -0
- package/docs/v7/_drafts/awesome-logs-quick-ref.mdx +100 -0
- package/docs/v7/_drafts/best-practices.mdx +486 -0
- package/docs/v7/_drafts/caching-ai.mdx +215 -0
- package/docs/v7/_drafts/caching-selectors.mdx +424 -0
- package/docs/v7/_drafts/caching.mdx +366 -0
- package/docs/v7/_drafts/cli-to-sdk-migration.mdx +425 -0
- package/docs/v7/_drafts/commands/assert.mdx +45 -0
- package/docs/v7/_drafts/commands/exec.mdx +282 -0
- package/docs/v7/_drafts/commands/focus-application.mdx +44 -0
- package/docs/v7/_drafts/commands/hover-image.mdx +69 -0
- package/docs/v7/_drafts/commands/hover-text.mdx +47 -0
- package/docs/v7/_drafts/commands/if.mdx +53 -0
- package/docs/v7/_drafts/commands/match-image.mdx +67 -0
- package/docs/v7/_drafts/commands/press-keys.mdx +87 -0
- package/docs/v7/_drafts/commands/remember.mdx +49 -0
- package/docs/v7/_drafts/commands/run.mdx +44 -0
- package/docs/v7/_drafts/commands/scroll-until-image.mdx +66 -0
- package/docs/v7/_drafts/commands/scroll-until-text.mdx +60 -0
- package/docs/v7/_drafts/commands/scroll.mdx +69 -0
- package/docs/v7/_drafts/commands/type.mdx +45 -0
- package/docs/v7/_drafts/commands/wait-for-image.mdx +54 -0
- package/docs/v7/_drafts/commands/wait-for-text.mdx +48 -0
- package/docs/v7/_drafts/commands/wait.mdx +45 -0
- package/docs/v7/_drafts/configuration.mdx +378 -0
- package/docs/v7/_drafts/contributing.mdx +174 -0
- package/docs/v7/_drafts/core.mdx +458 -0
- package/docs/v7/_drafts/dashcam-title-feature.mdx +89 -0
- package/docs/v7/_drafts/debugging.mdx +349 -0
- package/docs/v7/_drafts/error-handling.mdx +501 -0
- package/docs/v7/_drafts/faq.mdx +393 -0
- package/docs/v7/_drafts/hooks.mdx +360 -0
- package/docs/v7/_drafts/init-command.mdx +95 -0
- package/docs/v7/_drafts/installation.mdx +420 -0
- package/docs/v7/_drafts/migration.mdx +562 -0
- package/docs/v7/_drafts/observable.mdx +604 -0
- package/docs/v7/_drafts/playwright.mdx +342 -0
- package/docs/v7/_drafts/plugin-migration.mdx +220 -0
- package/docs/v7/_drafts/powerful.mdx +419 -0
- package/docs/v7/_drafts/presets.mdx +210 -0
- package/docs/v7/_drafts/progressive-disclosure.mdx +230 -0
- package/docs/v7/_drafts/prompt-cache.mdx +200 -0
- package/docs/v7/_drafts/provision.mdx +390 -0
- package/docs/v7/_drafts/quick-start-test-recording.mdx +214 -0
- package/docs/v7/_drafts/readme.mdx +135 -0
- package/docs/v7/_drafts/reports.mdx +414 -0
- package/docs/v7/_drafts/scalable.mdx +754 -0
- package/docs/v7/_drafts/screenshot.mdx +155 -0
- package/docs/v7/_drafts/sdk-awesome-logs.mdx +468 -0
- package/docs/v7/_drafts/sdk-browser-rendering.mdx +167 -0
- package/docs/v7/_drafts/sdk-migration.mdx +474 -0
- package/docs/v7/_drafts/sdk-v7-complete.mdx +345 -0
- package/docs/v7/_drafts/self-hosting.mdx +369 -0
- package/docs/v7/_drafts/test-recording.mdx +382 -0
- package/docs/v7/_drafts/troubleshooting.mdx +526 -0
- package/docs/v7/_drafts/vitest-plugin.mdx +477 -0
- package/docs/v7/_drafts/vitest.mdx +535 -0
- package/docs/v7/_drafts/writing-tests.mdx +25 -0
- package/{ai/skills/testdriver:ai/SKILL.md → docs/v7/ai.mdx} +4 -3
- package/{ai/skills/testdriver:assert/SKILL.md → docs/v7/assert.mdx} +4 -3
- package/{ai/skills/testdriver:aws-setup/SKILL.md → docs/v7/aws-setup.mdx} +4 -3
- package/{ai/skills/testdriver:caching/SKILL.md → docs/v7/caching.mdx} +7 -3
- package/{ai/skills/testdriver:captcha/SKILL.md → docs/v7/captcha.mdx} +4 -3
- package/{ai/skills/testdriver:ci-cd/SKILL.md → docs/v7/ci-cd.mdx} +4 -3
- package/{ai/skills/testdriver:click/SKILL.md → docs/v7/click.mdx} +4 -3
- package/{ai/skills/testdriver:client/SKILL.md → docs/v7/client.mdx} +8 -3
- package/{ai/skills/testdriver:cloud/SKILL.md → docs/v7/cloud.mdx} +4 -3
- package/{ai/skills/testdriver:customizing-devices/SKILL.md → docs/v7/customizing-devices.mdx} +3 -3
- package/{ai/skills/testdriver:dashcam/SKILL.md → docs/v7/dashcam.mdx} +4 -3
- package/docs/v7/debugging-with-screenshots.mdx +402 -0
- package/{ai/skills/testdriver:device-config/SKILL.md → docs/v7/device-config.mdx} +3 -3
- package/{ai/skills/testdriver:double-click/SKILL.md → docs/v7/double-click.mdx} +3 -3
- package/{ai/skills/testdriver:elements/SKILL.md → docs/v7/elements.mdx} +4 -3
- package/{ai/skills/testdriver:enterprise/SKILL.md → docs/v7/enterprise.mdx} +5 -3
- package/docs/v7/examples.mdx +5 -0
- package/{ai/skills/testdriver:exec/SKILL.md → docs/v7/exec.mdx} +4 -3
- package/{ai/skills/testdriver:find/SKILL.md → docs/v7/find.mdx} +4 -3
- package/{ai/skills/testdriver:focus-application/SKILL.md → docs/v7/focus-application.mdx} +4 -3
- package/{ai/skills/testdriver:generating-tests/SKILL.md → docs/v7/generating-tests.mdx} +3 -3
- package/{ai/skills/testdriver:hover/SKILL.md → docs/v7/hover.mdx} +4 -3
- package/{ai/skills/testdriver:locating-elements/SKILL.md → docs/v7/locating-elements.mdx} +3 -3
- package/{ai/skills/testdriver:making-assertions/SKILL.md → docs/v7/making-assertions.mdx} +3 -3
- package/{ai/skills/testdriver:mouse-down/SKILL.md → docs/v7/mouse-down.mdx} +3 -3
- package/{ai/skills/testdriver:mouse-up/SKILL.md → docs/v7/mouse-up.mdx} +3 -3
- package/docs/v7/ocr.mdx +236 -0
- package/{ai/skills/testdriver:performing-actions/SKILL.md → docs/v7/performing-actions.mdx} +3 -3
- package/{ai/skills/testdriver:press-keys/SKILL.md → docs/v7/press-keys.mdx} +4 -3
- package/{ai/skills/testdriver:quickstart/SKILL.md → docs/v7/quickstart.mdx} +6 -20
- package/{ai/skills/testdriver:reusable-code/SKILL.md → docs/v7/reusable-code.mdx} +3 -3
- package/{ai/skills/testdriver:right-click/SKILL.md → docs/v7/right-click.mdx} +3 -3
- package/{ai/skills/testdriver:running-tests/SKILL.md → docs/v7/running-tests.mdx} +7 -3
- package/{ai/skills/testdriver:screenshot/SKILL.md → docs/v7/screenshot.mdx} +88 -6
- package/{ai/skills/testdriver:scroll/SKILL.md → docs/v7/scroll.mdx} +40 -3
- package/{ai/skills/testdriver:secrets/SKILL.md → docs/v7/secrets.mdx} +3 -3
- package/{ai/skills/testdriver:self-hosted/SKILL.md → docs/v7/self-hosted.mdx} +4 -3
- package/{ai/skills/testdriver:type/SKILL.md → docs/v7/type.mdx} +4 -3
- package/{ai/skills/testdriver:variables/SKILL.md → docs/v7/variables.mdx} +3 -3
- package/{ai/skills/testdriver:waiting-for-elements/SKILL.md → docs/v7/waiting-for-elements.mdx} +3 -3
- package/{ai/skills/testdriver:what-is-testdriver/SKILL.md → docs/v7/what-is-testdriver.mdx} +3 -3
- package/eslint.config.js +67 -0
- package/examples/ai.test.mjs +30 -0
- package/examples/assert.test.mjs +47 -0
- package/examples/captcha-api.test.mjs +50 -0
- package/examples/chrome-extension.test.mjs +94 -0
- package/examples/drag-and-drop.test.mjs +58 -0
- package/examples/element-not-found.test.mjs +26 -0
- package/examples/exec-output.test.mjs +59 -0
- package/examples/exec-pwsh.test.mjs +57 -0
- package/examples/focus-window.test.mjs +36 -0
- package/examples/formatted-logging.test.mjs +26 -0
- package/examples/hover-image.test.mjs +52 -0
- package/examples/hover-text-with-description.test.mjs +56 -0
- package/examples/hover-text.test.mjs +27 -0
- package/examples/installer.test.mjs +49 -0
- package/examples/launch-vscode-linux.test.mjs +54 -0
- package/examples/match-image.test.mjs +54 -0
- package/examples/no-provision.test.mjs +23 -0
- package/examples/press-keys.test.mjs +50 -0
- package/examples/prompt.test.mjs +33 -0
- package/examples/scroll-keyboard.test.mjs +37 -0
- package/examples/scroll-until-image.test.mjs +39 -0
- package/examples/scroll-until-text.test.mjs +67 -0
- package/examples/scroll.test.mjs +41 -0
- package/examples/type.test.mjs +45 -0
- package/examples/windows-installer.test.mjs +53 -0
- package/jsconfig.json +26 -0
- package/lib/vitest/hooks.mjs +3 -0
- package/manual/test-init-command.js +223 -0
- package/mcp-server/README.md +312 -0
- package/mcp-server/mcp-app.html +28 -0
- package/mcp-server/mcp-config.example.json +19 -0
- package/mcp-server/package-lock.json +4018 -0
- package/mcp-server/package.json +29 -0
- package/mcp-server/src/codegen.ts +189 -0
- package/mcp-server/src/mcp-app.css +360 -0
- package/mcp-server/src/mcp-app.ts +547 -0
- package/mcp-server/src/provision-types.ts +209 -0
- package/mcp-server/src/server.ts +2313 -0
- package/mcp-server/src/session.ts +194 -0
- package/mcp-server/tsconfig.json +16 -0
- package/mcp-server/vite.config.ts +23 -0
- package/package.json +2 -17
- package/scripts/generate-skills.js +94 -0
- package/sdk.js +3 -0
- package/setup/aws/cloudformation.yaml +470 -0
- package/setup/aws/spawn-runner.sh +190 -0
- package/test/api-resilience.test.mjs +0 -0
- package/test/captcha-solver.test.mjs +152 -0
- package/test/chrome-remote-debugging.test.mjs +66 -0
- package/test/duckduckgo/experiment.test.mjs +28 -0
- package/test/duckduckgo/setup.test.mjs +29 -0
- package/test/manual/debug-locate-response.js +82 -0
- package/test/manual/reconnect-provision.test.mjs +49 -0
- package/test/manual/test-console-logs.test.mjs +42 -0
- package/test/manual/test-find-api.js +73 -0
- package/test/manual/test-init.sh +54 -0
- package/test/manual/test-prompt-cache.js +97 -0
- package/test/manual/test-provision-auth.mjs +22 -0
- package/test/manual/test-sandbox-render.js +29 -0
- package/test/manual/test-sdk-methods.js +15 -0
- package/test/manual/test-sdk-refactor.js +53 -0
- package/test/manual/test-stack-trace.mjs +57 -0
- package/test/manual/verify-element-api.js +89 -0
- package/test/manual/verify-types.js +0 -0
- package/test/manual-unawaited-promise.test.mjs +31 -0
- package/test-ide-preview.mjs +17 -0
- package/tests/airbnb-booking.test.mjs +39 -0
- package/tests/airbnb-search.test.mjs +43 -0
- package/tests/example.test.js +33 -0
- package/tests/login.js +28 -0
- package/vitest.config.mjs +24 -0
- package/vscode-extension/.vscodeignore +12 -0
- package/vscode-extension/README.md +94 -0
- package/vscode-extension/media/icon.png +0 -0
- package/vscode-extension/package-lock.json +4126 -0
- package/vscode-extension/package.json +86 -0
- package/vscode-extension/src/extension.ts +829 -0
- package/vscode-extension/testdriverai-0.1.0.vsix +0 -0
- package/vscode-extension/tsconfig.json +16 -0
- package/ai/skills/testdriver:examples/SKILL.md +0 -7
- package/ai/skills/testdriver:mcp-workflow/SKILL.md +0 -410
- package/ai/skills/testdriver:testdriver/SKILL.md +0 -523
package/.prettierignore
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
## [7.3.3](https://github.com/testdriverai/testdriverai/compare/v7.3.2...v7.3.3) (2026-02-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## [7.3.2](https://github.com/testdriverai/testdriverai/compare/v7.3.1...v7.3.2) (2026-02-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [7.3.1](https://github.com/testdriverai/testdriverai/compare/v7.2.92...v7.3.1) (2026-02-05)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [7.2.92](https://github.com/testdriverai/testdriverai/compare/v7.2.91...v7.2.92) (2026-02-04)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [7.2.91](https://github.com/testdriverai/testdriverai/compare/v7.2.90...v7.2.91) (2026-02-04)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [7.2.90](https://github.com/testdriverai/testdriverai/compare/v7.2.89...v7.2.90) (2026-02-04)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [7.2.89](https://github.com/testdriverai/testdriverai/compare/v7.2.88...v7.2.89) (2026-02-04)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [7.2.88](https://github.com/testdriverai/testdriverai/compare/v7.2.87...v7.2.88) (2026-02-04)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [7.2.87](https://github.com/testdriverai/testdriverai/compare/v7.2.86...v7.2.87) (2026-02-04)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## [7.2.86](https://github.com/testdriverai/testdriverai/compare/v7.2.85...v7.2.86) (2026-02-04)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [7.2.85](https://github.com/testdriverai/testdriverai/compare/v7.2.84...v7.2.85) (2026-02-04)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## [7.2.84](https://github.com/testdriverai/testdriverai/compare/v7.2.82...v7.2.84) (2026-02-04)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [7.2.83](https://github.com/testdriverai/testdriverai/compare/v7.2.82...v7.2.83) (2026-02-04)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## [7.2.82](https://github.com/testdriverai/testdriverai/compare/v7.2.81...v7.2.82) (2026-02-04)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [7.2.81](https://github.com/testdriverai/testdriverai/compare/v7.2.80...v7.2.81) (2026-02-04)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## [7.2.80](https://github.com/testdriverai/testdriverai/compare/v7.2.79...v7.2.80) (2026-02-04)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [7.2.79](https://github.com/testdriverai/testdriverai/compare/v7.2.78...v7.2.79) (2026-02-03)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## [7.2.78](https://github.com/testdriverai/testdriverai/compare/v7.2.77...v7.2.78) (2026-02-03)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## [7.2.77](https://github.com/testdriverai/testdriverai/compare/v7.2.76...v7.2.77) (2026-02-02)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## [7.2.76](https://github.com/testdriverai/testdriverai/compare/v7.2.75...v7.2.76) (2026-02-02)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## [7.2.75](https://github.com/testdriverai/testdriverai/compare/v7.2.74...v7.2.75) (2026-02-02)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## [7.2.74](https://github.com/testdriverai/testdriverai/compare/v7.2.73...v7.2.74) (2026-02-02)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## [7.2.73](https://github.com/testdriverai/testdriverai/compare/v7.2.72...v7.2.73) (2026-02-02)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## [7.2.72](https://github.com/testdriverai/testdriverai/compare/v7.2.71...v7.2.72) (2026-02-02)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## [7.2.71](https://github.com/testdriverai/testdriverai/compare/v7.2.70...v7.2.71) (2026-02-02)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
## [7.2.70](https://github.com/testdriverai/testdriverai/compare/v7.2.69...v7.2.70) (2026-02-02)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## [7.2.69](https://github.com/testdriverai/testdriverai/compare/v7.2.68...v7.2.69) (2026-02-02)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
## [7.2.68](https://github.com/testdriverai/testdriverai/compare/v7.2.67...v7.2.68) (2026-02-02)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## [7.2.67](https://github.com/testdriverai/testdriverai/compare/v7.2.66...v7.2.67) (2026-02-02)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## [7.2.66](https://github.com/testdriverai/testdriverai/compare/v7.2.65...v7.2.66) (2026-02-02)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## [7.2.65](https://github.com/testdriverai/testdriverai/compare/v7.2.64...v7.2.65) (2026-02-02)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
## [7.2.64](https://github.com/testdriverai/testdriverai/compare/v7.2.63...v7.2.64) (2026-02-02)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
## [7.2.63](https://github.com/testdriverai/testdriverai/compare/v7.2.62...v7.2.63) (2026-01-30)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## [7.2.62](https://github.com/testdriverai/testdriverai/compare/v7.2.61...v7.2.62) (2026-01-30)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
## [7.2.61](https://github.com/testdriverai/testdriverai/compare/v7.2.60...v7.2.61) (2026-01-30)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
## [7.2.60](https://github.com/testdriverai/testdriverai/compare/v7.2.59...v7.2.60) (2026-01-27)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## [7.2.59](https://github.com/testdriverai/testdriverai/compare/v7.2.58...v7.2.59) (2026-01-27)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
## [7.2.58](https://github.com/testdriverai/testdriverai/compare/v6.1.8...v7.2.58) (2026-01-27)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### Reverts
|
|
153
|
+
|
|
154
|
+
* Revert "list dashcam version g" ([5037571](https://github.com/testdriverai/testdriverai/commit/5037571440c33f8966104874c542c6c57a809510))
|
|
155
|
+
* Revert "update discord invite" ([b5a9b99](https://github.com/testdriverai/testdriverai/commit/b5a9b9955cf2b0b07fd0ebeb6abf65f89cd3d5a8))
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
package/SKILLs.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# TestDriver Skills for Claude Code
|
|
2
|
+
|
|
3
|
+
This file is intended to be used as `SKILLs.md` for Claude Code and other MCP-compatible agents.
|
|
4
|
+
|
|
5
|
+
For the complete, always-up-to-date guide to working with TestDriver, **see `agents.md` in this repository**. It contains:
|
|
6
|
+
|
|
7
|
+
- How to initialize and use the `TestDriver` SDK
|
|
8
|
+
- Recommended two-file workflow (`setup.test.mjs` + `experiment.test.mjs`)
|
|
9
|
+
- Patterns for finding elements, asserting, typing, scrolling, screenshots, and more
|
|
10
|
+
|
|
11
|
+
In short:
|
|
12
|
+
|
|
13
|
+
- Use `agents.md` as your **primary reference** for how to write and iterate on tests.
|
|
14
|
+
- Use the HTTP MCP server exposed by your API (e.g. `POST /api/v1/mcp`) to **query test results, runs, and analytics** from Claude Code.
|
|
15
|
+
|
|
16
|
+
> Tip: When building tools or workflows for TestDriver inside Claude Code, prefer **explicit steps** (find/click/type/assert) guided by `agents.md`, and use the MCP tools only to **inspect test history and failures**, not to drive the sandbox itself.
|
|
17
|
+
|
package/agent/index.js
CHANGED
|
@@ -2046,12 +2046,13 @@ ${regression}
|
|
|
2046
2046
|
// Use the debugger URL instead of the VNC URL
|
|
2047
2047
|
const urlToOpen = `${this.debuggerUrl}?data=${encodedData}`;
|
|
2048
2048
|
|
|
2049
|
-
// Check preview mode from
|
|
2050
|
-
const previewMode = this.config.TD_PREVIEW || "browser";
|
|
2049
|
+
// Check preview mode from CLI options (SDK passes it directly)
|
|
2050
|
+
const previewMode = (this.cliArgs.options && this.cliArgs.options.preview) || this.config.TD_PREVIEW || "browser";
|
|
2051
|
+
console.log("[DEBUG renderSandbox] preview:", previewMode);
|
|
2051
2052
|
|
|
2052
2053
|
if (previewMode === "ide") {
|
|
2053
2054
|
// Send session to VS Code extension via HTTP
|
|
2054
|
-
this.
|
|
2055
|
+
this.writeIdeSessionFile(urlToOpen, data);
|
|
2055
2056
|
} else if (previewMode !== "none") {
|
|
2056
2057
|
// Open in browser (default behavior)
|
|
2057
2058
|
this.emitter.emit(events.showWindow, urlToOpen);
|
|
@@ -2060,6 +2061,34 @@ ${regression}
|
|
|
2060
2061
|
}
|
|
2061
2062
|
}
|
|
2062
2063
|
|
|
2064
|
+
// Write session file for IDE preview (VSCode extension watches for these)
|
|
2065
|
+
writeIdeSessionFile(debuggerUrl, data) {
|
|
2066
|
+
const fs = require("fs");
|
|
2067
|
+
const path = require("path");
|
|
2068
|
+
|
|
2069
|
+
const sessionId = `${Date.now()}-${Math.random().toString(36).substring(2, 8)}`;
|
|
2070
|
+
const previewsDir = path.join(process.cwd(), ".testdriver", ".previews");
|
|
2071
|
+
|
|
2072
|
+
// Create the previews directory if it doesn't exist
|
|
2073
|
+
if (!fs.existsSync(previewsDir)) {
|
|
2074
|
+
fs.mkdirSync(previewsDir, { recursive: true });
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
const sessionData = {
|
|
2078
|
+
sessionId,
|
|
2079
|
+
debuggerUrl,
|
|
2080
|
+
resolution: Array.isArray(data.resolution) ? data.resolution : (data.resolution ? data.resolution.split("x").map(Number) : [1920, 1080]),
|
|
2081
|
+
testFile: data.testFile || this.testFile || null,
|
|
2082
|
+
os: data.os || this.sandboxOs || "linux",
|
|
2083
|
+
timestamp: Date.now(),
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
const filePath = path.join(previewsDir, `${sessionId}.json`);
|
|
2087
|
+
fs.writeFileSync(filePath, JSON.stringify(sessionData, null, 2));
|
|
2088
|
+
|
|
2089
|
+
logger.log(`IDE preview session written to ${filePath}`);
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2063
2092
|
// Find the VS Code instance that contains the test file
|
|
2064
2093
|
findTargetIdeInstance(testFilePath) {
|
|
2065
2094
|
const fs = require("fs");
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# GitHub Comment Integration
|
|
2
|
+
|
|
3
|
+
TestDriver can automatically post beautiful, formatted comments to your GitHub pull requests and commits with test results, including dashcam replays, exceptions, and detailed statistics.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 📊 **Test Results Summary** - Pass/fail statistics and duration
|
|
8
|
+
- 🎥 **Dashcam GIF Replays** - Embedded GIF previews with links to full replays
|
|
9
|
+
- ❌ **Exception Details** - Error messages and stack traces for failed tests
|
|
10
|
+
- 📋 **Detailed Test Table** - Status, file, duration, and replay link for each test
|
|
11
|
+
- 🔄 **Auto-update** - Updates existing comment instead of creating duplicates
|
|
12
|
+
- 🎨 **Beautiful Formatting** - Professional markdown with emojis and badges
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
### 1. Enable in CI Environment
|
|
17
|
+
|
|
18
|
+
Set the required environment variables in your CI workflow:
|
|
19
|
+
|
|
20
|
+
#### GitHub Actions
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
name: TestDriver Tests
|
|
24
|
+
|
|
25
|
+
on:
|
|
26
|
+
pull_request:
|
|
27
|
+
push:
|
|
28
|
+
branches: [main]
|
|
29
|
+
|
|
30
|
+
jobs:
|
|
31
|
+
test:
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v3
|
|
35
|
+
|
|
36
|
+
- name: Setup Node.js
|
|
37
|
+
uses: actions/setup-node@v3
|
|
38
|
+
with:
|
|
39
|
+
node-version: '20'
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: npm install
|
|
43
|
+
|
|
44
|
+
- name: Run TestDriver tests
|
|
45
|
+
env:
|
|
46
|
+
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
47
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
48
|
+
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
49
|
+
run: npm run test:sdk
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Important:** For pull request events, `GITHUB_PR_NUMBER` must be explicitly set from `github.event.pull_request.number`.
|
|
53
|
+
|
|
54
|
+
### 2. Environment Variables
|
|
55
|
+
|
|
56
|
+
| Variable | Description | Required | Example |
|
|
57
|
+
|----------|-------------|----------|---------|
|
|
58
|
+
| `TD_API_KEY` | TestDriver API key | ✅ Yes | Get from [console.testdriver.ai](https://console.testdriver.ai/team) |
|
|
59
|
+
| `GITHUB_TOKEN` | GitHub token with PR write permissions | ✅ Yes | Automatically available in GitHub Actions |
|
|
60
|
+
| `GITHUB_PR_NUMBER` | Pull request number | For PR comments | `123` |
|
|
61
|
+
| `GITHUB_SHA` | Commit SHA | For commit comments | Automatically set in GitHub Actions |
|
|
62
|
+
|
|
63
|
+
**Token Alternatives:**
|
|
64
|
+
- `GITHUB_TOKEN` (preferred)
|
|
65
|
+
- `GH_TOKEN` (alternative)
|
|
66
|
+
|
|
67
|
+
### 3. Comment Destinations
|
|
68
|
+
|
|
69
|
+
TestDriver will post comments based on available context:
|
|
70
|
+
|
|
71
|
+
- **Pull Request Comment** - If `GITHUB_PR_NUMBER` is set (recommended)
|
|
72
|
+
- **Commit Comment** - If only `GITHUB_SHA` is available (fallback)
|
|
73
|
+
|
|
74
|
+
## Example Comment
|
|
75
|
+
|
|
76
|
+
Here's what a TestDriver GitHub comment looks like:
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
# 🟢 TestDriver Test Results
|
|
81
|
+
|
|
82
|
+
**Status:** ✅ PASSED
|
|
83
|
+
**Duration:** 2m 34s
|
|
84
|
+
**Platform:** linux
|
|
85
|
+
**Branch:** `feature/new-test`
|
|
86
|
+
**Commit:** `a1b2c3d`
|
|
87
|
+
|
|
88
|
+
## 📊 Test Summary
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Total: 5
|
|
92
|
+
Passed: 4 ✅
|
|
93
|
+
Failed: 1 ❌
|
|
94
|
+
Skipped: 0 ⏭️
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### [📋 View Full Test Run](https://console.testdriver.ai/runs/123)
|
|
98
|
+
|
|
99
|
+
## 📝 Test Results
|
|
100
|
+
|
|
101
|
+
| Status | Test | File | Duration | Replay |
|
|
102
|
+
|--------|------|------|----------|--------|
|
|
103
|
+
| ✅ | should login successfully | `tests/auth.test.mjs` | 12.5s | [🎥 View](https://console.testdriver.ai/replay/abc123) |
|
|
104
|
+
| ✅ | should add item to cart | `tests/cart.test.mjs` | 8.2s | [🎥 View](https://console.testdriver.ai/replay/def456) |
|
|
105
|
+
| ❌ | should complete checkout | `tests/checkout.test.mjs` | 15.3s | [🎥 View](https://console.testdriver.ai/replay/ghi789) |
|
|
106
|
+
|
|
107
|
+
## 🎥 Dashcam Replays
|
|
108
|
+
|
|
109
|
+
### should login successfully
|
|
110
|
+
|
|
111
|
+
[](https://console.testdriver.ai/replay/abc123)
|
|
112
|
+
|
|
113
|
+
[🎬 View Full Replay](https://console.testdriver.ai/replay/abc123)
|
|
114
|
+
|
|
115
|
+
## 🔴 Failures
|
|
116
|
+
|
|
117
|
+
### should complete checkout
|
|
118
|
+
|
|
119
|
+
**File:** `tests/checkout.test.mjs`
|
|
120
|
+
|
|
121
|
+
**📹 [Watch Replay](https://console.testdriver.ai/replay/ghi789)**
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
AssertionError: expected false to be truthy
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
<details>
|
|
128
|
+
<summary>Stack Trace</summary>
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
AssertionError: expected false to be truthy
|
|
132
|
+
at /workspace/tests/checkout.test.mjs:45:7
|
|
133
|
+
...
|
|
134
|
+
```
|
|
135
|
+
</details>
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
<sub>Generated by [TestDriver](https://testdriver.ai) • Run ID: `1234567890-abc123`</sub>
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Configuration
|
|
143
|
+
|
|
144
|
+
### Customizing Comment Behavior
|
|
145
|
+
|
|
146
|
+
You can control GitHub comment posting with environment variables:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Disable GitHub comments entirely
|
|
150
|
+
TESTDRIVER_SKIP_GITHUB_COMMENT=true npm run test
|
|
151
|
+
|
|
152
|
+
# Use custom GitHub token
|
|
153
|
+
GH_TOKEN=ghp_yourtoken npm run test
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### GitLab / Other CI Systems
|
|
157
|
+
|
|
158
|
+
While the integration is optimized for GitHub, you can use the comment generator programmatically:
|
|
159
|
+
|
|
160
|
+
```javascript
|
|
161
|
+
import { generateGitHubComment } from 'testdriverai/lib/github-comment.mjs';
|
|
162
|
+
|
|
163
|
+
const testRunData = {
|
|
164
|
+
runId: '1234567890-abc',
|
|
165
|
+
status: 'passed',
|
|
166
|
+
totalTests: 5,
|
|
167
|
+
passedTests: 4,
|
|
168
|
+
failedTests: 1,
|
|
169
|
+
skippedTests: 0,
|
|
170
|
+
duration: 154000,
|
|
171
|
+
testRunUrl: 'https://console.testdriver.ai/runs/123',
|
|
172
|
+
platform: 'linux',
|
|
173
|
+
branch: 'main',
|
|
174
|
+
commit: 'a1b2c3d',
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const testCases = [
|
|
178
|
+
{
|
|
179
|
+
testName: 'should work',
|
|
180
|
+
testFile: 'test.test.mjs',
|
|
181
|
+
status: 'passed',
|
|
182
|
+
duration: 5000,
|
|
183
|
+
replayUrl: 'https://console.testdriver.ai/replay/abc',
|
|
184
|
+
},
|
|
185
|
+
// ... more tests
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
const markdown = generateGitHubComment(testRunData, testCases);
|
|
189
|
+
console.log(markdown);
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Troubleshooting
|
|
193
|
+
|
|
194
|
+
### Comment not posting
|
|
195
|
+
|
|
196
|
+
1. **Check environment variables:**
|
|
197
|
+
```bash
|
|
198
|
+
echo $GITHUB_TOKEN
|
|
199
|
+
echo $GITHUB_PR_NUMBER
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
2. **Check CI logs:**
|
|
203
|
+
Look for log messages:
|
|
204
|
+
- `"GitHub token not found, skipping comment posting"`
|
|
205
|
+
- `"Repository info not available"`
|
|
206
|
+
- `"Posted GitHub comment"`
|
|
207
|
+
|
|
208
|
+
3. **Verify token permissions:**
|
|
209
|
+
- GitHub Actions: `GITHUB_TOKEN` should have `write` permissions for `pull-requests` or `contents`
|
|
210
|
+
- Personal tokens: Needs `repo` scope
|
|
211
|
+
|
|
212
|
+
### Comment not updating
|
|
213
|
+
|
|
214
|
+
If you see duplicate comments instead of updates:
|
|
215
|
+
- Ensure the bot/user posting comments is consistent across runs
|
|
216
|
+
- The update mechanism looks for existing comments with "Generated by [TestDriver]" signature
|
|
217
|
+
|
|
218
|
+
### Replays not showing
|
|
219
|
+
|
|
220
|
+
If dashcam replays aren't included:
|
|
221
|
+
- Verify dashcam is starting correctly (check for `🎥 Dashcam URL:` in logs)
|
|
222
|
+
- Ensure tests are calling `await testdriver.provision.*()` which auto-starts dashcam
|
|
223
|
+
- Check that dashcam stops successfully (look for replay URLs in output)
|
|
224
|
+
|
|
225
|
+
### GIF embeds not loading
|
|
226
|
+
|
|
227
|
+
The GIF embeds are generated dynamically by the TestDriver API:
|
|
228
|
+
- URL format: `https://console.testdriver.ai/api/replay/{replayId}/gif`
|
|
229
|
+
- If GIFs don't load, the API endpoint may be unavailable
|
|
230
|
+
- Fallback: Users can still click the "View Full Replay" link
|
|
231
|
+
|
|
232
|
+
## API Reference
|
|
233
|
+
|
|
234
|
+
### `generateGitHubComment(testRunData, testCases)`
|
|
235
|
+
|
|
236
|
+
Generates markdown for a GitHub comment.
|
|
237
|
+
|
|
238
|
+
**Parameters:**
|
|
239
|
+
- `testRunData` (Object): Test run summary data
|
|
240
|
+
- `runId` (string): Unique test run ID
|
|
241
|
+
- `status` (string): Overall status ('passed', 'failed', 'cancelled')
|
|
242
|
+
- `totalTests` (number): Total number of tests
|
|
243
|
+
- `passedTests` (number): Number of passed tests
|
|
244
|
+
- `failedTests` (number): Number of failed tests
|
|
245
|
+
- `skippedTests` (number): Number of skipped tests
|
|
246
|
+
- `duration` (number): Total duration in milliseconds
|
|
247
|
+
- `testRunUrl` (string): URL to full test run
|
|
248
|
+
- `platform` (string): Test platform ('linux', 'windows', 'mac')
|
|
249
|
+
- `branch` (string): Git branch name
|
|
250
|
+
- `commit` (string): Git commit SHA
|
|
251
|
+
- `testCases` (Array): Array of test case objects
|
|
252
|
+
- `testName` (string): Test name
|
|
253
|
+
- `testFile` (string): Test file path
|
|
254
|
+
- `status` (string): Test status
|
|
255
|
+
- `duration` (number): Test duration in ms
|
|
256
|
+
- `replayUrl` (string): Dashcam replay URL (optional)
|
|
257
|
+
- `errorMessage` (string): Error message if failed (optional)
|
|
258
|
+
- `errorStack` (string): Stack trace if failed (optional)
|
|
259
|
+
|
|
260
|
+
**Returns:** String (markdown)
|
|
261
|
+
|
|
262
|
+
### `postOrUpdateTestResults(testRunData, testCases, githubOptions)`
|
|
263
|
+
|
|
264
|
+
Posts or updates a GitHub comment with test results.
|
|
265
|
+
|
|
266
|
+
**Parameters:**
|
|
267
|
+
- `testRunData` (Object): Same as `generateGitHubComment`
|
|
268
|
+
- `testCases` (Array): Same as `generateGitHubComment`
|
|
269
|
+
- `githubOptions` (Object): GitHub API configuration
|
|
270
|
+
- `token` (string): GitHub token
|
|
271
|
+
- `owner` (string): Repository owner
|
|
272
|
+
- `repo` (string): Repository name
|
|
273
|
+
- `prNumber` (number): PR number (optional)
|
|
274
|
+
- `commitSha` (string): Commit SHA (optional)
|
|
275
|
+
|
|
276
|
+
**Returns:** `Promise<Object>` - GitHub API response
|
|
277
|
+
|
|
278
|
+
## Examples
|
|
279
|
+
|
|
280
|
+
### Manual Comment Posting
|
|
281
|
+
|
|
282
|
+
```javascript
|
|
283
|
+
import { postOrUpdateTestResults } from 'testdriverai/lib/github-comment.mjs';
|
|
284
|
+
|
|
285
|
+
await postOrUpdateTestResults(
|
|
286
|
+
{
|
|
287
|
+
runId: '123',
|
|
288
|
+
status: 'passed',
|
|
289
|
+
totalTests: 10,
|
|
290
|
+
passedTests: 10,
|
|
291
|
+
failedTests: 0,
|
|
292
|
+
skippedTests: 0,
|
|
293
|
+
duration: 60000,
|
|
294
|
+
testRunUrl: 'https://console.testdriver.ai/runs/123',
|
|
295
|
+
platform: 'linux',
|
|
296
|
+
branch: 'main',
|
|
297
|
+
commit: 'abc123',
|
|
298
|
+
},
|
|
299
|
+
testCases,
|
|
300
|
+
{
|
|
301
|
+
token: process.env.GITHUB_TOKEN,
|
|
302
|
+
owner: 'myorg',
|
|
303
|
+
repo: 'myrepo',
|
|
304
|
+
prNumber: 456,
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Custom Formatting
|
|
310
|
+
|
|
311
|
+
```javascript
|
|
312
|
+
import { generateGitHubComment } from 'testdriverai/lib/github-comment.mjs';
|
|
313
|
+
|
|
314
|
+
const markdown = generateGitHubComment(testRunData, testCases);
|
|
315
|
+
|
|
316
|
+
// Customize markdown
|
|
317
|
+
const customMarkdown = markdown.replace(
|
|
318
|
+
'# 🟢 TestDriver Test Results',
|
|
319
|
+
'# 🟢 My Custom Test Report'
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
// Post using GitHub API directly
|
|
323
|
+
// ... your posting logic
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Support
|
|
327
|
+
|
|
328
|
+
- **Documentation:** [testdriver.ai/docs](https://testdriver.ai/docs)
|
|
329
|
+
- **Issues:** [github.com/testdriverai/testdriverai/issues](https://github.com/testdriverai/testdriverai/issues)
|
|
330
|
+
- **Discord:** Join our [community Discord](https://discord.gg/testdriver)
|