testdriver:redraw
БесплатноБез исполняемых скриптовНе проверенWait for the screen to stabilize after interactions
от testdriverai★ 342 звезды на GitHubОб этом скилле
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.
How It Works
Redraw uses a two-phase detection method:
- 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.
- 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:
- Calculate the mean and standard deviation of consecutive frame diffs
- Compute the z-score:
(currentDiff - mean) / stddev - Screen is stable when
diffPercent < 0.1%orz-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="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>
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
totalBytesReceivedandtotalBytesSentfrom 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 **b
Установить testdriver:redraw в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл testdriver:redraw?
Wait for the screen to stabilize after interactions
Как установить скилл testdriver:redraw?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testdriver:redraw запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic