-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug-frontend.js
More file actions
36 lines (27 loc) · 1 KB
/
Copy pathdebug-frontend.js
File metadata and controls
36 lines (27 loc) · 1 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
import { chromium } from 'playwright';
(async () => {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
// Listen for console logs
page.on('console', msg => console.log('BROWSER CONSOLE:', msg.text()));
page.on('pageerror', error => console.log('PAGE ERROR:', error.message));
console.log('Navigating to http://localhost:5174/...');
try {
await page.goto('http://localhost:5174/', { waitUntil: 'networkidle' });
// Get page title
const title = await page.title();
console.log('Page title:', title);
// Get page content
const content = await page.content();
console.log('Page HTML length:', content.length);
// Wait a moment to see the page
await page.waitForTimeout(5000);
// Take screenshot
await page.screenshot({ path: 'debug-frontend.png' });
console.log('Screenshot saved as debug-frontend.png');
} catch (error) {
console.error('Error:', error);
} finally {
await browser.close();
}
})();