test: improve data migration suite (#4124)

This commit is contained in:
Alex Yang
2023-09-01 22:31:07 -05:00
committed by GitHub
parent eb1a21265f
commit 70b5a9deeb
43 changed files with 273 additions and 265 deletions

View File

@@ -1,7 +1,7 @@
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
export async function waitEditorLoad(page: Page) {
export async function waitForEditorLoad(page: Page) {
await page.waitForSelector('v-line', {
timeout: 10000,
});
@@ -19,7 +19,7 @@ export async function newPage(page: Page) {
await page.getByTestId('new-page-button').click({
delay: 100,
});
await waitEditorLoad(page);
await waitForEditorLoad(page);
}
export function getBlockSuiteEditorTitle(page: Page) {
@@ -30,11 +30,6 @@ export async function type(page: Page, content: string, delay = 50) {
await page.keyboard.type(content, { delay });
}
export async function pressEnter(page: Page) {
// avoid flaky test by simulate real user input
await page.keyboard.press('Enter', { delay: 50 });
}
export const createLinkedPage = async (page: Page, pageName?: string) => {
await page.keyboard.type('@', { delay: 50 });
const linkedPagePopover = page.locator('.linked-page-popover');