| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- // Chromium集成测试脚本
- const { chromium } = require('playwright');
- async function testChromium() {
- console.log('🧪 测试Chromium集成...');
- try {
- // 启动Chromium
- console.log('🚀 启动Chromium浏览器...');
- const browser = await chromium.launch({
- headless: true,
- args: [
- '--no-sandbox',
- '--disable-setuid-sandbox',
- '--disable-dev-shm-usage'
- ]
- });
- // 创建新页面
- console.log('📄 创建新页面...');
- const page = await browser.newPage();
- // 导航到Steam主页
- console.log('🌐 导航到Steam...');
- await page.goto('https://store.steampowered.com/');
- // 检查页面标题
- const title = await page.title();
- console.log('📋 页面标题:', title);
- // 检查是否成功加载Steam页面
- if (title.includes('Steam')) {
- console.log('✅ Steam页面加载成功');
- } else {
- console.log('❌ Steam页面加载失败');
- }
- // 关闭浏览器
- await browser.close();
- console.log('🎉 Chromium集成测试通过!');
- } catch (error) {
- console.error('❌ Chromium测试失败:', error.message);
- process.exit(1);
- }
- }
- // 运行测试
- testChromium();
|