test: unflake/skip a few tests (#32929)

This commit is contained in:
Dmitry Gozman 2024-10-02 06:58:21 -07:00 committed by GitHub
parent 31a4a74598
commit face24dc66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 9 deletions

View File

@ -199,8 +199,9 @@ browserTest('should not fire blur events when interacting with more than one pag
expect(await page2.evaluate(() => !!window['gotBlur'])).toBe(false);
});
browserTest('should trigger hover state concurrently', async ({ browserType, browserName }) => {
browserTest('should trigger hover state concurrently', async ({ browserType, browserName, headless }) => {
browserTest.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/27969' });
browserTest.skip(!headless, 'headed messes up with hover');
browserTest.fixme(browserName === 'firefox');
const browser1 = await browserType.launch();

View File

@ -261,7 +261,7 @@ test('should have network requests', async ({ showTraceViewer }) => {
await expect(traceViewer.networkRequests).toContainText([/style.cssGET200text\/css/]);
await expect(traceViewer.networkRequests).toContainText([/404GET404text\/plain/]);
await expect(traceViewer.networkRequests).toContainText([/script.jsGET200application\/javascript/]);
await expect(traceViewer.networkRequests.filter({ hasText: '404' })).toHaveCSS('background-color', 'rgb(242, 222, 222)');
await expect(traceViewer.networkRequests.filter({ hasText: '404GET404text' })).toHaveCSS('background-color', 'rgb(242, 222, 222)');
});
test('should filter network requests by resource type', async ({ page, runAndTrace, server }) => {

View File

@ -190,7 +190,9 @@ it('should select the text with mouse', async ({ page, server }) => {
})).toBe(text);
});
it('should trigger hover state', async ({ page, server }) => {
it('should trigger hover state', async ({ page, server, headless }) => {
it.skip(!headless, 'headed messes up with hover');
await page.goto(server.PREFIX + '/input/scrollable.html');
await page.hover('#button-6');
expect(await page.evaluate(() => document.querySelector('button:hover').id)).toBe('button-6');
@ -200,14 +202,18 @@ it('should trigger hover state', async ({ page, server }) => {
expect(await page.evaluate(() => document.querySelector('button:hover').id)).toBe('button-91');
});
it('should trigger hover state on disabled button', async ({ page, server }) => {
it('should trigger hover state on disabled button', async ({ page, server, headless }) => {
it.skip(!headless, 'headed messes up with hover');
await page.goto(server.PREFIX + '/input/scrollable.html');
await page.$eval('#button-6', (button: HTMLButtonElement) => button.disabled = true);
await page.hover('#button-6', { timeout: 5000 });
expect(await page.evaluate(() => document.querySelector('button:hover').id)).toBe('button-6');
});
it('should trigger hover state with removed window.Node', async ({ page, server }) => {
it('should trigger hover state with removed window.Node', async ({ page, server, headless }) => {
it.skip(!headless, 'headed messes up with hover');
await page.goto(server.PREFIX + '/input/scrollable.html');
await page.evaluate(() => delete window.Node);
await page.hover('#button-6');

View File

@ -312,7 +312,7 @@ it('should fetch original request and fulfill', async ({ page, server, isElectro
it('should fulfill with multiple set-cookie', async ({ page, server, isElectron, electronMajorVersion }) => {
it.skip(isElectron && electronMajorVersion < 14, 'Electron 14+ is required');
const cookies = ['a=b', 'c=d'];
await page.route('**/empty.html', async route => {
await page.route('**/multiple-set-cookie.html', async route => {
void route.fulfill({
status: 200,
headers: {
@ -323,7 +323,7 @@ it('should fulfill with multiple set-cookie', async ({ page, server, isElectron,
body: ''
});
});
const response = await page.goto(server.EMPTY_PAGE);
const response = await page.goto(server.PREFIX + '/multiple-set-cookie.html');
expect((await page.evaluate(() => document.cookie)).split(';').map(s => s.trim()).sort()).toEqual(cookies);
expect(await response.headerValue('X-Header-1')).toBe('v1');
expect(await response.headerValue('X-Header-2')).toBe('v2');

View File

@ -250,8 +250,8 @@ it('should support offline', async ({ page, server, browserName }) => {
page.goto(server.PREFIX + '/worker/worker.html'),
]);
await page.context().setOffline(true);
expect(await worker.evaluate(() => navigator.onLine)).toBe(false);
await expect.poll(() => worker.evaluate(() => navigator.onLine)).toBe(false);
expect(await worker.evaluate(() => fetch('/one-style.css').catch(e => 'error'))).toBe('error');
await page.context().setOffline(false);
expect(await worker.evaluate(() => navigator.onLine)).toBe(true);
await expect.poll(() => worker.evaluate(() => navigator.onLine)).toBe(true);
});