test(e2e): improve fav robustness

pull/8842/head
Junyi Du 2023-03-16 22:17:53 +08:00
parent 02103b596a
commit 54bd86aca7
1 changed files with 2 additions and 0 deletions

View File

@ -17,7 +17,9 @@ test('favorite item and recent item test', async ({ page }) => {
// click from another page
const another_page_name = await createRandomPage(page)
expect(await page.innerText(':nth-match(.favorite-item a, 1)')).toBe(fav_page_name)
await page.waitForTimeout(500);
await page.click(":nth-match(.favorite-item, 1)")
await page.waitForTimeout(500);
expect(await page.innerText('.page-title .title')).toBe(fav_page_name)
expect(await page.innerText(':nth-match(.recent-item a, 1)')).toBe(fav_page_name)