test: unflake/fix/delete some tests (#38511)

This commit is contained in:
Dmitry Gozman 2025-12-10 16:30:25 +00:00 committed by GitHub
parent 6c2eea418a
commit 2f74515c0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 30 additions and 36 deletions

View File

@ -24,7 +24,12 @@ it('SharedArrayBuffer should work @smoke', async function({ contextFactory, http
httpsServer.setRoute('/sharedarraybuffer', (req, res) => {
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
res.end();
// Note: without 'onload', Firefox sometimes does not fire the load event
// over the protocol. The reason is unclear.
res.end(`
<div>Hello there!</div>
<script>window.onload = () => console.log('onload')</script>
`);
});
await page.goto(httpsServer.PREFIX + '/sharedarraybuffer');
expect(await page.evaluate(() => typeof SharedArrayBuffer)).toBe('function');

View File

@ -156,7 +156,12 @@ it('should keep reduced motion and color emulation after reload', async ({ page,
// Force CanonicalBrowsingContext replacement in Firefox.
server.setRoute('/empty.html', (req, res) => {
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
res.end();
// Note: without 'onload', Firefox sometimes does not fire the load event
// over the protocol. The reason is unclear.
res.end(`
<div>Hello there!</div>
<script>window.onload = () => console.log('onload')</script>
`);
});
await page.goto(server.EMPTY_PAGE);

View File

@ -119,7 +119,12 @@ it('should work with Cross-Origin-Opener-Policy', async ({ page, server }) => {
it('should work with Cross-Origin-Opener-Policy and interception', async ({ page, server }) => {
server.setRoute('/empty.html', (req, res) => {
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
res.end();
// Note: without 'onload', Firefox sometimes does not fire the load event
// over the protocol. The reason is unclear.
res.end(`
<div>Hello there!</div>
<script>window.onload = () => console.log('onload')</script>
`);
});
const requests = new Set();
const events = [];
@ -155,7 +160,12 @@ it('should work with Cross-Origin-Opener-Policy after redirect', async ({ page,
server.setRedirect('/redirect', '/empty.html');
server.setRoute('/empty.html', (req, res) => {
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
res.end();
// Note: without 'onload', Firefox sometimes does not fire the load event
// over the protocol. The reason is unclear.
res.end(`
<div>Hello there!</div>
<script>window.onload = () => console.log('onload')</script>
`);
});
const requests = new Set();
const events = [];

View File

@ -299,7 +299,12 @@ it('should work with Cross-Origin-Opener-Policy', async ({ page, server, browser
serverRequests.push(req.url);
serverHeaders ??= req.headers;
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
res.end();
// Note: without 'onload', Firefox sometimes does not fire the load event
// over the protocol. The reason is unclear.
res.end(`
<div>Hello there!</div>
<script>window.onload = () => console.log('onload')</script>
`);
});
const intercepted = [];

View File

@ -67,37 +67,6 @@ it('should dispatch wheel events @smoke', async ({ page, server }) => {
});
});
it('should dispatch wheel events after context menu was opened', async ({ page, browserName, isWindows, channel }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/20823' });
it.fixme(browserName === 'firefox' && !channel?.startsWith('moz-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.mouse.move(50, 60);
await page.evaluate(() => {
window['contextMenuPromise'] = new Promise(x => {
window.addEventListener('contextmenu', x, false);
});
});
await page.mouse.down({ button: 'right' });
await page.evaluate(() => window['contextMenuPromise']);
await listenForWheelEvents(page, 'div');
await page.mouse.wheel(0, 100);
await page.waitForFunction('window.scrollY === 100');
await expectEvent(page, {
deltaX: 0,
deltaY: 100,
clientX: 50,
clientY: 60,
deltaMode: 0,
ctrlKey: false,
shiftKey: false,
altKey: false,
metaKey: false,
});
});
it('should dispatch wheel events after popup was opened @smoke', async ({ page, server }) => {
await page.setContent(`
<div style="width: 5000px; height: 5000px;"></div>