feat: single page API in public workspace (#1794)
This commit is contained in:
1 parent
0577298344
commit
1ad4b0fc89
6 files changed
+95
-31
No files matched your search
@@ -3,7 +3,10 @@ import { expect } from '@playwright/test';
|
||||
import { waitMarkdownImported } from '../../libs/page-logic';
|
||||
import { test } from '../../libs/playwright';
|
||||
import { clickPublishPanel } from '../../libs/setting';
|
||||
import { clickSideBarSettingButton } from '../../libs/sidebar';
|
||||
import {
|
||||
clickSideBarAllPageButton,
|
||||
clickSideBarSettingButton,
|
||||
} from '../../libs/sidebar';
|
||||
import { createFakeUser, loginUser, openHomePage } from '../../libs/utils';
|
||||
import { createWorkspace } from '../../libs/workspace';
|
||||
|
||||
@@ -39,4 +42,33 @@ test.describe('affine public workspace', () => {
|
||||
});
|
||||
await page2.getByText('Welcome to AFFiNE').click();
|
||||
});
|
||||
|
||||
test('access public workspace page', async ({ page, browser }) => {
|
||||
await openHomePage(page);
|
||||
const [a] = await createFakeUser();
|
||||
await loginUser(page, a);
|
||||
await waitMarkdownImported(page);
|
||||
const name = `test-${Date.now()}`;
|
||||
await createWorkspace({ name }, page);
|
||||
await waitMarkdownImported(page);
|
||||
await clickSideBarSettingButton(page);
|
||||
await page.waitForTimeout(50);
|
||||
await clickPublishPanel(page);
|
||||
await page.getByTestId('publish-enable-affine-cloud-button').click();
|
||||
await page.getByTestId('confirm-enable-affine-cloud-button').click();
|
||||
await page.getByTestId('publish-to-web-button').waitFor({
|
||||
timeout: 10000,
|
||||
});
|
||||
await page.getByTestId('publish-to-web-button').click();
|
||||
await page.getByTestId('share-url').waitFor({
|
||||
timeout: 10000,
|
||||
});
|
||||
await clickSideBarAllPageButton(page);
|
||||
await page.locator('tr').nth(1).click();
|
||||
const url = page.url();
|
||||
const context = await browser.newContext();
|
||||
const page2 = await context.newPage();
|
||||
await page2.goto(url.replace('workspace', 'public-workspace'));
|
||||
await page2.waitForSelector('v-line');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user