diff --git a/tests/affine-local/e2e/exception-page.spec.ts b/tests/affine-local/e2e/exception-page.spec.ts
index 76dcdeb70..1233f5b39 100644
--- a/tests/affine-local/e2e/exception-page.spec.ts
+++ b/tests/affine-local/e2e/exception-page.spec.ts
@@ -3,6 +3,6 @@ import { expect } from '@playwright/test';
test('visit 404 page', async ({ page }) => {
await page.goto('http://localhost:8080/404');
- const notFoundTip = page.locator('[data-testid=notFound]');
+ const notFoundTip = page.getByTestId('not-found');
await expect(notFoundTip).toBeVisible();
});
diff --git a/tests/affine-local/e2e/local-first-avatar.spec.ts b/tests/affine-local/e2e/local-first-avatar.spec.ts
index 5cfa51551..73397d0f6 100644
--- a/tests/affine-local/e2e/local-first-avatar.spec.ts
+++ b/tests/affine-local/e2e/local-first-avatar.spec.ts
@@ -21,7 +21,9 @@ test('should create a page with a local first avatar and remove it', async ({
.getByTestId('create-workspace-input')
.type('Test Workspace 1', { delay: 50 });
await page.getByTestId('create-workspace-create-button').click();
- await page.getByTestId('workspace-name').click();
+ await page.getByTestId('workspace-name').click({
+ delay: 50,
+ });
await page.getByTestId('workspace-card').nth(1).click();
await page.getByTestId('settings-modal-trigger').click();
await page.getByTestId('current-workspace-label').click();
@@ -29,10 +31,14 @@ test('should create a page with a local first avatar and remove it', async ({
.getByTestId('upload-avatar')
.setInputFiles(resolve(rootDir, 'tests', 'fixtures', 'smile.png'));
await page.mouse.click(0, 0);
- await page.getByTestId('workspace-name').click();
+ await page.getByTestId('workspace-name').click({
+ delay: 50,
+ });
await page.getByTestId('workspace-card').nth(0).click();
await page.waitForTimeout(1000);
- await page.getByTestId('workspace-name').click();
+ await page.getByTestId('workspace-name').click({
+ delay: 50,
+ });
await page.getByTestId('workspace-card').nth(1).click();
const blobUrl = await page
.getByTestId('workspace-avatar')
diff --git a/tests/affine-local/e2e/quick-search.spec.ts b/tests/affine-local/e2e/quick-search.spec.ts
index 7319ef1e7..d765c6055 100644
--- a/tests/affine-local/e2e/quick-search.spec.ts
+++ b/tests/affine-local/e2e/quick-search.spec.ts
@@ -137,7 +137,7 @@ test('Navigate to the 404 page and try to open quick search', async ({
page,
}) => {
await page.goto('http://localhost:8080/404');
- const notFoundTip = page.locator('[data-testid=notFound]');
+ const notFoundTip = page.getByTestId('not-found');
await expect(notFoundTip).toBeVisible();
await openQuickSearchByShortcut(page);
const quickSearch = page.locator('[data-testid=quickSearch]');
diff --git a/tests/affine-local/e2e/router.spec.ts b/tests/affine-local/e2e/router.spec.ts
index 55590169c..70a451c14 100644
--- a/tests/affine-local/e2e/router.spec.ts
+++ b/tests/affine-local/e2e/router.spec.ts
@@ -9,7 +9,7 @@ test('goto not found page', async ({ page }) => {
const currentUrl = page.url();
const invalidUrl = currentUrl.replace('hello-world', 'invalid');
await page.goto(invalidUrl);
- await expect(page.getByTestId('notFound')).toBeVisible();
+ await expect(page.getByTestId('not-found')).toBeVisible();
});
test('goto not found workspace', async ({ page }) => {