feat: add e2e test for creating multi workspaces

This commit is contained in:
tzhangchi
2023-02-06 22:26:01 +08:00
parent 274505590c
commit 9548cc1ed1
4 changed files with 66 additions and 0 deletions
+24
View File
@@ -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);
}