dev_1.0.0_xuxt_3 完成web和alert的集成测试 #38

Merged
xuxt merged 12 commits from dev_1.0.0_xuxt_3 into dev_1.0.0 2025-10-31 14:18:20 +08:00
Showing only changes of commit f51dbb400a - Show all commits

View File

@ -11,9 +11,13 @@ export async function testEntryCards(
const card = page.locator(`.mantine-Card-root:has-text("${entry.label}")`); const card = page.locator(`.mantine-Card-root:has-text("${entry.label}")`);
await expect(card).toBeVisible({ timeout: 10000 }); await expect(card).toBeVisible({ timeout: 10000 });
// 检查卡片内部的链接 // 检查卡片内部的链接,忽略端口号
const link = card.locator('a'); const link = card.locator('a');
await expect(link).toHaveAttribute('href', entry.href); const href = await link.getAttribute('href');
// 正则:保留协议和 host忽略端口号
const expectedHrefPattern = entry.href.replace(/:(\d+)/, '(:\\d+)?');
expect(href).toMatch(new RegExp(`^${expectedHrefPattern}$`));
// 检查图标 // 检查图标
const img = card.locator('img'); const img = card.locator('img');