Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
test: skip/improve some tests that are flaky (#30993)
Dmitry Gozmanae1e07de106e
diff --git a/tests/library/fetch-proxy.spec.ts b/tests/library/fetch-proxy.spec.tsindex 90b50b9f1f..b0c921c8e3 100644--- a/tests/library/fetch-proxy.spec.ts+++ b/tests/library/fetch-proxy.spec.ts@@ -132,6 +132,8 @@ it(`should support proxy.bypass`, async ({ contextFactory, contextOptions, serve});it('should use socks proxy', async ({ playwright, server, socksPort }) => {+ it.skip(!!process.env.INSIDE_DOCKER, 'connect ECONNREFUSED 127.0.0.1:<port>');+const request = await playwright.request.newContext({ proxy: {server: `socks5://localhost:${socksPort}`,} });diff --git a/tests/library/inspector/inspectorTest.ts b/tests/library/inspector/inspectorTest.tsindex 7f759f13aa..1d5e30825a 100644--- a/tests/library/inspector/inspectorTest.ts+++ b/tests/library/inspector/inspectorTest.ts@@ -131,12 +131,11 @@ class Recorder {async waitForOutput(file: string, text: string): Promise<Map<string, Source>> {if (!codegenLang2Id.has(file))throw new Error(`Unknown language: ${file}`);- const handle = await this.recorderPage.waitForFunction((params: { text: string, languageId: string }) => {- const w = window as any;- const source = (w.playwrightSourcesEchoForTest || []).find((s: Source) => s.id === params.languageId);- return source && source.text.includes(params.text) ? w.playwrightSourcesEchoForTest : null;- }, { text, languageId: codegenLang2Id.get(file) }, { timeout: 0, polling: 300 });- const sources: Source[] = await handle.jsonValue();+ await expect.poll(() => this.recorderPage.evaluate(languageId => {+ const sources = ((window as any).playwrightSourcesEchoForTest || []) as Source[];+ return sources.find(s => s.id === languageId)?.text || '';+ }, codegenLang2Id.get(file)), { timeout: 0 }).toContain(text);+ const sources: Source[] = await this.recorderPage.evaluate(() => (window as any).playwrightSourcesEchoForTest || []);for (const source of sources) {if (!codegenLangId2lang.has(source.id))throw new Error(`Unknown language: ${source.id}`);diff --git a/tests/page/page-network-request.spec.ts b/tests/page/page-network-request.spec.tsindex 472bb34560..f84a569c5c 100644--- a/tests/page/page-network-request.spec.ts+++ b/tests/page/page-network-request.spec.ts@@ -315,8 +315,9 @@ it('should get |undefined| with postDataJSON() when there is no post data', asynexpect(response.request().postDataJSON()).toBe(null);});-it('should return multipart/form-data', async ({ page, server, browserName }) => {+it('should return multipart/form-data', async ({ page, server, browserName, browserMajorVersion }) => {it.fixme(browserName === 'webkit', 'File content is missing in WebKit');+ it.skip(browserName === 'chromium' && browserMajorVersion < 126, 'Requires a recent enough protocol');await page.goto(server.EMPTY_PAGE);server.setRoute('/post', (req, res) => res.end());diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.tsindex 9230bb5fa8..2fbac43081 100644--- a/tests/page/page-request-continue.spec.ts+++ b/tests/page/page-request-continue.spec.ts@@ -515,8 +515,4 @@ it('continue should not change multipart/form-data body', async ({ page, server,'------'].join('\r\n');expect.soft((await reqBefore.postBody).toString('utf8')).toContain(fileContent);expect.soft((await reqAfter.postBody).toString('utf8')).toContain(fileContent);- // Firefox sends a bit longer boundary.- const expectedLength = browserName === 'firefox' ? '246' : '208';- expect.soft(reqBefore.headers['content-length']).toBe(expectedLength);- expect.soft(reqAfter.headers['content-length']).toBe(expectedLength);});