test: fix flaky title insert (#3884)

This commit is contained in:
Alex Yang 2023-08-21 19:19:59 -05:00 committed by GitHub
parent 2a5ef04397
commit b5afbe385f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,7 @@ test('Not show navigation path if page is not a subpage or current page is not i
expect(await page.getByTestId('navigation-path').count()).toBe(0);
});
test('Assert the recent browse pages are on the recent list', async ({
test('assert the recent browse pages are on the recent list', async ({
page,
}) => {
await openHomePage(page);
@ -187,20 +187,35 @@ test('Assert the recent browse pages are on the recent list', async ({
// create first page
await newPage(page);
await page.keyboard.insertText('sgtokidoki');
{
const title = getBlockSuiteEditorTitle(page);
await title.type('sgtokidoki', {
delay: 50,
});
}
await page.waitForTimeout(200);
// create second page
await openQuickSearchByShortcut(page);
const addNewPage = page.getByTestId('quick-search-add-new-page');
await addNewPage.click();
await page.keyboard.insertText('theliquidhorse');
{
const title = getBlockSuiteEditorTitle(page);
await title.type('theliquidhorse', {
delay: 50,
});
}
await page.waitForTimeout(200);
// create thrid page
await openQuickSearchByShortcut(page);
await addNewPage.click();
await page.keyboard.insertText('battlekot');
{
const title = getBlockSuiteEditorTitle(page);
await title.type('battlekot', {
delay: 50,
});
}
await page.waitForTimeout(200);
await openQuickSearchByShortcut(page);