Skip to content

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

chore: ignore timeout for debugged action (#38507)

Simon Knott1d189f80cec0
diff --git a/packages/playwright-core/src/server/progress.ts b/packages/playwright-core/src/server/progress.ts
index 56b10b865b..e80a1404e8 100644
--- a/packages/playwright-core/src/server/progress.ts
+++ b/packages/playwright-core/src/server/progress.ts
@@ -74,6 +74,8 @@ export class ProgressController {
if (timeout) {
const timeoutError = new TimeoutError(`Timeout ${timeout}ms exceeded.`);
timer = setTimeout(() => {
+ if (this.metadata.pauseStartTime && !this.metadata.pauseEndTime)
+ return;
if (this._state === 'running') {
(timeoutError as any)[kAbortErrorSymbol] = true;
this._state = { error: timeoutError };
diff --git a/tests/library/inspector/pause.spec.ts b/tests/library/inspector/pause.spec.ts
index e34fb7005a..9ab018f8df 100644
--- a/tests/library/inspector/pause.spec.ts
+++ b/tests/library/inspector/pause.spec.ts
@@ -169,6 +169,25 @@ it.describe('pause', () => {
await scriptPromise;
});
+ it('should disable timeout on paused actions', async ({ page, recorderPageGetter }) => {
+ await page.setContent('<button>Submit</button>');
+ const scriptPromise = (async () => {
+ // @ts-ignore
+ await page.pause({ __testHookKeepTestTimeout: true });
+ await page.click('button', { timeout: 200 });
+ })();
+ const recorderPage = await recorderPageGetter();
+ const source = await recorderPage.textContent('.source-line-paused');
+ expect(source).toContain('page.pause({ __testHookKeepTestTimeout: true });');
+
+ await recorderPage.click('[title="Step over (F10)"]');
+ await recorderPage.waitForSelector('.source-line-paused :has-text("page.click")');
+ await page.waitForTimeout(500);
+
+ await recorderPage.click('[title="Resume (F8)"]');
+ await scriptPromise;
+ });
+
it('should step with keyboard shortcut', async ({ page, recorderPageGetter }) => {
await page.setContent('<button>Submit</button>');
const scriptPromise = (async () => {