diff --git a/tests/playwright-test/expect.spec.ts b/tests/playwright-test/expect.spec.ts
index b1ed0c2a7d..d83a425e94 100644
--- a/tests/playwright-test/expect.spec.ts
+++ b/tests/playwright-test/expect.spec.ts
@@ -435,18 +435,14 @@ test('should respect expect.timeout', async ({ runInlineTest }) => {
test('timeout', async ({ page }) => {
await page.goto('data:text/html,
A
');
- await Promise.all([
- expect(page).toHaveURL('data:text/html,B
'),
- new Promise(f => setTimeout(f, 2000)).then(() => expect(true).toBe(false))
- ]);
+ const error = await expect(page).toHaveURL('data:text/html,B
').catch(e => e);
+ expect(error.message).toContain('expect.toHaveURL with timeout 1000ms');
+ expect(error.message).toContain('data:text/html,');
});
`,
}, { workers: 1 });
- const output = stripAnsi(result.output);
- expect(output).toContain('expect(received).toHaveURL(expected)');
- expect(output).toContain('expect.toHaveURL with timeout 1000ms');
- expect(result.failed).toBe(1);
- expect(result.exitCode).toBe(1);
+ expect(result.exitCode).toBe(0);
+ expect(result.passed).toBe(1);
});
test('should log scale the time', async ({ runInlineTest }) => {
diff --git a/tests/playwright-test/hooks.spec.ts b/tests/playwright-test/hooks.spec.ts
index 7ed25b4470..c1cb331ffa 100644
--- a/tests/playwright-test/hooks.spec.ts
+++ b/tests/playwright-test/hooks.spec.ts
@@ -716,14 +716,14 @@ test('test.setTimeout should work separately in beforeAll', async ({ runInlineTe
const { test } = pwt;
test.beforeAll(async () => {
console.log('\\n%%beforeAll');
- test.setTimeout(100);
+ test.setTimeout(1000);
});
test('passed', async () => {
console.log('\\n%%test');
- await new Promise(f => setTimeout(f, 500));
+ await new Promise(f => setTimeout(f, 2000));
});
`,
- }, { timeout: 2000 });
+ }, { timeout: 3000 });
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
expect(result.output.split('\n').filter(line => line.startsWith('%%'))).toEqual([