testdriver-e2e-testing
Skill này làm gì
TestDriver giúp tạo các test tự động để kiểm tra website hoặc ứng dụng của bạn có hoạt động như mong đợi không. Nó mô phỏng một người dùng thật đang thao tác trên giao diện, tìm lỗi và xây dựng test để ngăn lỗi quay lại.
Khi nào nên dùng
- ✓Khi bạn cần viết một test tự động cho một website hoặc ứng dụng.
- ✓Khi một luồng người dùng khó tự động hóa bằng các phương pháp truyền thống.
- ✓Khi bạn muốn đảm bảo một trang hoặc tính năng cụ thể hoạt động đúng.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/testdriver-e2e-testing/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo một test tự động để kiểm tra form đăng nhập trên website của tôi có hoạt động đúng không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn cài TestDriver vào dự án và viết test bằng ngôn ngữ tự nhiên để mô tả giao diện cần làm gì. TestDriver chạy các test này trong một môi trường an toàn và báo cáo mọi vấn đề tìm thấy.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
TestDriver End-to-End Testing
Overview
TestDriver is an AI code reviewer that actually runs your app. It automatically runs every pull request in a real desktop sandbox, finds bugs, and builds regression tests. Tests control browsers and native applications using natural language element descriptions and AI vision, and run as Vitest suites. This skill teaches an agent how to author, run, and debug TestDriver tests.
When to Use This Skill
- Use when you need to write an end-to-end test for a web or desktop application
- Use when automating a UI workflow that has no stable selectors (canvas, Electron, native apps)
- Use when the user asks to verify that a page or flow works ("check if the login page works")
- Use when debugging a failing TestDriver test
How It Works
Step 1: Set up the project
npx testdriverai init
This scaffolds package.json, example tests, vitest.config.mjs, and a GitHub Actions workflow. The user must set TD_API_KEY in .env (get a key at https://console.testdriver.ai/team).
Step 2: Write a test
Tests are Vitest suites using the TestDriver hooks:
import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriverai/vitest/hooks";
describe("Login", () => {
it("signs in successfully", async (context) => {
const testdriver = TestDriver(context);
await testdriver.provision.chrome({ url: "https://example.com/login" });
const email = await testdriver.find("email input field");
await email.click();
await testdriver.type("user@example.com");
const submit = await testdriver.find("Sign In button");
await submit.click();
const result = await testdriver.assert("the dashboard is visible");
expect(result).toBeTruthy();
});
});
Step 3: Run and iterate
vitest run tests/login.test.mjs
Screenshots are captured automatically before and after every command and saved to .testdriver/screenshots/, named with the source line number for easy debugging.
Examples
Example 1: Testing a desktop (Electron) app
await testdriver.provision.electron({ appPath: "./dist/my-app" });
const menu = await testdriver.find("File menu in the menu bar");
await menu.click();
Example 2: Waiting for slow elements
const done = await testdriver.find("Loading complete indicator", { timeout: 30000 });
await done.click();
Best Practices
- ✅ Use specific element descriptions ("blue Sign In button in the header", not "button")
- ✅ Set both
testTimeoutandhookTimeoutto 900000 invitest.config.mjs - ✅ Add
assert()calls for verifiable pass/fail conditions - ✅ Always
awaitevery TestDriver call - ❌ Do not use
npx vitest; runvitest rundirectly - ❌ Do not rely on CSS selectors; TestDriver locates elements visually
Limitations
- Requires a TestDriver API key (
TD_API_KEY) and network access to provision sandboxes. - Only works with Vitest as the test runner.
- This skill does not replace environment-specific validation, testing, or expert review.
Security & Safety Notes
npx testdriverai initwrites project files to the current directory; run it only in a project you intend to modify.- The
TD_API_KEYcredential belongs in.env(gitignored by the scaffold). Never commit it. - Tests execute inside an isolated remote sandbox, not on the local machine.
Common Pitfalls
- Problem: Cleanup hooks fail with a 10s timeout.
Solution: Set
hookTimeout: 900000invitest.config.mjs; sandbox teardown and recording uploads take longer than Vitest's default. - Problem: Scrolling does nothing. Solution: An input field has focus. Press Escape or click the page background first, then scroll.
Related Skills
@webapp-testing- Playwright-based alternative for local web apps with stable DOM selectors
Câu hỏi thường gặp
Tôi có cần khóa API đặc biệt để dùng không?
Có, bạn cần một khóa API của TestDriver. Bạn có thể lấy khóa trên website của họ và thiết lập an toàn trong dự án.
Test được chạy ở đâu?
Test chạy trong một môi trường cô lập, an toàn trên đám mây, không chạy trên máy tính cục bộ của bạn.
Tôi có dùng được với mọi loại ứng dụng không?
Công cụ được thiết kế cho ứng dụng web và máy tính để bàn, đặc biệt hữu ích khi các phần tử giao diện không có định danh dễ tìm.
Chi tiết
Mô tả gốc của tác giả
Build E2E tests with TestDriver.ai, the AI code reviewer that runs every pull request in a real desktop sandbox, finds bugs, and builds regression tests
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5972
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.