Files
awoooi/apps/web/tests/e2e/cpo102-visual.spec.ts
OG T 196d269b92 feat: add all application source code
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 18:57:44 +08:00

48 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* CPO-102 Visual Verification
* ============================
* 截圖驗收Glass Sidebar + Header + HITL Approval Cards
*/
import { test, expect } from '@playwright/test'
test.describe('CPO-102 Layout Visual Verification', () => {
test('Screenshot: Full Command Center Layout', async ({ page }) => {
// Navigate to demo page (zh-TW)
await page.goto('/zh-TW/demo')
// Wait for DOM ready (skip networkidle due to SSE)
await page.waitForLoadState('domcontentloaded')
await page.waitForTimeout(3000) // Allow SSE data + animations
// Take full page screenshot
await page.screenshot({
path: 'test-results/cpo102-fullpage-zh-TW.png',
fullPage: true,
})
// Scroll to HITL section and capture
await page.evaluate(() => window.scrollTo(0, 800))
await page.waitForTimeout(500)
await page.screenshot({
path: 'test-results/cpo102-hitl-section-zh-TW.png',
fullPage: false,
})
// Scroll to Status Orb section
await page.evaluate(() => window.scrollTo(0, 2000))
await page.waitForTimeout(500)
await page.screenshot({
path: 'test-results/cpo102-status-section-zh-TW.png',
fullPage: false,
})
// Verify key Chinese text
const pageContent = await page.content()
expect(pageContent).toContain('即時戰情室')
expect(pageContent).toContain('授權卡片')
console.log('✅ Screenshots saved to test-results/')
})
})