diff --git a/packages/playwright-core/src/server/macEditingCommands.ts b/packages/playwright-core/src/server/macEditingCommands.ts index d7867da029..8f4c496e8a 100644 --- a/packages/playwright-core/src/server/macEditingCommands.ts +++ b/packages/playwright-core/src/server/macEditingCommands.ts @@ -126,4 +126,6 @@ export const macEditingCommands: {[key: string]: string|string[]} = { 'Shift+Meta+ArrowRight': 'moveToRightEndOfLineAndModifySelection:', 'Meta+KeyA': 'selectAll:', + 'Meta+KeyC': 'copy:', + 'Meta+KeyV': 'paste:', }; diff --git a/tests/page/page-keyboard.spec.ts b/tests/page/page-keyboard.spec.ts index ed31edb50e..29638647dc 100644 --- a/tests/page/page-keyboard.spec.ts +++ b/tests/page/page-keyboard.spec.ts @@ -464,6 +464,18 @@ it('should dispatch a click event on a button when Enter gets pressed', async ({ expect((await actual.jsonValue()).clicked).toBe(true); }); +it('should support simple copy-pasting', async ({ page, isMac, browserName }) => { + it.fixme(browserName === 'webkit', 'https://github.com/microsoft/playwright/issues/12000'); + const modifier = isMac ? 'Meta' : 'Control'; + await page.setContent(`