testdriverai 7.3.2 → 7.3.4
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 +162 -0
- package/SKILLs.md +17 -0
- 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/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/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/eslint.config.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const globals = require("globals");
|
|
2
|
+
const pluginJs = require("@eslint/js");
|
|
3
|
+
|
|
4
|
+
module.exports = [
|
|
5
|
+
pluginJs.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
// Base config for all JavaScript files - provides Node.js globals
|
|
8
|
+
languageOptions: {
|
|
9
|
+
sourceType: "commonjs",
|
|
10
|
+
globals: {
|
|
11
|
+
...globals.node,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
// Specific config for interface and agent files - adds browser globals
|
|
17
|
+
files: ["./interfaces/**/*.js", "./agent/**/*.js"],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
sourceType: "commonjs",
|
|
20
|
+
globals: {
|
|
21
|
+
...globals.browser,
|
|
22
|
+
...globals.node,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
// Specific config for test files - adds Jest and Mocha globals
|
|
28
|
+
files: ["test/**/*.js"],
|
|
29
|
+
languageOptions: {
|
|
30
|
+
sourceType: "commonjs",
|
|
31
|
+
globals: {
|
|
32
|
+
...globals.node,
|
|
33
|
+
...globals.jest,
|
|
34
|
+
...globals.mocha,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
// Config for ES Module files (.mjs) - used in SDK tests
|
|
40
|
+
files: ["**/*.mjs"],
|
|
41
|
+
languageOptions: {
|
|
42
|
+
sourceType: "module",
|
|
43
|
+
ecmaVersion: 2022,
|
|
44
|
+
globals: {
|
|
45
|
+
...globals.node,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
// Warn about floating promises (unawaited async calls)
|
|
50
|
+
// This catches missing `await` on async methods like click(), assert(), etc.
|
|
51
|
+
// Note: For TypeScript projects, use @typescript-eslint/no-floating-promises instead
|
|
52
|
+
"require-await": "warn",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
// this needs to be it's own object for some reason
|
|
57
|
+
// https://github.com/eslint/eslint/issues/17400
|
|
58
|
+
ignores: [
|
|
59
|
+
"agent/lib/subimage/**",
|
|
60
|
+
"node_modules/**",
|
|
61
|
+
".git",
|
|
62
|
+
"test-results/**",
|
|
63
|
+
"examples/test-recording-example.test.js",
|
|
64
|
+
"vitest.config.example.js",
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - AI Test (Vitest)
|
|
3
|
+
* Tests the AI exploratory loop (ai) functionality
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
describe("AI Test", () => {
|
|
10
|
+
it("should use ai to search for testdriver on Google", async (context) => {
|
|
11
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP });
|
|
12
|
+
|
|
13
|
+
// provision.chrome() automatically calls ready() and starts dashcam
|
|
14
|
+
await testdriver.provision.chrome({
|
|
15
|
+
url: 'https://duckduckgo.com',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Use ai to search for testdriver
|
|
19
|
+
let aiRes = await testdriver.ai("click on the empty search box, type 'testdriver', and hit enter.");
|
|
20
|
+
|
|
21
|
+
console.log("AI response:", aiRes);
|
|
22
|
+
|
|
23
|
+
// Assert the search results are displayed
|
|
24
|
+
const result = await testdriver.assert(
|
|
25
|
+
"search results for testdriver are visible",
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
expect(result).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Assert Test (Vitest)
|
|
3
|
+
* Converted from: testdriver/acceptance/assert.yaml
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
describe("Assert Test", () => {
|
|
10
|
+
it("should assert the testdriver login page shows", async (context) => {
|
|
11
|
+
const testdriver = TestDriver(context, {
|
|
12
|
+
preview: 'ide',
|
|
13
|
+
ip: context.ip || process.env.TD_IP,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// provision.chrome() automatically calls ready() and starts dashcam
|
|
17
|
+
await testdriver.provision.chrome({
|
|
18
|
+
url: 'http://testdriver-sandbox.vercel.app/login',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Take a screenshot
|
|
22
|
+
await testdriver.screenshot();
|
|
23
|
+
|
|
24
|
+
// Assert the TestDriver.ai Sandbox login page is displayed
|
|
25
|
+
const result = await testdriver.assert(
|
|
26
|
+
"the TestDriver.ai Sandbox login page is displayed",
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
expect(result).toBeTruthy();
|
|
30
|
+
});
|
|
31
|
+
// it("should assert the testdriver login page shows 2", async (context) => {
|
|
32
|
+
// const testdriver = TestDriver(context);
|
|
33
|
+
|
|
34
|
+
// // provision.chrome() automatically calls ready() and starts dashcam
|
|
35
|
+
// await testdriver.provision.chrome({
|
|
36
|
+
// url: 'http://testdriver-sandbox.vercel.app/login',
|
|
37
|
+
// });
|
|
38
|
+
|
|
39
|
+
// // Assert the TestDriver.ai Sandbox login page is displayed
|
|
40
|
+
// const result = await testdriver.assert(
|
|
41
|
+
// "the TestDriver.ai Sandbox login page is displayed",
|
|
42
|
+
// );
|
|
43
|
+
|
|
44
|
+
// expect(result).toBeTruthy();
|
|
45
|
+
// });
|
|
46
|
+
});
|
|
47
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test for testdriver.captcha() API
|
|
3
|
+
* Clean, simple API for solving captchas
|
|
4
|
+
*/
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
7
|
+
|
|
8
|
+
console.log("DEBUG: process.env.TD_OS:", process.env.TD_OS);
|
|
9
|
+
|
|
10
|
+
describe("testdriver.captcha() API", () => {
|
|
11
|
+
it("should solve reCAPTCHA v3 with auto-detect", async (context) => {
|
|
12
|
+
const testdriver = TestDriver(context);
|
|
13
|
+
|
|
14
|
+
// Launch Chrome (remote debugging is enabled automatically on Linux)
|
|
15
|
+
await testdriver.provision.chrome({
|
|
16
|
+
url: "https://2captcha.com/demo/recaptcha-v3",
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
await testdriver.screenshot();
|
|
20
|
+
|
|
21
|
+
// Solve the captcha with just the API key - everything else is auto-detected!
|
|
22
|
+
const result = await testdriver.captcha({
|
|
23
|
+
apiKey: process.env.TWOCAPTCHA_API_KEY,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
console.log("Captcha result:", result);
|
|
27
|
+
await testdriver.screenshot();
|
|
28
|
+
|
|
29
|
+
expect(result.success).toBe(true);
|
|
30
|
+
}, 180000);
|
|
31
|
+
|
|
32
|
+
it("should solve Cloudflare Turnstile", async (context) => {
|
|
33
|
+
const testdriver = TestDriver(context);
|
|
34
|
+
|
|
35
|
+
await testdriver.provision.chrome({
|
|
36
|
+
url: "https://2captcha.com/demo/cloudflare-turnstile",
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
await testdriver.screenshot();
|
|
40
|
+
|
|
41
|
+
const result = await testdriver.captcha({
|
|
42
|
+
apiKey: process.env.TWOCAPTCHA_API_KEY,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
console.log("Turnstile result:", result);
|
|
46
|
+
await testdriver.screenshot();
|
|
47
|
+
|
|
48
|
+
expect(result.success).toBe(true);
|
|
49
|
+
}, 180000);
|
|
50
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Chrome Extension Test (Vitest)
|
|
3
|
+
* Tests loading a Chrome extension using provision.chromeExtension()
|
|
4
|
+
*
|
|
5
|
+
* This test suite covers:
|
|
6
|
+
* 1. Loading extension from local path (extensionPath)
|
|
7
|
+
* 2. Loading extension from Chrome Web Store (extensionId)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
12
|
+
|
|
13
|
+
describe("Chrome Extension Test", () => {
|
|
14
|
+
it("should load hello-world Chrome extension from local path", async (context) => {
|
|
15
|
+
|
|
16
|
+
console.log('connecting to', process.env.TD_IP)
|
|
17
|
+
|
|
18
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, cacheKey: new Date().getTime().toString() });
|
|
19
|
+
|
|
20
|
+
// Determine OS-specific paths and commands
|
|
21
|
+
const shell = testdriver.os === 'windows' ? 'pwsh' : 'sh';
|
|
22
|
+
const extensionsDir = testdriver.os === 'windows'
|
|
23
|
+
? 'C:\\Users\\testdriver\\Downloads\\chrome-extensions-samples'
|
|
24
|
+
: '/tmp/chrome-extensions-samples';
|
|
25
|
+
const extensionPath = testdriver.os === 'windows'
|
|
26
|
+
? `${extensionsDir}\\functional-samples\\tutorial.hello-world`
|
|
27
|
+
: `${extensionsDir}/functional-samples/tutorial.hello-world`;
|
|
28
|
+
|
|
29
|
+
// Clone the Chrome extensions samples repo
|
|
30
|
+
const cloneCmd = testdriver.os === 'windows'
|
|
31
|
+
? `git clone --depth 1 https://github.com/GoogleChrome/chrome-extensions-samples.git "${extensionsDir}"`
|
|
32
|
+
: `git clone --depth 1 https://github.com/GoogleChrome/chrome-extensions-samples.git ${extensionsDir}`;
|
|
33
|
+
|
|
34
|
+
await testdriver.exec(shell, cloneCmd, 60000, true);
|
|
35
|
+
|
|
36
|
+
// Launch Chrome with the hello-world extension loaded
|
|
37
|
+
await testdriver.provision.chromeExtension({
|
|
38
|
+
extensionPath: extensionPath
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Navigate to testdriver.ai (extensions don't load on New Tab)
|
|
42
|
+
const addressBar = await testdriver.find("Chrome address bar");
|
|
43
|
+
await addressBar.click();
|
|
44
|
+
await testdriver.type("testdriver.ai");
|
|
45
|
+
await testdriver.pressKeys(["enter"]);
|
|
46
|
+
|
|
47
|
+
// Wait for page to load
|
|
48
|
+
const pageResult = await testdriver.assert("I can see testdriver.ai");
|
|
49
|
+
expect(pageResult).toBeTruthy();
|
|
50
|
+
|
|
51
|
+
// The hello-world extension adds a puzzle piece icon to the toolbar
|
|
52
|
+
// When clicked, it shows a popup with "Hello Extensions"
|
|
53
|
+
|
|
54
|
+
// Click on the extensions button (puzzle piece icon) in Chrome toolbar
|
|
55
|
+
const extensionsButton = await testdriver.find("The extensions button in the Chrome toolbar", {zoom: true});
|
|
56
|
+
await extensionsButton.click();
|
|
57
|
+
|
|
58
|
+
// Look for the hello world extension in the extensions menu
|
|
59
|
+
const helloExtension = await testdriver.find("Hello Extensions extension in the extensions dropdown");
|
|
60
|
+
await helloExtension.click();
|
|
61
|
+
|
|
62
|
+
// Verify the extension popup shows "Hello Extensions" text
|
|
63
|
+
const popupResult = await testdriver.assert("a popup shows with the text 'Hello Extensions'");
|
|
64
|
+
expect(popupResult).toBeTruthy();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("should load Loom from Chrome Web Store by extensionId", async (context) => {
|
|
68
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP });
|
|
69
|
+
|
|
70
|
+
// Launch Chrome with Loom loaded by its Chrome Web Store ID
|
|
71
|
+
// Loom ID: liecbddmkiiihnedobmlmillhodjkdmb
|
|
72
|
+
await testdriver.provision.chromeExtension({
|
|
73
|
+
extensionId: 'liecbddmkiiihnedobmlmillhodjkdmb'
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Navigate to testdriver.ai (extensions don't load on New Tab)
|
|
77
|
+
const addressBar = await testdriver.find("Chrome address bar");
|
|
78
|
+
await addressBar.click();
|
|
79
|
+
await testdriver.type("testdriver.ai");
|
|
80
|
+
await testdriver.pressKeys(["enter"]);
|
|
81
|
+
|
|
82
|
+
// Wait for page to load
|
|
83
|
+
const pageResult = await testdriver.assert("I can see testdriver.ai");
|
|
84
|
+
expect(pageResult).toBeTruthy();
|
|
85
|
+
|
|
86
|
+
// Click on the extensions button (puzzle piece icon) in Chrome toolbar
|
|
87
|
+
const extensionsButton = await testdriver.find("The puzzle-shaped icon in the Chrome toolbar.", {zoom: true});
|
|
88
|
+
await extensionsButton.click();
|
|
89
|
+
|
|
90
|
+
// Look for Loom in the extensions menu
|
|
91
|
+
const loomExtension = await testdriver.find("Loom extension in the extensions dropdown");
|
|
92
|
+
expect(loomExtension.found()).toBeTruthy();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Drag and Drop Test (Vitest)
|
|
3
|
+
* Converted from: testdriver/acceptance/drag-and-drop.yaml
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
const isLinux = (process.env.TD_OS || "linux") === "linux";
|
|
10
|
+
|
|
11
|
+
describe("Drag and Drop Test", () => {
|
|
12
|
+
it.skipIf(isLinux)(
|
|
13
|
+
'should drag "New Text Document" to "Recycle Bin"',
|
|
14
|
+
async (context) => {
|
|
15
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
|
|
16
|
+
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
17
|
+
|
|
18
|
+
//
|
|
19
|
+
// Show the desktop
|
|
20
|
+
await testdriver.pressKeys(["win", "d"]);
|
|
21
|
+
|
|
22
|
+
// Open the context menu
|
|
23
|
+
await testdriver.pressKeys(["shift", "f10"]);
|
|
24
|
+
|
|
25
|
+
// Hover over "New" in the context menu
|
|
26
|
+
const newOption = await testdriver.find(
|
|
27
|
+
"New, new option in the open context menu on the desktop",
|
|
28
|
+
);
|
|
29
|
+
await newOption.hover();
|
|
30
|
+
|
|
31
|
+
// Click "Text Document" in the context menu
|
|
32
|
+
const textDocOption = await testdriver.find(
|
|
33
|
+
"Text Document, text document option in the new submenu of the desktop context menu",
|
|
34
|
+
);
|
|
35
|
+
await textDocOption.click();
|
|
36
|
+
|
|
37
|
+
// Unfocus the "Text Document" text field
|
|
38
|
+
await testdriver.pressKeys(["esc"]);
|
|
39
|
+
|
|
40
|
+
// Drag the "New Text Document" icon to the "Recycle Bin"
|
|
41
|
+
const textDoc = await testdriver.find(
|
|
42
|
+
"New Text Document, new text document icon in the center of the desktop",
|
|
43
|
+
);
|
|
44
|
+
await textDoc.mouseDown();
|
|
45
|
+
|
|
46
|
+
const recycleBin = await testdriver.find(
|
|
47
|
+
"Recycle Bin, recycle bin icon in the top left corner of the desktop",
|
|
48
|
+
);
|
|
49
|
+
await recycleBin.mouseUp();
|
|
50
|
+
|
|
51
|
+
// Assert "New Text Document" icon is not on the Desktop
|
|
52
|
+
const result = await testdriver.assert(
|
|
53
|
+
'the "New Text Document" icon is not visible on the Desktop',
|
|
54
|
+
);
|
|
55
|
+
expect(result).toBeTruthy();
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Element Not Found Test
|
|
3
|
+
* Tests that finding a non-existent element returns properly without timing out
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
describe("Element Not Found Test", () => {
|
|
10
|
+
it("should handle non-existent element gracefully without timing out", async (context) => {
|
|
11
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
|
|
12
|
+
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
|
+
|
|
14
|
+
//
|
|
15
|
+
|
|
16
|
+
// Try to find an element that definitely doesn't exist
|
|
17
|
+
const element = await testdriver.find(
|
|
18
|
+
"a purple unicorn dancing on the moon",
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Should return an element that is not found
|
|
22
|
+
expect(element.found()).toBe(false);
|
|
23
|
+
expect(element.coordinates).toBeNull();
|
|
24
|
+
}); // 90 second timeout for the test (should complete much faster)
|
|
25
|
+
});
|
|
26
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Exec Output Test (Vitest)
|
|
3
|
+
* Converted from: testdriver/acceptance/exec-output.yaml
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
describe.skip("Exec Output Test", () => {
|
|
10
|
+
it(
|
|
11
|
+
"should set date using PowerShell and navigate to calendar",
|
|
12
|
+
async (context) => {
|
|
13
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
|
|
14
|
+
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
15
|
+
|
|
16
|
+
//
|
|
17
|
+
// Generate date in query string format
|
|
18
|
+
const queryString = await testdriver.exec(
|
|
19
|
+
"pwsh",
|
|
20
|
+
`
|
|
21
|
+
$date = (Get-Date).AddMonths(1)
|
|
22
|
+
Write-Output $date.ToString("yyyy-MM-dd")
|
|
23
|
+
`,
|
|
24
|
+
10000,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
// Assert that the date is valid
|
|
28
|
+
const dateValidResult = await testdriver.assert(
|
|
29
|
+
`${queryString} is a valid date`,
|
|
30
|
+
);
|
|
31
|
+
expect(dateValidResult).toBeTruthy();
|
|
32
|
+
|
|
33
|
+
// Generate date in display format
|
|
34
|
+
const expectedDate = await testdriver.exec(
|
|
35
|
+
"pwsh",
|
|
36
|
+
`
|
|
37
|
+
$date = (Get-Date).AddMonths(1)
|
|
38
|
+
Write-Output $date.ToString("ddd MMM d yyyy")
|
|
39
|
+
`,
|
|
40
|
+
10000,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Navigate to calendar with date parameter
|
|
44
|
+
await testdriver.focusApplication("Google Chrome");
|
|
45
|
+
await testdriver.pressKeys(["ctrl", "l"]);
|
|
46
|
+
await testdriver.type(
|
|
47
|
+
`https://teamup.com/ks48cf2135e7e080bc?view=d&date=${queryString}`,
|
|
48
|
+
);
|
|
49
|
+
await testdriver.pressKeys(["enter"]);
|
|
50
|
+
|
|
51
|
+
// Assert that the expected date shows
|
|
52
|
+
await testdriver.focusApplication("Google Chrome");
|
|
53
|
+
const result = await testdriver.assert(
|
|
54
|
+
`the text ${expectedDate} is visible on screen`,
|
|
55
|
+
);
|
|
56
|
+
expect(result).toBeTruthy();
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Exec Shell Test (Vitest)
|
|
3
|
+
* Converted from: testdriver/acceptance/exec-shell.yaml
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
describe.skip("Exec PowerShell Test", () => {
|
|
10
|
+
it(
|
|
11
|
+
"should generate random email using PowerShell and enter it",
|
|
12
|
+
async (context) => {
|
|
13
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
|
|
14
|
+
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
15
|
+
|
|
16
|
+
//
|
|
17
|
+
// Generate random email using PowerShell
|
|
18
|
+
const randomEmail = await testdriver.exec({
|
|
19
|
+
language: "pwsh",
|
|
20
|
+
code: `
|
|
21
|
+
# Random email generator in PowerShell
|
|
22
|
+
|
|
23
|
+
# Arrays of possible names and domains
|
|
24
|
+
$firstNames = @("john", "jane", "alex", "chris", "sara", "mike", "lisa", "david", "emma", "ryan")
|
|
25
|
+
$lastNames = @("smith", "johnson", "williams", "brown", "jones", "garcia", "miller", "davis", "martin", "lee")
|
|
26
|
+
$domains = @("example.com", "testmail.com", "mailinator.com", "demo.org", "company.net")
|
|
27
|
+
|
|
28
|
+
# Random selection
|
|
29
|
+
$first = Get-Random -InputObject $firstNames
|
|
30
|
+
$last = Get-Random -InputObject $lastNames
|
|
31
|
+
$domain = Get-Random -InputObject $domains
|
|
32
|
+
$number = Get-Random -Minimum 1 -Maximum 1000
|
|
33
|
+
|
|
34
|
+
# Generate the email
|
|
35
|
+
$email = "$first.$last$number@$domain".ToLower()
|
|
36
|
+
|
|
37
|
+
# Output
|
|
38
|
+
Write-Output "$email"
|
|
39
|
+
`,
|
|
40
|
+
timeout: 10000,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Enter the email in username field
|
|
44
|
+
const usernameField = await testdriver.find(
|
|
45
|
+
"Username, input field for username",
|
|
46
|
+
);
|
|
47
|
+
await usernameField.click();
|
|
48
|
+
await testdriver.type(randomEmail);
|
|
49
|
+
|
|
50
|
+
// Assert that the username field shows a valid email address
|
|
51
|
+
const result = await testdriver.assert(
|
|
52
|
+
`the username field contains ${randomEmail} which is a valid email address`,
|
|
53
|
+
);
|
|
54
|
+
expect(result).toBeTruthy();
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Focus Window Test (Vitest)
|
|
3
|
+
* Converted from: testdriver/acceptance/focus-window.yaml
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
describe("Focus Window Test", () => {
|
|
10
|
+
it.skip(
|
|
11
|
+
"should click Microsoft Edge icon and focus Google Chrome",
|
|
12
|
+
async (context) => {
|
|
13
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
|
|
14
|
+
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
15
|
+
|
|
16
|
+
//
|
|
17
|
+
// Show desktop
|
|
18
|
+
await testdriver.pressKeys(["winleft", "d"]);
|
|
19
|
+
|
|
20
|
+
// Click on the Microsoft Edge icon
|
|
21
|
+
const edgeIcon = await testdriver.find(
|
|
22
|
+
"a blue and green swirl icon on the taskbar representing Microsoft Edge",
|
|
23
|
+
);
|
|
24
|
+
await edgeIcon.click();
|
|
25
|
+
|
|
26
|
+
// Focus Google Chrome
|
|
27
|
+
await testdriver.focusApplication("Google Chrome");
|
|
28
|
+
|
|
29
|
+
// Assert Chrome is focused (implicit through successful focus)
|
|
30
|
+
const result = await testdriver.assert(
|
|
31
|
+
"Google Chrome is the focused application",
|
|
32
|
+
);
|
|
33
|
+
expect(result).toBeTruthy();
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Formatted Logging Demo
|
|
3
|
+
* Demonstrates nice Vitest-style formatted logs for Dashcam replay
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
describe("Formatted Logging Test", () => {
|
|
10
|
+
it("should demonstrate formatted logs in dashcam replay", async (context) => {
|
|
11
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, headless: true });
|
|
12
|
+
await testdriver.provision.chrome({ url: 'http://testdriver-sandbox.vercel.app/login' });
|
|
13
|
+
|
|
14
|
+
// Find and click - logs will be nicely formatted
|
|
15
|
+
const signInButton = await testdriver.find(
|
|
16
|
+
"Sign In, black button below the password field",
|
|
17
|
+
);
|
|
18
|
+
await signInButton.click();
|
|
19
|
+
|
|
20
|
+
// Assert - logs will show pass/fail with nice formatting
|
|
21
|
+
const result = await testdriver.assert(
|
|
22
|
+
"an error shows that fields are required",
|
|
23
|
+
);
|
|
24
|
+
expect(result).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Hover Image Test (Vitest)
|
|
3
|
+
* Converted from: testdriver/acceptance/hover-image.yaml
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Perform login flow for SauceLabs demo app
|
|
11
|
+
* @param {import('../../sdk.js').default} client - TestDriver client instance
|
|
12
|
+
* @param {string} username - Username (default: 'standard_user')
|
|
13
|
+
*/
|
|
14
|
+
async function performLogin(client, username = "standard_user") {
|
|
15
|
+
await client.focusApplication("Google Chrome");
|
|
16
|
+
const password = await client.extract("the password");
|
|
17
|
+
const usernameField = await client.find(
|
|
18
|
+
"username input",
|
|
19
|
+
);
|
|
20
|
+
await usernameField.click();
|
|
21
|
+
await client.type(username);
|
|
22
|
+
await client.pressKeys(["tab"]);
|
|
23
|
+
await client.type(password, { secret: true });
|
|
24
|
+
await client.pressKeys(["tab"]);
|
|
25
|
+
await client.pressKeys(["enter"]);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe("Hover Image Test", () => {
|
|
29
|
+
it("should click on shopping cart icon and verify empty cart", async (context) => {
|
|
30
|
+
const testdriver = TestDriver(context, { ip: context.ip || process.env.TD_IP, redraw: false });
|
|
31
|
+
|
|
32
|
+
// provision.chrome() automatically calls ready() and starts dashcam
|
|
33
|
+
await testdriver.provision.chrome({
|
|
34
|
+
url: 'http://testdriver-sandbox.vercel.app/login'
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Perform login first
|
|
38
|
+
await performLogin(testdriver);
|
|
39
|
+
|
|
40
|
+
// Click on the shopping cart icon
|
|
41
|
+
await testdriver.focusApplication("Google Chrome");
|
|
42
|
+
const cartIcon = await testdriver.find(
|
|
43
|
+
"shopping cart icon next to the Cart text in the top right corner",
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
await cartIcon.click();
|
|
47
|
+
|
|
48
|
+
// Assert that you see an empty shopping cart
|
|
49
|
+
const result = await testdriver.assert("Your cart is empty");
|
|
50
|
+
expect(result).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TestDriver SDK - Hover Text With Description Test (Vitest)
|
|
3
|
+
* Converted from: testdriver/acceptance/hover-text-with-description.yaml
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { TestDriver } from "../lib/vitest/hooks.mjs";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Perform login flow for SauceLabs demo app
|
|
11
|
+
* @param {TestDriver} client - TestDriver client
|
|
12
|
+
* @param {string} username - Username (default: 'standard_user')
|
|
13
|
+
*/
|
|
14
|
+
async function performLogin(client, username = "standard_user") {
|
|
15
|
+
await client.focusApplication("Google Chrome");
|
|
16
|
+
const password = await client.extract("the password");
|
|
17
|
+
const usernameField = await client.find("username input");
|
|
18
|
+
await usernameField.click();
|
|
19
|
+
await client.type(username);
|
|
20
|
+
await client.pressKeys(["tab"]);
|
|
21
|
+
await client.type(password, { secret: true });
|
|
22
|
+
await client.pressKeys(["tab"]);
|
|
23
|
+
await client.pressKeys(["enter"]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe("Hover Text With Description Test", () => {
|
|
27
|
+
it("should add TestDriver Hat to cart and verify", async (context) => {
|
|
28
|
+
const testdriver = TestDriver(context, {
|
|
29
|
+
ip: context.ip || process.env.TD_IP,
|
|
30
|
+
headless: true,
|
|
31
|
+
});
|
|
32
|
+
await testdriver.provision.chrome({
|
|
33
|
+
url: "http://testdriver-sandbox.vercel.app/login",
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
//
|
|
37
|
+
// Perform login first
|
|
38
|
+
await performLogin(testdriver);
|
|
39
|
+
|
|
40
|
+
// Click on "Add to Cart" under TestDriver Hat
|
|
41
|
+
const addToCartButton = await testdriver.find(
|
|
42
|
+
"Add to Cart, add to cart button under TestDriver Hat",
|
|
43
|
+
);
|
|
44
|
+
await addToCartButton.click();
|
|
45
|
+
|
|
46
|
+
// Click on the cart
|
|
47
|
+
const cartButton = await testdriver.find(
|
|
48
|
+
"Cart, cart button in the top right corner",
|
|
49
|
+
);
|
|
50
|
+
await cartButton.click();
|
|
51
|
+
|
|
52
|
+
// Assert the TestDriver Hat is in the cart
|
|
53
|
+
const result = await testdriver.assert("There is an item in the cart");
|
|
54
|
+
expect(result).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
});
|