-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcapture-extra.mjs
More file actions
46 lines (36 loc) · 1.63 KB
/
Copy pathcapture-extra.mjs
File metadata and controls
46 lines (36 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { chromium } from 'playwright';
const BASE_URL = 'http://localhost:5174/';
const OUTPUT_DIR = '.codex/screenshots_review_1';
async function capture() {
const browser = await chromium.launch({ headless: false });
const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });
const page = await ctx.newPage();
await page.goto(BASE_URL, { waitUntil: 'networkidle' });
await page.waitForTimeout(2000);
// Navigate to Chapter 5 for the delivery view
await page.click('button:has-text("DELIVER")');
await page.waitForTimeout(1500);
await page.screenshot({ path: `${OUTPUT_DIR}/130-ch5-delivery-rankings.png` });
// Test keyboard focus - press Tab multiple times
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.screenshot({ path: `${OUTPUT_DIR}/131-keyboard-focus-visible.png` });
// Capture hover on navigation button
const startOverBtn = page.locator('button:has-text("START OVER")');
await startOverBtn.hover();
await page.screenshot({ path: `${OUTPUT_DIR}/132-hover-state-button.png` });
// Back to Chapter 0 and scroll to see all personas
await page.click('button:has-text("LOADOUT")');
await page.waitForTimeout(1000);
// Try to scroll within arena if possible
const arena = page.locator('[class*="arena"]').first();
if (await arena.count() > 0) {
await arena.evaluate(el => el.scrollTop = 500);
}
await page.waitForTimeout(500);
await page.screenshot({ path: `${OUTPUT_DIR}/133-ch0-personas-scrolled.png` });
await browser.close();
console.log('Extra screenshots saved');
}
capture().catch(console.error);