Files
claude-code-viewer/e2e/captureSnapshot/error-pages.ts
d-kimsuon 584c0409d3 fix: correct screenshot capture URLs to use port 4000
- Update all capture scripts to use http://localhost:4000 instead of 3400
- Port 4000 is used by the E2E server with mock data environment
- Add .env.local with GLOBAL_CLAUDE_DIR configuration
- All 48 screenshots now capture actual page content (verified >1KB file sizes)
- Fix Internal Server Error issues in screenshot captures

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

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

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:4000/non-existent-page"
},
{
name: "invalid-project",
url: "http://localhost:4000/projects/non-existent-project"
},
{
name: "invalid-session",
url: "http://localhost:4000/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,
},
},
);
}
}