diff --git a/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts b/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts index 87807adac..a8dde1dc3 100644 --- a/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts +++ b/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts @@ -53,6 +53,20 @@ export class EditorUtils { await page.getByTestId('switch-edgeless-mode-button').click(); editor.waitForElementState('hidden'); await page.waitForSelector('edgeless-editor'); + try { + const edgelessNotificationClose = page.getByTestId( + 'notification-close-button' + ); + await edgelessNotificationClose.waitFor({ + state: 'visible', + timeout: 2000, + }); + await edgelessNotificationClose.click(); + // Focus to the edgeless editor + await page.mouse.click(400, 400); + } catch { + // do nothing if the notification close button is not found + } } public static async switchToPageMode(page: Page) {