fix(core): image preview flaky (#6292)

This commit is contained in:
pengx17
2024-03-25 02:46:31 +00:00
parent 64c011c72f
commit 578d4c9775
2 changed files with 12 additions and 0 deletions

View File

@@ -87,3 +87,13 @@ export const dragTo = async (page: Page, locator: Locator, target: Locator) => {
await target.hover();
await page.mouse.up();
};
// sometimes editor loses focus, this function is to focus the editor
export const focusInlineEditor = async (page: Page) => {
await page
.locator(
`.affine-paragraph-rich-text-wrapper:has(.visible):has-text("Type '/' for commands")`
)
.locator('.inline-editor')
.focus();
};