mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
test: fix e2e (#4390)
This commit is contained in:
@@ -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 />
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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]');
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user