Skip to content

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

chore: make recorder tests pass in frozen mode (#32645)

Pavel Feldman47713e8a66eb
diff --git a/packages/playwright-core/src/server/injected/recorder/recorder.ts b/packages/playwright-core/src/server/injected/recorder/recorder.ts
index 48639fefc8..3ad40d53e2 100644
--- a/packages/playwright-core/src/server/injected/recorder/recorder.ts
+++ b/packages/playwright-core/src/server/injected/recorder/recorder.ts
@@ -211,7 +211,7 @@ class RecordActionTool implements RecorderTool {
private _hoveredElement: HTMLElement | null = null;
private _activeModel: HighlightModel | null = null;
private _expectProgrammaticKeyUp = false;
- private _pendingClickAction: { action: actions.ClickAction, timeout: NodeJS.Timeout } | undefined;
+ private _pendingClickAction: { action: actions.ClickAction, timeout: number } | undefined;
constructor(recorder: Recorder) {
this._recorder = recorder;
@@ -268,7 +268,7 @@ class RecordActionTool implements RecorderTool {
modifiers: modifiersForEvent(event),
clickCount: event.detail
},
- timeout: setTimeout(() => this._commitPendingClickAction(), 200)
+ timeout: this._recorder.injectedScript.builtinSetTimeout(() => this._commitPendingClickAction(), 200)
};
}
}