Langsung ke konten
Skillpedia
Testing48k Β· #5972

testdriver-e2e-testing

Fungsinya

TestDriver membantu membuat tes otomatis untuk memeriksa apakah website atau aplikasi Anda berjalan sesuai harapan. Alat ini meniru pengguna sungguhan yang berinteraksi dengan antarmuka, menemukan bug, dan membuat tes agar bug tersebut tidak muncul kembali.

Kapan dipakai

  • βœ“Saat Anda perlu menulis tes otomatis untuk website atau aplikasi.
  • βœ“Saat alur pengguna sulit diotomatisasi dengan metode tradisional.
  • βœ“Saat Anda ingin memastikan halaman atau fitur tertentu berfungsi dengan benar.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/testdriver-e2e-testing/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/testdriver-e2e-testing/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuatkan tes otomatis untuk memeriksa apakah form login di website saya berfungsi.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda memasang TestDriver di proyek Anda, lalu menulis tes menggunakan bahasa natural untuk menjelaskan apa yang seharusnya dilakukan antarmuka. TestDriver menjalankan tes ini di lingkungan yang aman dan melaporkan masalah yang ditemukan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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 testTimeout and hookTimeout to 900000 in vitest.config.mjs
  • βœ… Add assert() calls for verifiable pass/fail conditions
  • βœ… Always await every TestDriver call
  • ❌ Do not use npx vitest; run vitest run directly
  • ❌ 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 init writes project files to the current directory; run it only in a project you intend to modify.
  • The TD_API_KEY credential 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: 900000 in vitest.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
Pertanyaan umum

Apakah saya memerlukan kunci khusus untuk menggunakannya?

Ya, Anda memerlukan API key TestDriver, yang bisa Anda dapatkan dari website mereka dan simpan dengan aman di proyek Anda.

Di mana tes dijalankan?

Tes dijalankan di lingkungan cloud yang aman dan terisolasi, bukan di komputer lokal Anda, sehingga lebih aman.

Apakah bisa digunakan untuk semua jenis aplikasi?

Alat ini dirancang untuk aplikasi web dan desktop, dan sangat berguna ketika elemen antarmuka tidak memiliki identifier yang mudah ditemukan.

Detail

Deskripsi asli dari pembuat

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

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5972
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa