adjust expecations

This commit is contained in:
Max Schmitt 2024-10-30 14:26:38 +01:00
parent f806c73806
commit 0649e8d2ad
5 changed files with 8 additions and 6 deletions

View file

@ -163,6 +163,7 @@ export async function openTraceViewerApp(url: string, browserName: string, optio
...options?.persistentContextOptions,
useWebSocket: isUnderTest(),
headless: !!options?.headless,
colorScheme: isUnderTest() ? 'light' : undefined,
},
});

View file

@ -21,6 +21,7 @@ import net from 'net';
import type { SocksSocketClosedPayload, SocksSocketDataPayload, SocksSocketRequestedPayload } from '../../packages/playwright-core/src/common/socksProxy';
import { SocksProxy } from '../../packages/playwright-core/lib/common/socksProxy';
// Certain browsers perform telemetry requests which we want to ignore.
const kConnectHostsToIgnore = new Set([
'www.bing.com:443',
]);

View file

@ -169,9 +169,9 @@ for (const kind of ['launchServer', 'run-server'] as const) {
await browser.close();
});
test('should ignore page.pause when headed', async ({ connect, startRemoteServer, browserType, headless }) => {
test.skip(headless, 'This test is only relevant in headed mode');
const originalHeadlessValue = (browserType as any)._defaultLaunchOptions.headless;
test('should ignore page.pause when headed', async ({ connect, startRemoteServer, browserType, channel }) => {
test.skip(channel === 'chromium-headless-shell', 'This test is only relevant in headed mode');
const headless = (browserType as any)._defaultLaunchOptions.headless;
(browserType as any)._defaultLaunchOptions.headless = false;
const remoteServer = await startRemoteServer(kind);
const browser = await connect(remoteServer.wsEndpoint());
@ -179,7 +179,7 @@ for (const kind of ['launchServer', 'run-server'] as const) {
const page = await browserContext.newPage();
await page.pause();
await browser.close();
(browserType as any)._defaultLaunchOptions.headless = originalHeadlessValue;
(browserType as any)._defaultLaunchOptions.headless = headless;
});
test('should be able to visit ipv6 through localhost', async ({ connect, startRemoteServer, ipV6ServerPort }) => {

View file

@ -262,7 +262,7 @@ it('should work with the domain module', async ({ browserType, server, browserNa
if (browserName === 'firefox')
expect(message).toBe('CLOSE_ABNORMAL');
else
expect(message).toContain(channel.includes('msedge') ? '' : ': 400');
expect(message).toContain(channel?.includes('msedge') ? '' : ': 400');
await browser.close();

View file

@ -148,7 +148,7 @@ it('should emit error', async ({ page, server, browserName, channel }) => {
if (browserName === 'firefox')
expect(message).toBe('CLOSE_ABNORMAL');
else
expect(message).toContain(channel.includes('msedge') ? '' : ': 400');
expect(message).toContain(channel?.includes('msedge') ? '' : ': 400');
});
it('should not have stray error events', async ({ page, server }) => {