test: fix/fixme/update a few tests (#33006)

This commit is contained in:
Dmitry Gozman 2024-10-08 03:59:35 -07:00 committed by GitHub
parent 5b29ead6f0
commit 814f7eb556
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 17 additions and 13 deletions

View File

@ -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');
});

View File

@ -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,<title>Hello world!</title>');
await androidDevice.fill({ res: 'org.chromium.webview_shell:id/url_field' }, 'data:text/html,<title>Hello world!</title>', { timeout: test.info().timeout });
await Promise.all([
page.waitForNavigation(),
androidDevice.press({ res: 'org.chromium.webview_shell:id/url_field' }, 'Enter')

View File

@ -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();

View File

@ -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(`<div style="width: 1px; height: 1px;" onclick="window.__clicked = true"></div>`);
await page.click('div');
expect(await page.evaluate('window.__clicked')).toBe(true);

View File

@ -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<http.IncomingMessage>(f => resolve = f);

View File

@ -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'),

View File

@ -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 }) => {