test: update context menu tests (#21126)
It turns out these new contextmenu-based tests do not work on Chromium-based browsers on Windows. We consider context menu support a best-effort, so we skip them for now.
This commit is contained in:
parent
2bb6bc7ad0
commit
3ff3567c89
|
|
@ -664,7 +664,8 @@ async function captureLastKeydown(page) {
|
||||||
return lastEvent;
|
return lastEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
it('should dispatch insertText after context menu was opened', async ({ server, page, browserName }) => {
|
it('should dispatch insertText after context menu was opened', async ({ server, page, browserName, isWindows }) => {
|
||||||
|
it.skip(browserName === 'chromium' && isWindows, 'context menu support is best-effort for Linux and MacOS');
|
||||||
await page.goto(server.PREFIX + '/input/textarea.html');
|
await page.goto(server.PREFIX + '/input/textarea.html');
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
window['contextMenuPromise'] = new Promise(x => {
|
window['contextMenuPromise'] = new Promise(x => {
|
||||||
|
|
@ -682,7 +683,8 @@ it('should dispatch insertText after context menu was opened', async ({ server,
|
||||||
await expect.poll(() => page.locator('textarea').inputValue()).toBe('嗨');
|
await expect.poll(() => page.locator('textarea').inputValue()).toBe('嗨');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should type after context menu was opened', async ({ server, page, browserName }) => {
|
it('should type after context menu was opened', async ({ server, page, browserName, isWindows }) => {
|
||||||
|
it.skip(browserName === 'chromium' && isWindows, 'context menu support is best-effort for Linux and MacOS');
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
window['keys'] = [];
|
window['keys'] = [];
|
||||||
window.addEventListener('keydown', event => window['keys'].push(event.key));
|
window.addEventListener('keydown', event => window['keys'].push(event.key));
|
||||||
|
|
|
||||||
|
|
@ -253,6 +253,10 @@ it('should always round down', async ({ page }) => {
|
||||||
|
|
||||||
it('should not crash on mouse drag with any button', async ({ page }) => {
|
it('should not crash on mouse drag with any button', async ({ page }) => {
|
||||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16609' });
|
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/16609' });
|
||||||
|
await page.evaluate(() => {
|
||||||
|
// Do not show contextmenu on right click since it is poorly supported.
|
||||||
|
window.addEventListener('contextmenu', e => e.preventDefault(), false);
|
||||||
|
});
|
||||||
for (const button of ['left', 'middle', 'right'] as const) {
|
for (const button of ['left', 'middle', 'right'] as const) {
|
||||||
await page.mouse.move(50, 50);
|
await page.mouse.move(50, 50);
|
||||||
await page.mouse.down({ button });
|
await page.mouse.down({ button });
|
||||||
|
|
@ -260,9 +264,10 @@ it('should not crash on mouse drag with any button', async ({ page }) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should dispatch mouse move after context menu was opened', async ({ page, browserName }) => {
|
it('should dispatch mouse move after context menu was opened', async ({ page, browserName, isWindows }) => {
|
||||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/20823' });
|
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/20823' });
|
||||||
it.fixme(browserName === 'firefox');
|
it.fixme(browserName === 'firefox');
|
||||||
|
it.skip(browserName === 'chromium' && isWindows, 'context menu support is best-effort for Linux and MacOS');
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
window['contextMenuPromise'] = new Promise(x => {
|
window['contextMenuPromise'] = new Promise(x => {
|
||||||
window.addEventListener('contextmenu', x, false);
|
window.addEventListener('contextmenu', x, false);
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,10 @@ it('should dispatch wheel events @smoke', async ({ page, server }) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should dispatch wheel events after context menu was opened', async ({ page, browserName }) => {
|
it('should dispatch wheel events after context menu was opened', async ({ page, browserName, isWindows }) => {
|
||||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/20823' });
|
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/20823' });
|
||||||
it.fixme(browserName === 'firefox');
|
it.fixme(browserName === 'firefox');
|
||||||
|
it.skip(browserName === 'chromium' && isWindows, 'context menu support is best-effort for Linux and MacOS');
|
||||||
|
|
||||||
await page.setContent(`<div style="width: 5000px; height: 5000px;"></div>`);
|
await page.setContent(`<div style="width: 5000px; height: 5000px;"></div>`);
|
||||||
await page.mouse.move(50, 60);
|
await page.mouse.move(50, 60);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue