mcpbeat Sign in

Testdriver:redraw Agent Skill

Wait for the screen to stabilize after interactions

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
237
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/testdriverai/testdriverai --skill testdriver:redraw

The instruction itself

13 sections, as written by the author

<!-- Generated from redraw.mdx. DO NOT EDIT. -->

Overview

The redraw system waits for the screen to stabilize after an interaction before continuing. It detects when animations, page loads, and network requests have settled, preventing actions from being performed on a changing screen.

<Note>

Redraw is disabled by default since v7.3. Enable it explicitly if your tests interact with applications that have significant animations or loading states.

</Note>

How It Works

Redraw uses a two-phase detection approach:

  • Change Detection — Compare the current frame to the initial screenshot taken right after the action. If the pixel diff exceeds 0.1%, the screen has changed.
  • Stability Detection — Compare consecutive frames using z-score analysis. When the diff between frames drops below 0.1% or the z-score is negative (current diff is below average), the screen has settled.

The screen is considered settled when both phases complete: the screen changed from the initial state AND consecutive frames are now stable.

flowchart TD
    A[Action performed] --> B{Phase 1: Change Detection\ndiffFromInitial > 0.1%?}
    B -- "Yes (screen changed)" --> C{Phase 2: Stability\nz-score < 0 or\ndiffPercent < 0.1%?}
    C -- "Yes (frames stable)" --> D[Screen settled ✓]
    B -- "No (waiting...)" --> B
    C -- "No (waiting...)" --> C

Polling

The system polls at 500ms intervals, comparing screenshot frames. This reduces WebSocket traffic while still providing responsive detection.

Pixel Comparison

Uses pixelmatch for per-pixel comparison with a threshold of 0.1 for pixel sensitivity. A frame diff above 0.1% of total pixels indicates the screen has changed.

Z-Score Analysis

Screen stability uses statistical analysis of the last 10 measurements:

  • Calculate the mean and standard deviation of consecutive frame diffs
  • Compute the z-score: (currentDiff - mean) / stddev
  • Screen is stable when diffPercent < 0.1% or z-score < 0 (current diff is below the average)

This approach adapts to the specific animation patterns of your application rather than using a fixed threshold.

Per-Command Timeouts

Each command type has a specific redraw timeout:

| Command | Timeout | Reason |

|---------|---------|--------|

| click | 5000ms | Page navigations, modal openings |

| hover (within click) | 5000ms | Same as click |

| hover (standalone) | 2500ms | Tooltip animations |

| scroll | 5000ms | Lazy-loaded content |

| type | 5000ms | Autocomplete, validation |

| pressKeys | 5000ms | Keyboard shortcuts may trigger changes |

| focusApplication | 1000ms | Window focus animations |

If the timeout is reached before the screen settles, the command continues anyway. The timeout event is available via the redraw:complete event.

Configuration

Constructor Options

const testdriver = new TestDriver({
  // Shorthand: enable/disable
  redraw: true,    // enable with defaults
  redraw: false,   // disable (default since v7.3)

  // Full configuration
  redraw: {
    enabled: true,
    screenRedraw: true,       // enable screen pixel diff detection
    networkMonitor: false,    // enable network settling detection
  },
});

<ParamField path="redraw" type="RedrawConfig | boolean" default={false}>

Redraw configuration. Pass true/false for shorthand, or an object for fine-grained control.

<Expandable title="properties">

<ParamField path="enabled" type="boolean" default={false}>

Enable or disable the redraw system. Default changed to false in v7.3.

</ParamField>

<ParamField path="screenRedraw" type="boolean" default={true}>

Enable pixel-diff-based screen change detection. If both screenRedraw and networkMonitor are false, redraw auto-disables.

</ParamField>

<ParamField path="networkMonitor" type="boolean" default={false}>

Enable network traffic monitoring for settling detection. Monitors WebSocket traffic on the sandbox to detect when network activity subsides.

</ParamField>

</Expandable>

</ParamField>

Per-Command Override

Override redraw settings for individual commands:

// Enable redraw for a specific click
await testdriver.find('load more').click({
  redraw: { enabled: true },
});

// Disable redraw for a fast interaction
await testdriver.find('checkbox').click({
  redraw: false,
});

Network Settling

When networkMonitor is enabled, the system also monitors sandbox network traffic:

  • Polls for totalBytesReceived and totalBytesSent from the sandbox
  • Keeps the last 60 measurements
  • Calculates z-scores for both RX and TX byte rates
  • Network is settled when both RX and TX z-scores are negative (traffic is below average)
  • Has a 10-second timeout for network polling
  • Non-critical: network errors are logged but never throw

The final settling condition requires both screen AND network to be settled (when both are enabled).

Events

The redraw system emits events through the SDK emitter. See Events for the full event reference.

| Event | Description |

|---|---|

| redraw:status | Emitted on each poll with current screen diff, network stats, and timeout info |

| redraw:complete | Emitted when redraw resolves (settled or timed out) |

testdriver.emitter.on('redraw:status', (status) => {
  console.log(`Screen: ${status.redraw.text}`);
  console.log(`Network: ${status.network.text}`);
  console.log(`Timeout: ${status.timeout.text}`);
});

testdriver.emitter.on('redraw:complete', (result) => {
  if (result.isTimeout) {
    console.warn(`Redraw timed out after ${result.timeElapsed}ms`);
  } else {
    console.log(`Screen settled in ${result.timeElapsed}ms`);
  }
});

When to Use Redraw

Enable redraw when:

  • Testing single-page applications (SPAs) with route transitions
  • Interacting with pages that lazy-load content on scroll
  • Clicking buttons that trigger animations or modals
  • Testing apps with significant network-driven UI updates

Keep redraw disabled when:

  • Tests are already stable without it
  • You want faster test execution
  • Your application has minimal animations
  • You're using explicit waits or assertions instead

Types

interface RedrawConfig {
  enabled?: boolean;              // Default: false (since v7.3)
  screenRedraw?: boolean;         // Default: true
  networkMonitor?: boolean;       // Default: false
}

interface RedrawStatusEvent {
  redraw: {
    enabled: boolean;
    settled: boolean;
    hasChangedFromInitial: boolean;
    consecutiveFramesStable: number;
    diffFromInitial: number;
    diffFromLast: number;
    text: string;
  };
  network: {
    enabled: boolean;
    settled: boolean;
    rxBytes: number;
    txBytes: number;
    text: string;
  };
  timeout: {
    isTimeout: boolean;
    elapsed: number;
    max: number;
    text: string;
  };
}

interface RedrawCompleteEvent {
  screenSettled: boolean;
  hasChangedFromInitial: boolean;
  consecutiveFramesStable: number;
  networkSettled: boolean;
  isTimeout: boolean;
  timeElapsed: number;
}

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take testdriverai/testdriver:redraw from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.