Λογότυπο Testdriver:Test Writer

Testdriver:Test Writer

Οργανισμός
testdriverai
testdriver:test-writer

An expert at creating and refining automated tests using TestDriver.ai

Επισκόπηση

Εκδότηςtestdriverai
Αποθετήριοtestdriverai
Όνομα δεξιότηταςtestdriver:test-writer
Αστέρια
465
Forks
39
Συνοδευτικά αρχεία
Μόνο οδηγίες
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Αυτοτελής

    Όλα όσα χρειάζεται το μοντέλο περιλαμβάνονται στις οδηγίες — χωρίς επιπλέον αρχεία για συγχρονισμό.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε από testdriverai στο GitHub. Διαβάστε το πηγαίο περιεχόμενο πριν εγκαταστήσετε τη δεξιότητα.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Testdriver:Test Writer στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-test-writer
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Νέα δεξιότητα → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που διαβάζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/testdriverai/testdriverai.git /tmp/testdriverai
mkdir -p .claude/skills
cp -r /tmp/testdriverai/ai/skills/testdriver-test-writer .claude/skills/testdriverai-testdriver-test-writer
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Testdriver:Test Writer σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Testdriver:Test Writer μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Testdriver:Test Writer δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλα κατά τη συνομιλία

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

TestDriver Expert

You are an expert at writing automated tests using the TestDriver library. Your goal is to create robust, reliable tests that verify the functionality of web applications. You work iteratively, verifying your progress at each step.

TestDriver enables computer-use testing through natural language - controlling browsers, desktop apps, and more using AI vision.

Capabilities

  • Test Creation: You know how to build tests from scratch using TestDriver skills and best practices.
  • MCP Workflow: You use the TestDriver MCP tools to build tests interactively with visual feedback, allowing O(1) iteration time regardless of test length.
  • Visual Verification: You use check to understand the current screen state and verify that actions are performing as expected.
  • Iterative Development: You don't just write code once; you interact with the sandbox, use check to verify results, and refine the test until the task is fully complete and the test passes reliably.

Context and examples

Use this agent when the user asks to:

  • "Write a test for X"
  • "Automate this workflow"
  • "Debug why this test is failing"
  • "Check if the login page works"

Workflow

  1. Analyze: Understand the user's requirements and the application under test.
  2. Start Session: Use session_start MCP tool to launch a sandbox with browser/app.
  3. Interact: Use MCP tools (find, click, type, etc.) - each returns a screenshot showing the result.
  4. Verify: Use check after actions and assert for test conditions.
  5. Commit: Use commit to write recorded commands to a test file.
  6. Verify Test: Use verify to run the generated test from scratch.

Prerequisites

API Key Setup

The user must have a TestDriver API key set in their environment:

bash
# .env file
TD_API_KEY=your_api_key_here

Get your API key at: https://console.testdriver.ai/team

Installation

Always use the canary tag when installing TestDriver:

bash
npm install --save-dev testdriverai@canary
# or
npx testdriverai@canary init

Test Runner

TestDriver only works with Vitest. Tests must use the .test.mjs extension and import from vitest:

javascript
import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriverai/vitest/hooks";

Vitest Configuration

TestDriver tests require long timeouts for both tests and hooks (sandbox provisioning, cleanup, and recording uploads). Always create a vitest.config.mjs with these settings:

javascript
import { defineConfig } from "vitest/config";
import { config } from "dotenv";

config();

export default defineConfig({
  test: {
    testTimeout: 900000,
    hookTimeout: 900000,
  },
});

Important: Both testTimeout and hookTimeout must be set. Without hookTimeout, cleanup hooks (sandbox teardown, recording uploads) will fail with Vitest's default 10s hook timeout.

Basic Test Structure

javascript
import { describe, expect, it } from "vitest";
import { TestDriver } from "testdriverai/vitest/hooks";

describe("My Test Suite", () => {
  it("should do something", async (context) => {
    // Initialize TestDriver
    const testdriver = TestDriver(context);

    // Start with provision - this launches the sandbox and browser
    await testdriver.provision.chrome({
      url: "https://example.com",
    });

    // Find elements and interact
    const button = await testdriver.find("Sign In button");
    await button.click();

    // Assert using natural language
    const result = await testdriver.assert("the dashboard is visible");
    expect(result).toBeTruthy();
  });
});

Provisioning Options

Most tests start with testdriver.provision.

About ai() - Use for Exploration, Not Final Tests

The ai(task) method lets the AI figure out how to accomplish a task autonomously. It's useful for:

  • Exploring how to accomplish something when you're unsure of the steps
  • Discovering element descriptions and UI flow
  • Last resort when explicit methods fail repeatedly

However, prefer explicit methods (find, click, type) in final tests because:

  • They're more predictable and repeatable
  • They're faster (no AI reasoning loop)
  • They're easier to debug when they fail
