Skip to content

Commit 42d4f18

Browse files
authored
test: unflake/skip/fix some tests (#38905)
1 parent 42b9784 commit 42d4f18

7 files changed

Lines changed: 17 additions & 33 deletions

File tree

tests/library/hit-target.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ it('should click when element detaches in mousedown', async ({ page, server }) =
8282
});
8383
});
8484

85-
await page.click('button', { timeout: 1000 });
85+
await page.click('button', { timeout: 15000 });
8686
expect(await page.evaluate('result')).toBe('Mousedown');
8787
});
8888

@@ -391,7 +391,7 @@ it('should detect overlaid element in a transformed iframe', async ({ page }) =>
391391
"></iframe>
392392
`);
393393
const locator = page.frameLocator('iframe').locator('div');
394-
const error = await locator.click({ timeout: 3000 }).catch(e => e);
394+
const error = await locator.click({ timeout: 5000 }).catch(e => e);
395395
expect(error.message).toContain('<section>Overlay</section> intercepts pointer events');
396396
});
397397

tests/library/inspector/cli-codegen-2.spec.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
import { test, expect } from './inspectorTest';
18-
import fs from 'fs';
1918

2019
test.describe('cli codegen', () => {
2120
test.skip(({ mode }) => mode !== 'default');
@@ -452,27 +451,6 @@ await page1.GotoAsync("about:blank?foo");`);
452451
await recorder.waitForOutput('JavaScript', `await page.goto('${server.PREFIX}/page2.html');`);
453452
});
454453

455-
test('should save assets via SIGINT', async ({ runCLI, platform }, testInfo) => {
456-
test.skip(platform === 'win32', 'SIGINT not supported on Windows');
457-
458-
const storageFileName = testInfo.outputPath('auth.json');
459-
const harFileName = testInfo.outputPath('har.har');
460-
const cli = runCLI([`--save-storage=${storageFileName}`, `--save-har=${harFileName}`]);
461-
await cli.waitFor(`import { test, expect } from '@playwright/test'`);
462-
// Since our interrupt is non-graceful, we need to wait for the process to settle.
463-
// This test should be fixed.
464-
await new Promise(resolve => setTimeout(resolve, 2000));
465-
const { exitCode, signal } = await cli.sigint();
466-
if (exitCode !== null) {
467-
expect(exitCode).toBe(130);
468-
} else {
469-
// If the runner is slow enough, the process will be forcibly terminated by the signal
470-
expect(signal).toBe('SIGINT');
471-
}
472-
expect(fs.existsSync(storageFileName)).toBeTruthy();
473-
expect(fs.existsSync(harFileName)).toBeTruthy();
474-
});
475-
476454
test('should fill tricky characters', async ({ openRecorder }) => {
477455
const { page, recorder } = await openRecorder();
478456

tests/library/permissions.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ it.describe(() => {
256256

257257
it('local network request is allowed from public origin', {
258258
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/37861' }
259-
}, async ({ page, context, server, browserName }) => {
260-
it.fail(browserName === 'webkit');
259+
}, async ({ page, context, server, browserName, channel, browserMajorVersion }) => {
260+
it.skip(browserName === 'webkit');
261+
it.skip(channel?.startsWith('msedge'));
262+
it.skip(browserName === 'chromium' && browserMajorVersion < 145, 'local-network-access permission support has changed between versions');
263+
261264
if (browserName === 'chromium')
262265
await context.grantPermissions(['local-network-access']);
263266
const serverRequests = [];

tests/library/proxy.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ it.describe('should proxy local network requests', () => {
9090
description: 'link-local'
9191
}
9292
]) {
93-
it(`${params.description}`, async ({ platform, browserName, browserType, server, proxyServer }) => {
93+
it(`${params.description}`, async ({ platform, browserName, browserType, server, proxyServer, channel }) => {
9494
it.skip(browserName === 'webkit' && platform === 'darwin' && ['localhost', '127.0.0.1'].includes(params.target) && additionalBypass, 'Mac webkit does not proxy localhost when bypass rules are set.');
95+
it.fixme(channel?.startsWith('msedge'), 'times out while loading the page');
9596

9697
const path = `/target-${additionalBypass}-${params.target}.html`;
9798
server.setRoute(path, async (req, res) => {
@@ -175,7 +176,9 @@ it('should work with authenticate followed by redirect', async ({ browserName, b
175176
await browser.close();
176177
});
177178

178-
it('should exclude patterns', async ({ browserType, server, browserName, headless }) => {
179+
it('should exclude patterns', async ({ browserType, server, channel }) => {
180+
it.fixme(channel?.startsWith('msedge'), 'times out while loading the page');
181+
179182
server.setRoute('/target.html', async (req, res) => {
180183
res.end('<html><title>Served by the proxy</title></html>');
181184
});

tests/page/page-click-timeout-4.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ it('should fail to click the button behind a large header after scrolling around
9090
</script>
9191
`);
9292
await page.$eval('#li14', e => e.scrollIntoView());
93-
const error = await page.click('#target', { timeout: 1500 }).catch(e => e);
93+
const error = await page.click('#target', { timeout: 3500 }).catch(e => e);
9494
expect(error.message).toContain(`<div class="fixed"></div> intercepts pointer events`);
9595
expect(await page.evaluate(() => window['__clicked'])).toBe(undefined);
9696
const scrollTops = await page.evaluate(() => window['scrollTops']);

tests/page/page-click.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ it('should click a button that is overlaid by a permission popup', async ({ page
10791079
navigator.geolocation.getCurrentPosition(position => { });
10801080
});
10811081
// If popup blocks the click, then some of the `page.click` calls below will hang.
1082-
for (let i = 0; i < 100; ++i)
1082+
for (let i = 0; i < 30; ++i)
10831083
await page.click(`text=${i}`);
10841084
});
10851085

tests/playwright-test/expect.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,15 @@ test('should log scale the time', async ({ runInlineTest }) => {
586586
587587
test('pass', async ({ page }) => {
588588
await page.setContent('<div id=div>Wrong</div>');
589-
await expect(page.locator('div')).toHaveText('Text', { timeout: 2000 });
589+
await expect(page.locator('div')).toHaveText('Text', { timeout: 5000 });
590590
});
591591
`,
592592
}, { workers: 1 });
593593
const output = result.output;
594594
const tokens = output.split('unexpected value');
595-
// Log scale: 0, 100, 250, 500, 1000, 1000, should be less than 8.
595+
// Log scale: 0, 100, 250, 500, 1000, 1000, ... - should be less than 10.
596596
expect(tokens.length).toBeGreaterThan(1);
597-
expect(tokens.length).toBeLessThan(8);
597+
expect(tokens.length).toBeLessThan(10);
598598
expect(result.passed).toBe(0);
599599
expect(result.exitCode).toBe(1);
600600
});

0 commit comments

Comments
 (0)