From 814f7eb5563f32c3dde029bd07c87f99803bfdcb Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Tue, 8 Oct 2024 03:59:35 -0700 Subject: [PATCH] test: fix/fixme/update a few tests (#33006) --- tests/android/device.spec.ts | 2 +- tests/android/webview.spec.ts | 2 +- tests/page/locator-misc-1.spec.ts | 4 +++- tests/page/page-click.spec.ts | 7 +++---- tests/page/page-request-continue.spec.ts | 4 +++- tests/page/workers.spec.ts | 1 + tests/playwright-test/runner.spec.ts | 10 +++++----- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/tests/android/device.spec.ts b/tests/android/device.spec.ts index 8fed656450..8b750ca115 100644 --- a/tests/android/device.spec.ts +++ b/tests/android/device.spec.ts @@ -55,6 +55,6 @@ test('androidDevice.push', async function({ androidDevice }) { test('androidDevice.fill', async function({ androidDevice }) { await androidDevice.shell('am start org.chromium.webview_shell/.WebViewBrowserActivity'); - await androidDevice.fill({ res: 'org.chromium.webview_shell:id/url_field' }, 'Hello'); + await androidDevice.fill({ res: 'org.chromium.webview_shell:id/url_field' }, 'Hello', { timeout: test.info().timeout }); expect((await androidDevice.info({ res: 'org.chromium.webview_shell:id/url_field' })).text).toBe('Hello'); }); diff --git a/tests/android/webview.spec.ts b/tests/android/webview.spec.ts index 650f8f299c..a0d03b69b6 100644 --- a/tests/android/webview.spec.ts +++ b/tests/android/webview.spec.ts @@ -47,7 +47,7 @@ test('should navigate page externally', async function({ androidDevice }) { const webview = await androidDevice.webView({ pkg: 'org.chromium.webview_shell' }); const page = await webview.page(); - await androidDevice.fill({ res: 'org.chromium.webview_shell:id/url_field' }, 'data:text/html,Hello world!'); + await androidDevice.fill({ res: 'org.chromium.webview_shell:id/url_field' }, 'data:text/html,Hello world!', { timeout: test.info().timeout }); await Promise.all([ page.waitForNavigation(), androidDevice.press({ res: 'org.chromium.webview_shell:id/url_field' }, 'Enter') diff --git a/tests/page/locator-misc-1.spec.ts b/tests/page/locator-misc-1.spec.ts index 616beb3e7f..eaa0375c32 100644 --- a/tests/page/locator-misc-1.spec.ts +++ b/tests/page/locator-misc-1.spec.ts @@ -18,7 +18,9 @@ import { test as it, expect } from './pageTest'; import path from 'path'; -it('should hover @smoke', async ({ page, server }) => { +it('should hover @smoke', async ({ page, server, headless }) => { + it.skip(!headless, 'headed messes up with hover'); + await page.goto(server.PREFIX + '/input/scrollable.html'); const button = page.locator('#button-6'); await button.hover(); diff --git a/tests/page/page-click.spec.ts b/tests/page/page-click.spec.ts index fccef2ed0e..4a09c0d488 100644 --- a/tests/page/page-click.spec.ts +++ b/tests/page/page-click.spec.ts @@ -85,8 +85,9 @@ it('should click on a span with an inline element inside', async ({ page }) => { expect(await page.evaluate('CLICKED')).toBe(42); }); -it('should not throw UnhandledPromiseRejection when page closes', async ({ page, isWebView2 }) => { +it('should not throw UnhandledPromiseRejection when page closes', async ({ page, isWebView2, browserName, isWindows }) => { it.skip(isWebView2, 'Page.close() is not supported in WebView2'); + it.fixme(browserName === 'firefox' && isWindows, 'makes the next test to always timeout'); await Promise.all([ page.close(), @@ -94,9 +95,7 @@ it('should not throw UnhandledPromiseRejection when page closes', async ({ page, ]).catch(e => {}); }); -it('should click the 1x1 div', async ({ page, browserName, isWindows }) => { - it.fixme(browserName === 'firefox' && isWindows, 'always times out'); - +it('should click the 1x1 div', async ({ page }) => { await page.setContent(`
`); await page.click('div'); expect(await page.evaluate('window.__clicked')).toBe(true); diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.ts index 2df84e133a..a0e0e15f55 100644 --- a/tests/page/page-request-continue.spec.ts +++ b/tests/page/page-request-continue.spec.ts @@ -563,7 +563,9 @@ it('propagate headers cross origin redirect', { { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/13106' }, { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32045' }, ] -}, async ({ page, server }) => { +}, async ({ page, server, isAndroid }) => { + it.fixme(isAndroid, 'receives authorization:credentials header'); + await page.goto(server.PREFIX + '/empty.html'); let resolve; const serverRequestPromise = new Promise(f => resolve = f); diff --git a/tests/page/workers.spec.ts b/tests/page/workers.spec.ts index 1d53a73923..327a2ed45d 100644 --- a/tests/page/workers.spec.ts +++ b/tests/page/workers.spec.ts @@ -244,6 +244,7 @@ it('should support extra http headers', { it('should support offline', async ({ page, server, browserName }) => { it.fixme(browserName === 'firefox'); + it.fixme(browserName === 'webkit', 'flaky on all platforms'); const [worker] = await Promise.all([ page.waitForEvent('worker'), diff --git a/tests/playwright-test/runner.spec.ts b/tests/playwright-test/runner.spec.ts index 701b1e825d..c197879bd5 100644 --- a/tests/playwright-test/runner.spec.ts +++ b/tests/playwright-test/runner.spec.ts @@ -145,13 +145,13 @@ test('should ignore subprocess creation error because of SIGINT', async ({ inter process.kill(-testProcess.process.pid!, 'SIGINT'); const { exitCode } = await testProcess.exited; - expect(exitCode).toBe(130); + expect.soft(exitCode).toBe(130); const result = parseTestRunnerOutput(testProcess.output); - expect(result.passed).toBe(0); - expect(result.failed).toBe(0); - expect(result.didNotRun).toBe(2); - expect(result.output).not.toContain('worker process exited unexpectedly'); + expect.soft(result.passed).toBe(0); + expect.soft(result.failed).toBe(0); + expect.soft(result.didNotRun).toBe(2); + expect.soft(result.output).not.toContain('worker process exited unexpectedly'); }); test('sigint should stop workers', async ({ interactWithTestRunner }) => {