How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
日本語の概要は準備中です。原文の説明を表示しています。
Solve captchas using 2captcha service
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
TestDriver can solve captchas automatically during your tests. It uses the 2captcha service. This feature works on Linux sandboxes and Windows sandboxes.
const result = await testdriver.captcha({
apiKey: process.env.TWOCAPTCHA_API_KEY,
});
console.log(result.success); // true
console.log(result.token); // The solved captcha token
That is all. TestDriver does these automatically:
| Type | Auto-Detected | Notes |
|---|---|---|
| reCAPTCHA v2 | ✅ | Including invisible |
| reCAPTCHA v3 | ✅ | Action is auto-detected |
| hCaptcha | ✅ | |
| Cloudflare Turnstile | ✅ |
const result = await testdriver.captcha({
// Required
apiKey: '2CAPTCHA_API_KEY',
// Optional - usually auto-detected
sitekey: '6Le...', // Override auto-detected sitekey
type: 'recaptcha_v3', // Override auto-detected type
action: 'submit', // reCAPTCHA v3 action
// Timing
timeout: 120000, // Max wait time (default: 120s)
pollInterval: 5000, // Poll interval (default: 5s)
});
import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriver";
describe("Checkout flow", () => {
it("should complete checkout with captcha", async (context) => {
const testdriver = TestDriver(context);
// Navigate to checkout page
await testdriver.provision.chrome({
url: 'https://example.com/checkout',
});
// Fill out form
await testdriver.type({ text: 'John Doe', selector: '#name' });
await testdriver.type({ text: 'john@example.com', selector: '#email' });
// Solve the captcha
const result = await testdriver.captcha({
apiKey: process.env.TWOCAPTCHA_API_KEY,
});
expect(result.success).toBe(true);
// Submit the form
await testdriver.click({ selector: '#submit' });
// Verify success
await testdriver.find({ text: 'Order confirmed' });
}, 180000);
});
You can set your API key as an environment variable:
export TWOCAPTCHA_API_KEY=your_api_key_here
Then use it in your tests:
const result = await testdriver.captcha({
apiKey: process.env.TWOCAPTCHA_API_KEY,
});
Add the key to your repository secrets and expose it in your workflow:
- name: Run Tests
run: vitest run
env:
TWOCAPTCHA_API_KEY: ${{ secrets.TWOCAPTCHA_API_KEY }}
data-sitekey, script tags, etc.)The captcha element wasn't found on the page. Try:
captcha()sitekey and type manuallyCaptcha solving typically takes 10-30 seconds. If you're getting timeouts:
timeout optionSome sites validate tokens immediately. Make sure:
action parameter matches the site's expected actionまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions
日本語の概要は準備中です。原文の説明を表示しています。
Execute natural language tasks using AI
日本語の概要は準備中です。原文の説明を表示しています。
Make AI-powered assertions about screen state
日本語の概要は準備中です。原文の説明を表示しています。
Deploy TestDriver on your AWS infrastructure using CloudFormation
日本語の概要は準備中です。原文の説明を表示しています。
Speed up tests with screenshot-based caching
日本語の概要は準備中です。原文の説明を表示しています。
How TestDriver learns your app and caches what it discovers for instant, deterministic replays
日本語の概要は準備中です。原文の説明を表示しています。