From c16e4d4464e1d208e5e90df5cfad065e6dd6de27 Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Fri, 23 Feb 2024 14:14:41 +0000 Subject: [PATCH] fix: page properties flaky tests (#5893) --- tests/affine-local/e2e/page-properties.spec.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/affine-local/e2e/page-properties.spec.ts b/tests/affine-local/e2e/page-properties.spec.ts index 9f5c278a3b..bbbd4eb8b3 100644 --- a/tests/affine-local/e2e/page-properties.spec.ts +++ b/tests/affine-local/e2e/page-properties.spec.ts @@ -5,7 +5,12 @@ import { openHomePage, openJournalsPage, } from '@affine-test/kit/utils/load-page'; -import { dragTo, waitForEditorLoad } from '@affine-test/kit/utils/page-logic'; +import { + clickNewPageButton, + dragTo, + waitForEditorLoad, + waitForEmptyEditor, +} from '@affine-test/kit/utils/page-logic'; import { addCustomProperty, changePropertyVisibility, @@ -23,7 +28,8 @@ import { expect } from '@playwright/test'; test.beforeEach(async ({ page }) => { await openHomePage(page); await clickPageModeButton(page); - await waitForEditorLoad(page); + await clickNewPageButton(page); + await waitForEmptyEditor(page); }); test('allow create tag', async ({ page }) => { @@ -41,6 +47,8 @@ test('allow create tag', async ({ page }) => { test('allow create tag on journals page', async ({ page }) => { await openJournalsPage(page); + await waitForEditorLoad(page); + await openTagsEditor(page); await searchAndCreateTag(page, 'Test1'); await searchAndCreateTag(page, 'Test2');