test: cover share page e2e (#4126)

This commit is contained in:
Alex Yang
2023-09-02 00:57:04 -05:00
committed by GitHub
parent 8825678ca9
commit 4f97ea8a5d
27 changed files with 186 additions and 99 deletions
@@ -1,8 +1,8 @@
import { test } from '@affine-test/kit/playwright';
import { openHomePage } from '@affine-test/kit/utils/load-page';
import {
clickNewPageButton,
getBlockSuiteEditorTitle,
newPage,
waitForEditorLoad,
} from '@affine-test/kit/utils/page-logic';
import type { Page } from '@playwright/test';
@@ -20,7 +20,7 @@ const addDatabase = async (page: Page) => {
test('database is useable', async ({ page }) => {
await openHomePage(page);
await waitForEditorLoad(page);
await newPage(page);
await clickNewPageButton(page);
await waitForEditorLoad(page);
const title = getBlockSuiteEditorTitle(page);
await title.type('test title');
@@ -31,7 +31,7 @@ test('database is useable', async ({ page }) => {
await expect(database).toBeVisible();
await page.reload();
await waitForEditorLoad(page);
await newPage(page);
await clickNewPageButton(page);
await waitForEditorLoad(page);
const title2 = getBlockSuiteEditorTitle(page);
await title2.type('test title2');
@@ -46,13 +46,13 @@ test('database is useable', async ({ page }) => {
test('link page is useable', async ({ page }) => {
await openHomePage(page);
await waitForEditorLoad(page);
await newPage(page);
await clickNewPageButton(page);
await waitForEditorLoad(page);
const title = await getBlockSuiteEditorTitle(page);
await title.type('page1');
await page.keyboard.press('Enter');
expect(await title.innerText()).toBe('page1');
await newPage(page);
await clickNewPageButton(page);
await waitForEditorLoad(page);
const title2 = await getBlockSuiteEditorTitle(page);
await title2.type('page2');