feat: 更换应用框架为ElectronFofge

This commit is contained in:
duanshuwen
2025-10-12 14:12:29 +08:00
parent 02b85f3251
commit ebac04b786
67 changed files with 7935 additions and 6104 deletions

View File

@@ -1,34 +0,0 @@
import { test, expect } from '@playwright/test'
test('模拟百度搜索Playwright备用方案', async ({ page }) => {
// 设置较长的超时时间
test.setTimeout(60000)
try {
// 尝试打开百度首页
await page.goto('https://www.baidu.com', { waitUntil: 'networkidle' })
// 验证页面标题包含"百度"
await expect(page).toHaveTitle(/百度/)
// 等待搜索框可见并输入"Playwright"
const searchInput = page.locator('#kw')
await searchInput.waitFor({ state: 'visible', timeout: 10000 })
await searchInput.click()
await searchInput.fill('Playwright')
// 点击搜索按钮
const searchButton = page.locator('#su')
await searchButton.click()
// 等待搜索结果页面加载
await page.waitForLoadState('networkidle')
// 验证搜索结果页面包含Playwright相关内容
await expect(page.locator('.result')).toHaveCount(1)
console.log('百度搜索Playwright成功')
} catch (error) {
console.log('百度搜索失败直接访问Playwright官网:', error.message)
}
})