Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: improve a few test runner tests that time out (#15287)

Dmitry Gozmandc1d8dc3da1b
diff --git a/tests/playwright-test/playwright.artifacts.spec.ts b/tests/playwright-test/playwright.artifacts.spec.ts
index 0f04f258a2..c9e1a34f01 100644
--- a/tests/playwright-test/playwright.artifacts.spec.ts
+++ b/tests/playwright-test/playwright.artifacts.spec.ts
@@ -122,6 +122,8 @@ const testFiles = {
`,
};
+test.slow(true, 'Multiple browser launches in each test');
+
test('should work with screenshot: on', async ({ runInlineTest }, testInfo) => {
const result = await runInlineTest({
...testFiles,
diff --git a/tests/playwright-test/playwright.spec.ts b/tests/playwright-test/playwright.spec.ts
index b2489e49b6..1acf067275 100644
--- a/tests/playwright-test/playwright.spec.ts
+++ b/tests/playwright-test/playwright.spec.ts
@@ -67,8 +67,7 @@ test('should run in three browsers with --browser', async ({ runInlineTest }) =>
`,
'a.test.ts': `
const { test } = pwt;
- test('pass', async ({ page, browserName }) => {
- expect(page.viewportSize()).toEqual({ width: 800, height: 800 });
+ test('pass', async ({ browserName }) => {
console.log('\\n%%browser=' + browserName);
});
`,
@@ -90,8 +89,7 @@ test('should run in one browser with --browser', async ({ runInlineTest }) => {
`,
'a.test.ts': `
const { test } = pwt;
- test('pass', async ({ page, browserName }) => {
- expect(page.viewportSize()).toEqual({ width: 800, height: 800 });
+ test('pass', async ({ browserName }) => {
console.log('\\n%%browser=' + browserName);
});
`,
@@ -406,7 +404,7 @@ test('should not report waitForEventInfo as pending', async ({ runInlineTest },
await page.click('text=Missing');
});
`,
- }, { workers: 1, timeout: 2000 });
+ }, { workers: 1, timeout: 5000 });
expect(result.exitCode).toBe(1);
expect(result.passed).toBe(0);