()
| 1 | import { chromium } from 'playwright'; |
| 2 | |
| 3 | async function run() { |
| 4 | const browser = await chromium.launch({ headless: true }); |
| 5 | const page = await (await browser.newContext({ viewport: { width: 1440, height: 900 } })).newPage(); |
| 6 | |
| 7 | await page.goto('http://localhost:8403/dashboard/', { waitUntil: 'networkidle', timeout: 30000 }); |
| 8 | await page.waitForTimeout(2000); |
| 9 | |
| 10 | // Go to Playground and type a complex prompt |
| 11 | await page.click('button:has-text("PLAYGROUND")'); |
| 12 | await page.waitForTimeout(500); |
| 13 | await page.locator('textarea').fill('Design a distributed rate limiter with Redis and sliding window counters'); |
| 14 | await page.waitForTimeout(12000); // wait for embedding model + prediction |
| 15 | |
| 16 | // Screenshot just the main content area (no browser chrome) |
| 17 | await page.screenshot({ |
| 18 | path: '/Users/anjieyang/Work/GradientNetwork/smart_router/UncommonRoute/docs/assets/hero-playground.png', |
| 19 | clip: { x: 0, y: 0, width: 1440, height: 900 } |
| 20 | }); |
| 21 | console.log('✓ Playground hero'); |
| 22 | |
| 23 | // Also screenshot Home page |
| 24 | await page.click('button:has-text("HOME")'); |
| 25 | await page.waitForTimeout(1500); |
| 26 | await page.screenshot({ |
| 27 | path: '/Users/anjieyang/Work/GradientNetwork/smart_router/UncommonRoute/docs/assets/hero-home.png', |
| 28 | clip: { x: 0, y: 0, width: 1440, height: 900 } |
| 29 | }); |
| 30 | console.log('✓ Home hero'); |
| 31 | |
| 32 | await browser.close(); |
| 33 | } |
| 34 | |
| 35 | run().catch(e => { console.error(e); process.exit(1); }); |
no test coverage detected