mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(workspace): check affine login auth (#2070)
This commit is contained in:
@@ -2,8 +2,10 @@ import type { Page } from '@playwright/test';
|
||||
|
||||
import { getMetas } from './utils';
|
||||
|
||||
export const webUrl = 'http://localhost:8080';
|
||||
|
||||
export async function openHomePage(page: Page) {
|
||||
await page.goto('http://localhost:8080');
|
||||
await page.goto(webUrl);
|
||||
}
|
||||
|
||||
export async function initHomePageWithPinboard(page: Page) {
|
||||
|
||||
@@ -131,10 +131,6 @@ export async function loginUser(
|
||||
}, token);
|
||||
}
|
||||
|
||||
export async function openHomePage(page: Page) {
|
||||
return page.goto('http://localhost:8080');
|
||||
}
|
||||
|
||||
export async function getMetas(page: Page): Promise<PageMeta[]> {
|
||||
return page.evaluate(
|
||||
() => globalThis.currentWorkspace.blockSuiteWorkspace.meta.pageMetas ?? []
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { clickCollaborationPanel } from './setting';
|
||||
import { clickSideBarSettingButton } from './sidebar';
|
||||
|
||||
interface CreateWorkspaceParams {
|
||||
name: string;
|
||||
}
|
||||
@@ -34,3 +37,14 @@ export async function assertCurrentWorkspaceFlavour(
|
||||
const actual = await page.evaluate(() => globalThis.currentWorkspace.flavour);
|
||||
expect(actual).toBe(flavour);
|
||||
}
|
||||
|
||||
export async function enableAffineCloudWorkspace(page: Page) {
|
||||
await clickSideBarSettingButton(page);
|
||||
await page.waitForTimeout(50);
|
||||
await clickCollaborationPanel(page);
|
||||
await page.getByTestId('local-workspace-enable-cloud-button').click();
|
||||
await page.getByTestId('confirm-enable-cloud-button').click();
|
||||
await page.waitForSelector("[data-testid='member-length']", {
|
||||
timeout: 20000,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user