mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-19 13:34:21 +01:00
- 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>
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { resolve } from "node:path";
|
|
import { withPlaywright } from "../utils/withPlaywright";
|
|
import { testDevices } from "../testDevices";
|
|
|
|
// Different error scenarios to capture
|
|
const errorScenarios = [
|
|
{
|
|
name: "404",
|
|
url: "http://localhost:3400/non-existent-page"
|
|
},
|
|
{
|
|
name: "invalid-project",
|
|
url: "http://localhost:3400/projects/non-existent-project"
|
|
},
|
|
{
|
|
name: "invalid-session",
|
|
url: "http://localhost:3400/projects/sample-project/sessions/non-existent-session"
|
|
}
|
|
];
|
|
|
|
for (const scenario of errorScenarios) {
|
|
for (const { device, name } of testDevices) {
|
|
await withPlaywright(
|
|
async ({ context, cleanUp }) => {
|
|
const page = await context.newPage();
|
|
await page.goto(scenario.url);
|
|
await page.screenshot({
|
|
path: resolve("e2e", "snapshots", "errors", `${scenario.name}_${name}.png`),
|
|
fullPage: true,
|
|
});
|
|
await cleanUp();
|
|
},
|
|
{
|
|
contextOptions: {
|
|
...device,
|
|
},
|
|
},
|
|
);
|
|
}
|
|
} |