본문으로 건너뛰기
cccskills
무료GitHub에 공개

testdriver:redraw

Wait for the screen to stabilize after interactions

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md7.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

Overview

The redraw system waits for the screen to become stable after an interaction. Then it continues. It finds when animations, page loads, and network requests are complete. This stops actions on a screen that changes.

<Note> **Redraw is disabled by default from v7.3.** Enable it if your tests interact with applications that have many animations or load states. </Note>

How It Works

Redraw uses a two-phase detection method:

  1. Change Detection. TestDriver compares the present frame to the first screenshot from after the action. If the pixel diff is more than 0.1%, the screen changed.
  2. Stability Detection — TestDriver compares frames that come after each other with z-score analysis. When the diff between frames is less than 0.1%, or the z-score is negative (the present diff is less than the average), the screen is complete.

The screen is complete when both phases finish: the screen changed from the first state AND the frames that come after each other 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:

  1. Calculate the mean and standard deviation of consecutive frame diffs
  2. Compute the z-score: (currentDiff - mean) / stddev
  3. 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:

CommandTimeoutReason
click5000msPage navigations, modal openings
hover (within click)5000msSame as click
hover (standalone)2500msTooltip animations
scroll5000msLazy-loaded content
type5000msAutocomplete, validation
pressKeys5000msKeyboard shortcuts may trigger changes
focusApplication1000msWindow 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.

EventDescription
redraw:statusEmitted on each poll with current screen diff, network stats, and timeout info
redraw:completeEmitted 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;
}

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

How the TestDriver agent behaves on GitHub issues, pull requests, and @mentions

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Execute natural language tasks using AI

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Make AI-powered assertions about screen state

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Deploy TestDriver on your AWS infrastructure using CloudFormation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

Speed up tests with screenshot-based caching

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

How TestDriver learns your app and caches what it discovers for instant, deterministic replays

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

testdriverai/testdriverai4732026년 9월 21일 업데이트

testdriverai의 스킬 모두 보기

이 스킬의 문제 신고