qwen-code/integration-tests/terminal-capture/scenarios/streaming-shell.ts
tanzhenxin b8a7ac830d feat(terminal-capture): add streaming capture with GIF generation
Add ability to capture multiple screenshots at intervals during
long-running terminal output (e.g., progress bars). Optionally
generates animated GIFs from captured frames using ffmpeg.

Features:
- Streaming capture at configurable intervals
- Early stop when output stabilizes (3 consecutive unchanged frames)
- Duplicate frame skipping
- Animated GIF generation via ffmpeg concat demuxer
- Auto-cleanup of output directory before each run
- Configurable delay before starting captures

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-05 17:46:09 +08:00

24 lines
822 B
TypeScript

import type { ScenarioConfig } from '../scenario-runner.js';
/**
* Demonstrates streaming shell execution output with PTY enabled by default.
* Tests the render throttle behavior and progress bar handling.
* Captures multiple screenshots during execution to show real-time output.
*/
export default {
name: 'streaming-shell',
spawn: ['node', 'dist/cli.js', '--yolo'],
terminal: { title: 'qwen-code', cwd: '../../..' },
flow: [
{
type: 'Run this command: bash integration-tests/terminal-capture/scenarios/progress.sh',
// Capture 20 screenshots at 500ms intervals during execution
// The progress.sh script takes ~10 seconds (20 iterations * 0.5s each)
streaming: {
delayMs: 7000,
intervalMs: 500,
count: 20,
},
},
],
} satisfies ScenarioConfig;