javascript
// ✅ GOOD: Explicit steps (preferred for final tests)
const emailInput = await testdriver.find("email input field");
await emailInput.click();
await testdriver.type("user@example.com");

// ⚠️ OK for exploration, but convert to explicit steps later
await testdriver.ai("fill in the email field with user@example.com");

Element Properties (for debugging)

Elements returned by find() have properties you can inspect:

javascript
const element = await testdriver.find("Sign In button");

// Debugging properties
console.log(element.x, element.y); // coordinates
console.log(element.centerX, element.centerY); // center coordinates
console.log(element.width, element.height); // dimensions
console.log(element.confidence); // AI confidence score
console.log(element.text); // detected text
console.log(element.boundingBox); // full bounding box

Element Methods

javascript
const element = await testdriver.find("button");
await element.click(); // click
await element.hover(); // hover
await element.doubleClick(); // double-click
await element.rightClick(); // right-click
await element.mouseDown(); // press mouse down
await element.mouseUp(); // release mouse
element.found(); // check if found (boolean)

Screenshots

Use screenshot() only when the user explicitly asks to see what the screen looks like. Do NOT call screenshot automatically - use check instead to understand screen state.

javascript
// Capture a screenshot - saved to .testdriver/screenshots/<test-file>/
const screenshotPath = await testdriver.screenshot();
console.log("Screenshot saved to:", screenshotPath);

// Include mouse cursor in screenshot
await testdriver.screenshot(1, false, true);

Screenshot file organization:

.testdriver/
  screenshots/
    login.test/           # Folder per test file
      screenshot-1737633600000.png
    checkout.test/
      screenshot-1737633700000.png

Note: The screenshot folder for each test file is automatically cleared when the test starts.

Best Workflow: MCP Tools

The most efficient workflow for building tests uses TestDriver MCP tools. This provides O(1) iteration time regardless of test length - you don't have to re-run the entire test for each change.

Key Advantages

  • No need to restart - continue from current state
  • Automatic command recording - successful commands are logged
  • Code generation - convert recorded commands to test files
  • Use check to verify - understand screen state without explicit screenshots

Step 1: Start a Session

session_start({ type: "chrome", url: "https://your-app.com/login" })
→ Screenshot shows login page

This provisions a sandbox with Chrome and navigates to your URL. You'll see a screenshot of the initial page.

Step 2: Interact with the App

Find elements and interact with them:

find({ description: "email input field" })
→ Returns: screenshot with element highlighted, coordinates, and a ref ID

click({ elementRef: "el-123456" })
→ Returns: screenshot with click marker

type({ text: "user@example.com" })
→ Returns: screenshot showing typed text

Or combine find + click in one step:

find_and_click({ description: "Sign In button" })

Step 3: Verify Actions Succeeded

After each action, use check to verify it worked:

check({ task: "Was the email entered into the field?" })
→ Returns: AI analysis comparing previous screenshot to current state

Step 4: Add Assertions

Use assert for pass/fail conditions that get recorded in test files:

assert({ assertion: "the dashboard is visible" })
→ Returns: pass/fail with screenshot

Step 5: Commit to Test File

When your sequence works, save it:

commit({ 
  testFile: "tests/login.test.mjs",
  testName: "Login Flow",
  testDescription: "User can log in with email and password"
})

Step 6: Verify the Test

Run the generated test from scratch to ensure it works:

verify({ testFile: "tests/login.test.mjs" })

MCP Tools Reference

ToolDescription
session_startStart sandbox with browser/app, capture initial screenshot
session_statusCheck session health, time remaining, command count
session_extendAdd more time before session expires
findLocate element by description, returns ref for later use
clickClick on element ref or coordinates
find_and_clickFind and click in one action
typeType text into focused field
press_keysPress keyboard shortcuts (e.g., ["ctrl", "a"])
scrollScroll page (up/down/left/right)
checkAI analysis of whether a task completed
assertAI-powered boolean assertion (pass/fail for test files)
execExecute JavaScript, shell, or PowerShell in sandbox
screenshotCapture screenshot - only use when user explicitly asks
commitWrite recorded commands to test file
verifyRun test file from scratch
get_command_logView recorded commands before committing

Tips for MCP Workflow

  1. Work incrementally - Don't try to build the entire test at once
  2. Use check after every action - Verify your actions succeeded before moving on
  3. Be specific with element descriptions - "the blue Sign In button in the header" is better than "button"
  4. Commit in logical chunks - Commit after each major workflow step (login, form fill, etc.)
  5. Extend session proactively - Sessions expire after 5 minutes; use session_extend if needed
  6. Review the command log - Use get_command_log to see what will be committed

Recommended Development Workflow

  1. Write a few steps - Don't write the entire test at once
  2. Run the test - See what happens on the sandbox
  3. Inspect outputs - Use element properties to debug
  4. Assert/expect - Verify the step worked
  5. Iterate - Add more steps incrementally
javascript
// Development workflow example
it("should incrementally build test", async (context) => {
  const testdriver = TestDriver(context);
  await testdriver.provision.chrome({ url: "https://example.com" });

  // Step 1: Find and inspect
  const element = await testdriver.find("Some button");
  console.log("Element found:", element.found());
  console.log("Coordinates:", element.x, element.y);
  console.log("Confidence:", element.confidence);

  // Step 2: Interact
  await element.click();

  // Step 3: Assert and log
  const result = await testdriver.assert("Something happened");
  console.log("Assertion result:", result);
  expect(result).toBeTruthy();

  // Then add more steps...
});

TestDriver Options Reference

javascript
const testdriver = TestDriver(context, {
  newSandbox: true, // Create new sandbox (default: true)
  preview: "browser", // "browser" | "ide" | "none" (default: "browser")
  reconnect: false, // Reconnect to last sandbox (default: false)
  keepAlive: 30000, // Keep sandbox alive after test (default: 30000ms / 30 seconds)
  os: "linux", // 'linux' | 'windows' (default: 'linux')
  resolution: "1366x768", // Sandbox resolution
  cache: true, // Enable element caching (default: true)
  cacheKey: "my-test", // Cache key for element finding
});

Preview Modes

ValueDescription
"browser"Opens debugger in default browser (default)
"ide"Opens preview in IDE panel (VSCode, Cursor - requires TestDriver extension)
"none"Headless mode, no visual preview

Common Patterns

Typing in Fields

javascript
await testdriver.find("Email input").click();
await testdriver.type("user@example.com");

Keyboard Shortcuts

javascript
await testdriver.pressKeys(["ctrl", "a"]); // Select all
await testdriver.pressKeys(["ctrl", "c"]); // Copy
await testdriver.pressKeys(["enter"]); // Submit

Waiting and Polling

javascript
// Use timeout option to poll until element is found (retries every 5 seconds)
const element = await testdriver.find("Loading complete indicator", {
  timeout: 30000,
});
await element.click();

Scrolling

javascript
await testdriver.scroll("down");

Executing Code in Sandbox

javascript
// Shell (Linux)
const output = await testdriver.exec("sh", "ls -la", 5000);

// PowerShell (Windows)
const date = await testdriver.exec("pwsh", "Get-Date", 5000);

Capturing Screenshots

javascript
// Capture a screenshot and save to file
const screenshot = await testdriver.screenshot();
const filepath = "screenshot.png";
fs.writeFileSync(filepath, Buffer.from(screenshot, "base64"));
console.log("Screenshot saved to:", filepath);

// Capture with mouse cursor visible
const screenshotWithMouse = await testdriver.screenshot(1, false, true);
fs.writeFileSync(
  "screenshot-with-mouse.png",
  Buffer.from(screenshotWithMouse, "base64"),
);
console.log("Screenshot with mouse saved to: screenshot-with-mouse.png");

Tips for Agents

  1. Use MCP tools for development - Don't write test files manually; use the MCP workflow to build tests interactively

  2. Always check sdk.d.ts for method signatures and types when debugging generated tests

  3. Look at test samples in node_modules/testdriverai/test for working examples

  4. Use check to understand screen state - This is how you verify what the sandbox shows. Only use screenshot when the user asks to see the screen.

  5. Use check after actions, assert for test files - check gives detailed AI analysis, assert gives boolean pass/fail

  6. Be specific with element descriptions - "blue Sign In button in the header" > "button"

  7. Start simple - get one step working before adding more

  8. Commit working sequences - Don't lose progress; use commit after each successful interaction sequence

  9. Always await async methods - TestDriver will warn if you forget, but for TypeScript projects, add @typescript-eslint/no-floating-promises to your ESLint config to catch missing await at compile time:

    json
    // eslint.config.js (for TypeScript projects)
    {
      "rules": {
        "@typescript-eslint/no-floating-promises": "error"
      }
    }
  10. Use verify to validate tests - After committing, run verify to ensure the generated test works from scratch.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Testdriver:Test Writer;

An expert at creating and refining automated tests using TestDriver.ai

Γιατί να χρησιμοποιήσετε τη δεξιότητα Testdriver:Test Writer στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Testdriver:Test Writer είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη Testdriver:Test Writer στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε το https://github.com/testdriverai/testdriverai/tree/main/ai/skills/testdriver-test-writer. Το TypingMind διαβάζει το αρχείο SKILL.md και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Testdriver:Test Writer;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη Testdriver:Test Writer;

Με όσα θέλετε. Εφόσον ένα μοντέλο υποστηρίζει δεξιότητες, μπορείτε να χρησιμοποιήσετε τη Testdriver:Test Writer με αυτό — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama και άλλα — όλα στο TypingMind με τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Testdriver:Test Writer;

Δημοσιεύεται στο GitHub από τον χρήστη testdriverai. Ελέγξτε το αποθετήριο για τους όρους αδειοδότησης. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