parent
3c896f6bc5
commit
80bc532874
|
|
@ -128,4 +128,6 @@ export const macEditingCommands: {[key: string]: string|string[]} = {
|
|||
'Meta+KeyA': 'selectAll:',
|
||||
'Meta+KeyC': 'copy:',
|
||||
'Meta+KeyV': 'paste:',
|
||||
'Meta+KeyZ': 'undo:',
|
||||
'Shift+Meta+KeyZ': 'redo:',
|
||||
};
|
||||
|
|
|
|||
|
|
@ -476,6 +476,20 @@ it('should support simple copy-pasting', async ({ page, isMac, browserName }) =>
|
|||
expect(await page.evaluate(() => document.querySelector('div').textContent)).toBe('123123');
|
||||
});
|
||||
|
||||
it('should support undo-redo', async ({ page, isMac, browserName, isLinux }) => {
|
||||
it.fixme(browserName === 'webkit' && isLinux, 'https://github.com/microsoft/playwright/issues/12000');
|
||||
const modifier = isMac ? 'Meta' : 'Control';
|
||||
await page.setContent(`<div contenteditable></div>`);
|
||||
const div = page.locator('div');
|
||||
await expect(div).toHaveText('');
|
||||
await div.type('123');
|
||||
await expect(div).toHaveText('123');
|
||||
await page.keyboard.press(`${modifier}+KeyZ`);
|
||||
await expect(div).toHaveText('');
|
||||
await page.keyboard.press(`Shift+${modifier}+KeyZ`);
|
||||
await expect(div).toHaveText('123');
|
||||
});
|
||||
|
||||
it('should type repeatedly in contenteditable in shadow dom', async ({ page }) => {
|
||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/12941' });
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue