cherry-pick(#32714): fix(test runner): page.pause() should enable debug mode (#32722)

Fixes #32706.
This commit is contained in:
Dmitry Gozman 2024-09-20 03:21:38 -07:00 committed by GitHub
parent 937424fb59
commit f96b487030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View file

@ -60,6 +60,8 @@ export class TimeoutManager {
setIgnoreTimeouts() {
this._ignoreTimeouts = true;
if (this._running)
this._updateTimeout(this._running);
}
interrupt() {

View file

@ -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!');
});