test: e2e 选择器迁移为角色定位

This commit is contained in:
2026-08-27 22:25:59 +08:00
parent 8c8924d652
commit 5569921df6
5 changed files with 30 additions and 30 deletions
+2 -2
View File
@@ -23,12 +23,12 @@ test.describe('Welcome page', () => {
});
test('clicking start study navigates to /study', async ({ page }) => {
await page.locator('.quick-card').first().locator('button').click();
await page.getByRole('button', { name: '开始学习' }).click();
await expect(page).toHaveURL(/\/study/);
});
test('clicking start review navigates to /review', async ({ page }) => {
await page.locator('.quick-card').nth(1).locator('button').click();
await page.getByRole('button', { name: '开始复习' }).click();
await expect(page).toHaveURL(/\/review/);
});