There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
test: fix e2e (#4390)
Alex Yang40e094dcdd2e
diff --git a/packages/component/src/components/not-found-page/not-found-page.tsx b/packages/component/src/components/not-found-page/not-found-page.tsxindex f31dcdc86a..23bcd14508 100644--- a/packages/component/src/components/not-found-page/not-found-page.tsx+++ b/packages/component/src/components/not-found-page/not-found-page.tsx@@ -24,7 +24,7 @@ export const NotFoundPage = ({const t = useAFFiNEI18N();return (- <div className={notFoundPageContainer}>+ <div className={notFoundPageContainer} data-testid="not-found"><div><div className={wrapper}><NotFoundPattern />diff --git a/tests/affine-local/e2e/exception-page.spec.ts b/tests/affine-local/e2e/exception-page.spec.tsindex 76dcdeb70a..1233f5b393 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.tsindex 5cfa515514..73397d0f62 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.tsindex 7319ef1e76..d765c60559 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.tsindex 55590169c5..70a451c145 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 }) => {