-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-playwright.js
More file actions
29 lines (24 loc) · 880 Bytes
/
test-playwright.js
File metadata and controls
29 lines (24 loc) · 880 Bytes
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
const { chromium, firefox, webkit } = require('@playwright/test');
async function testBrowsers() {
console.log('Testing Playwright browser availability...\n');
const browsers = [
{ name: 'Chromium', launcher: chromium },
{ name: 'Firefox', launcher: firefox },
{ name: 'WebKit', launcher: webkit }
];
for (const { name, launcher } of browsers) {
try {
console.log(`Testing ${name}...`);
const executablePath = launcher.executablePath();
console.log(`✓ ${name} executable path: ${executablePath}`);
// Try to launch
const browser = await launcher.launch({ headless: true });
console.log(`✓ ${name} launched successfully`);
await browser.close();
} catch (error) {
console.log(`✗ ${name} failed: ${error.message}`);
}
console.log('');
}
}
testBrowsers().catch(console.error);