Files
claude-code-viewer/e2e/captureSnapshot/index.ts
d-kimsuon c40b07ac83 refactor: replace e2e tests with screenshot capture system
- Delete all Playwright test files from e2e/tests/
- Create new screenshot capture system in e2e/captureSnapshot/
- Add unified execution script (index.ts) to run all captures
- Implement state-based snapshot organization:
  - snapshots/{page}/{state}/{device}.png structure
  - Multiple UI states per page (default, filters-expanded, sidebar-open, etc.)
- Support real session UUIDs and comprehensive page coverage
- Enable single-command execution: npx tsx e2e/captureSnapshot/index.ts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 14:39:11 +09:00

38 lines
1.1 KiB
TypeScript

import { execSync } from "node:child_process";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const scripts = [
"home.ts",
"projects.ts",
"project-detail.ts",
"session-detail.ts",
"error-pages.ts"
];
async function captureAllSnapshots() {
console.log("🚀 Starting screenshot capture for all pages...\n");
for (const script of scripts) {
const scriptPath = resolve(__dirname, script);
console.log(`📸 Capturing: ${script.replace('.ts', '')}...`);
try {
// Execute each script using tsx
execSync(`npx tsx "${scriptPath}"`, {
stdio: 'inherit',
cwd: resolve(__dirname, "..", "..")
});
console.log(`✅ Completed: ${script.replace('.ts', '')}\n`);
} catch (error) {
console.error(`❌ Failed: ${script.replace('.ts', '')} - ${error.message}\n`);
}
}
console.log("🎉 All screenshot captures completed!");
}
captureAllSnapshots().catch(console.error);