This commit is contained in:
Ilenia
2024-06-26 16:14:12 +02:00
committed by GitHub
parent cbfb17cc8a
commit 9ffb1d5b43
9 changed files with 58 additions and 28 deletions
+13 -2
View File
@@ -24,7 +24,18 @@ export const focusEditor = async ({
await getEditors(page).focus();
};
export async function clearEditor({ page }: { page: Page }) {
await page.keyboard.press('ControlOrMeta+a');
export async function clearEditor({
page,
browserName
}: {
page: Page;
browserName: string;
}) {
// TODO: replace with ControlOrMeta when it's supported
if (browserName === 'webkit') {
await page.keyboard.press('Meta+a');
} else {
await page.keyboard.press('Control+a');
}
await page.keyboard.press('Backspace');
}