Skip to content

Commit

Permalink
fix(test runner): page.pause() should enable debug mode (#32714)
Browse files Browse the repository at this point in the history
Fixes #32706.
  • Loading branch information
dgozman authored Sep 20, 2024
1 parent 935aa6b commit ace8cb2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/playwright/src/worker/timeoutManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export class TimeoutManager {

setIgnoreTimeouts() {
this._ignoreTimeouts = true;
if (this._running)
this._updateTimeout(this._running);
}

interrupt() {
Expand Down
22 changes: 22 additions & 0 deletions tests/playwright-test/playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
});

0 comments on commit ace8cb2

Please sign in to comment.