MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / run

Function run

tests/screenshot_hero.mjs:3–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { chromium } from 'playwright';
2
3async 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
35run().catch(e => { console.error(e); process.exit(1); });

Callers 1

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected