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: gardening (#21814)
Dmitry Gozman8accabdb5929
diff --git a/tests/library/har.spec.ts b/tests/library/har.spec.tsindex 0a0e911f68..23296d2a25 100644--- a/tests/library/har.spec.ts+++ b/tests/library/har.spec.ts@@ -661,7 +661,7 @@ it('should return security details directly from response', async ({ contextFactconst response = await page.goto(httpsServer.EMPTY_PAGE);const securityDetails = await response.securityDetails();if (browserName === 'webkit' && platform === 'win32')- expect(securityDetails).toEqual({ subjectName: 'puppeteer-tests', validFrom: 1550084863, validTo: -1 });+ expect({ ...securityDetails, protocol: undefined }).toEqual({ subjectName: 'puppeteer-tests', validFrom: 1550084863, validTo: -1 });else if (browserName === 'webkit')expect(securityDetails).toEqual({ protocol: 'TLS 1.3', subjectName: 'puppeteer-tests', validFrom: 1550084863, validTo: 33086084863 });elsediff --git a/tests/page/page-event-crash.spec.ts b/tests/library/page-event-crash.spec.tssimilarity index 100%rename from tests/page/page-event-crash.spec.tsrename to tests/library/page-event-crash.spec.tsdiff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.tsindex 1e73aac3ec..c3d44e6383 100644--- a/tests/library/tracing.spec.ts+++ b/tests/library/tracing.spec.ts@@ -430,7 +430,7 @@ test('should work with multiple chunks', async ({ context, page, server }, testIawait context.tracing.startChunk();await page.setContent('<button>Click</button>');await page.click('"Click"');- page.click('"ClickNoButton"').catch(() => {});+ page.click('"ClickNoButton"', { timeout: 0 }).catch(() => {});await context.tracing.stopChunk({ path: testInfo.outputPath('trace.zip') });await context.tracing.startChunk();diff --git a/tests/page/page-goto.spec.ts b/tests/page/page-goto.spec.tsindex c8df12e90d..5188721562 100644--- a/tests/page/page-goto.spec.ts+++ b/tests/page/page-goto.spec.ts@@ -419,8 +419,10 @@ it('should fail when replaced by another navigation', async ({ page, server, bro}});-it('js redirect overrides url bar navigation ', async ({ page, server, browserName }) => {- it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21574' });+it('js redirect overrides url bar navigation ', async ({ page, server, browserName, trace }) => {+ it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/20749' });+ it.skip(trace === 'on', 'tracing waits for snapshot that never arrives because pending navigation');+server.setRoute('/a', (req, res) => {res.writeHead(200, { 'content-type': 'text/html' });res.end(`diff --git a/tests/playwright-test/expect.spec.ts b/tests/playwright-test/expect.spec.tsindex 34c2aec8c8..61fcdf50d2 100644--- a/tests/playwright-test/expect.spec.ts+++ b/tests/playwright-test/expect.spec.ts@@ -106,34 +106,6 @@ test('should include custom error message with web-first assertions', async ({ r].join('\n'));});-test('should work with default expect prototype functions', async ({ runTSC, runInlineTest }) => {- const spec = `- import { test, expect } from '@playwright/test';- test('pass', async () => {- const expected = [1, 2, 3, 4, 5, 6];- test.expect([4, 1, 6, 7, 3, 5, 2, 5, 4, 6]).toEqual(- expect.arrayContaining(expected),- );- expect('foo').toEqual(expect.any(String));- expect('foo').toEqual(expect.anything());- expect('hello world').toEqual(expect.not.stringContaining('text'));- });- `;- {- const result = await runTSC({- 'a.spec.ts': spec,- });- expect(result.exitCode).toBe(0);- }- {- const result = await runInlineTest({- 'a.spec.ts': spec,- });- expect(result.exitCode).toBe(0);- expect(result.passed).toBe(1);- }-});-test('should work with generic matchers', async ({ runTSC }) => {const result = await runTSC({'a.spec.ts': `@@ -173,6 +145,7 @@ test('should work with generic matchers', async ({ runTSC }) => {y: expect.any(Number),}));expect('abc').toEqual(expect.stringContaining('bc'));+ expect('hello world').toEqual(expect.not.stringContaining('text'));expect(['Alicia', 'Roberto', 'Evelina']).toEqual(expect.arrayContaining([expect.stringMatching(/^Alic/),