Skip to content

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

fix(test runner): page.pause() should enable debug mode (#32714)

Dmitry Gozmanace8cb2427d7
diff --git a/packages/playwright/src/worker/timeoutManager.ts b/packages/playwright/src/worker/timeoutManager.ts
index 71b853c463..ef7665a650 100644
--- a/packages/playwright/src/worker/timeoutManager.ts
+++ b/packages/playwright/src/worker/timeoutManager.ts
@@ -60,6 +60,8 @@ export class TimeoutManager {
setIgnoreTimeouts() {
this._ignoreTimeouts = true;
+ if (this._running)
+ this._updateTimeout(this._running);
}
interrupt() {
diff --git a/tests/playwright-test/playwright.spec.ts b/tests/playwright-test/playwright.spec.ts
index faaa069950..8cd83c40b1 100644
--- a/tests/playwright-test/playwright.spec.ts
+++ b/tests/playwright-test/playwright.spec.ts
@@ -872,3 +872,25 @@ test('should allow dynamic import in evaluate', async ({ runInlineTest, server }
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
});
+
+test('page.pause() should disable test timeout', async ({ runInlineTest }) => {
+ const result = await runInlineTest({
+ 'a.test.ts': `
+ import { test, expect } from '@playwright/test';
+
+ test('test', async ({ page }) => {
+ test.setTimeout(2000);
+
+ await Promise.race([
+ page.pause(),
+ new Promise(f => setTimeout(f, 3000)),
+ ]);
+
+ console.log('success!');
+ });
+ `,
+ }, { headed: true });
+ expect(result.exitCode).toBe(0);
+ expect(result.passed).toBe(1);
+ expect(result.output).toContain('success!');
+});