dev_1.0.0_xuxt_3 完成web和alert的集成测试 #38
@ -11,9 +11,13 @@ export async function testEntryCards(
|
||||
const card = page.locator(`.mantine-Card-root:has-text("${entry.label}")`);
|
||||
await expect(card).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// 检查卡片内部的链接
|
||||
// 检查卡片内部的链接,忽略端口号
|
||||
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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user