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/fix a few tests (#40000)
Dmitry Gozman82bd8daf0567
diff --git a/tests/config/traceViewerFixtures.ts b/tests/config/traceViewerFixtures.tsindex 0668ae3dcb..18e35cf37b 100644--- a/tests/config/traceViewerFixtures.ts+++ b/tests/config/traceViewerFixtures.ts@@ -153,8 +153,9 @@ class TraceViewerPage {}export const traceViewerFixtures: Fixtures<TraceViewerFixtures, {}, BaseTestFixtures, BaseWorkerFixtures> = {- showTraceViewer: async ({ playwright, childProcess, browserName }, use) => {+ showTraceViewer: async ({ playwright, childProcess, browserName }, use, testInfo) => {const browsers: Browser[] = [];+ const tracings: any[] = [];await use(async (trace: string | undefined, { host, port, stdin } = {}) => {const command = ['node',@@ -176,10 +177,20 @@ export const traceViewerFixtures: Fixtures<TraceViewerFixtures, {}, BaseTestFixt});browsers.push(browser);const page = await browser.newPage();+ if (process.env.PWTEST_DEBUG_TRACE_VIEWER) {+ const tracing = page.context().tracing;+ await tracing.start({ snapshots: true, screenshots: true });+ tracings.push(tracing);+ }const url = cp.output.match(/Listening on (http:\/\/[^\s]+)/)![1];await page.goto(url);return new TraceViewerPage(page, cp);});+ for (const [index, tracing] of tracings.entries()) {+ const path = testInfo.outputPath(`viewer-trace-${index}.zip`);+ await tracing.stop({ path });+ await testInfo.attach(`viewer-trace-${index}.zip`, { path, contentType: 'application/zip' });+ }for (const browser of browsers)await browser.close();},@@ -190,6 +201,8 @@ export const traceViewerFixtures: Fixtures<TraceViewerFixtures, {}, BaseTestFixtawait context.tracing.start({ snapshots: true, screenshots: true, sources: true, ...optsOverrides });await body();await context.tracing.stop({ path: traceFile });+ if (process.env.PWTEST_DEBUG_TRACE_VIEWER)+ await testInfo.attach('recorded-trace.zip', { path: traceFile, contentType: 'application/zip' });return showTraceViewer(traceFile);});},diff --git a/tests/library/browsercontext-reuse.spec.ts b/tests/library/browsercontext-reuse.spec.tsindex c8457eabcc..202b423000 100644--- a/tests/library/browsercontext-reuse.spec.ts+++ b/tests/library/browsercontext-reuse.spec.ts@@ -91,6 +91,7 @@ const test = browserTest.extend<{ scenario: 'launch' | 'connect', reusedContext:for (const scenario of ['launch', 'connect'] as const) {test.describe('reuse ' + scenario, () => {test.skip(({ mode }) => mode !== 'default' && scenario === 'connect');+ test.fixme(({ channel }) => channel?.startsWith('msedge'), 'Network.clearBrowserCache sometimes stalls');test.use({ scenario });test('should re-add binding after reset', async ({ reusedContext }) => {diff --git a/tests/library/browsercontext-storage-state.spec.ts b/tests/library/browsercontext-storage-state.spec.tsindex 70b494fdfc..5715ba3683 100644--- a/tests/library/browsercontext-storage-state.spec.ts+++ b/tests/library/browsercontext-storage-state.spec.ts@@ -51,7 +51,9 @@ it('should capture local storage', async ({ contextFactory }) => {}]);});-it('should set local storage', async ({ contextFactory }) => {+it('should set local storage', async ({ contextFactory, channel }) => {+ it.fixme(channel?.startsWith('msedge'), 'Network.clearBrowserCache sometimes stalls');+const context = await contextFactory({storageState: {cookies: [],@@ -114,7 +116,9 @@ it('should report good error if the url is not valid', async ({ contextFactory }expect(error.message).toContain('foo');});-it('should round-trip through the file', async ({ contextFactory }, testInfo) => {+it('should round-trip through the file', async ({ contextFactory, channel }, testInfo) => {+ it.fixme(channel?.startsWith('msedge'), 'Network.clearBrowserCache sometimes stalls');+const context = await contextFactory();const page1 = await context.newPage();await page1.route('**/*', route => {diff --git a/tests/library/browsertype-connect.spec.ts b/tests/library/browsertype-connect.spec.tsindex 546a5ffdc4..c875b38067 100644--- a/tests/library/browsertype-connect.spec.ts+++ b/tests/library/browsertype-connect.spec.ts@@ -719,8 +719,10 @@ for (const kind of ['launchServer', 'run-server'] as const) {expect(await response.json()).toEqual({ 'foo': 'bar' });});- test('should upload large file', async ({ connect, startRemoteServer, server }, testInfo) => {- test.slow();+ test('should upload large file', async ({ connect, startRemoteServer, server, isMac }, testInfo) => {+ if (isMac)+ test.setTimeout(test.info().timeout * 3); // Extra slow!+const remoteServer = await startRemoteServer(kind);const browser = await connect(remoteServer.wsEndpoint());const context = await browser.newContext();diff --git a/tests/library/trace-viewer.spec.ts b/tests/library/trace-viewer.spec.tsindex b4e1478132..1d8b64b994 100644--- a/tests/library/trace-viewer.spec.ts+++ b/tests/library/trace-viewer.spec.ts@@ -30,6 +30,7 @@ import { parseTrace, rafraf, roundBox } from '../config/utils';const test = playwrightTest.extend<TraceViewerFixtures>(traceViewerFixtures);+// NOTE: set PWTEST_DEBUG_TRACE_VIEWER=1 to record/attach traces for these tests.test.skip(({ trace }) => trace === 'on');test.skip(({ mode }) => mode.startsWith('service'));test.skip(process.env.PW_CLOCK === 'frozen');@@ -1419,11 +1420,11 @@ test('should pick locator in iframe', async ({ page, runAndTrace, server }) => {await frameTwo.setContent(`<div>HelloNameTwo</div>`);await page.evaluate('2+2');});+ const snapshot = await traceViewer.snapshotFrame('Evaluate');+await traceViewer.page.getByTitle('Pick locator').click();const cmWrapper = traceViewer.page.locator('.cm-wrapper').first();- const snapshot = await traceViewer.snapshotFrame('Evaluate');-await snapshot.frameLocator('#frame1').getByText('Hello1').click();await expect.soft(cmWrapper).toContainText(`locator('#frame1').contentFrame().getByText('Hello1')`);