mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-24 05:07:06 +08:00
feat: add e2e test for creating multi workspaces
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
interface CreateWorkspaceParams {
|
||||
name: string;
|
||||
}
|
||||
export async function createWorkspace(
|
||||
params: CreateWorkspaceParams,
|
||||
page: Page
|
||||
) {
|
||||
// open workspace list modal
|
||||
const workspaceName = page.getByTestId('workspace-name');
|
||||
await workspaceName.click();
|
||||
|
||||
// open create workspace modal
|
||||
await page.locator('.add-icon').click();
|
||||
|
||||
// input workspace name
|
||||
await page.getByPlaceholder('Set a Workspace name').click();
|
||||
await page.getByPlaceholder('Set a Workspace name').fill(params.name);
|
||||
|
||||
// click create button
|
||||
await page.getByRole('button', { name: 'Create' }).click();
|
||||
|
||||
return page.waitForTimeout(300);
|
||||
}
|
||||
Reference in New Issue
Block a user