From c906448fe2f190911f041143f74b1c40472cb825 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 23 May 2024 17:40:39 -0700 Subject: [PATCH] fix(recorder): do not ignore signals except for navigation (#30994) When a signal arrives late enough, after the last action was committed in 5 seconds, we should still account for it. This includes downloads, popups and dialogs, but not navigations. Exposed by a flaky test "should record open in a new tab with url". --- packages/playwright-core/src/server/recorder/codeGenerator.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/src/server/recorder/codeGenerator.ts b/packages/playwright-core/src/server/recorder/codeGenerator.ts index ac102e1d34..d3bb5f86d9 100644 --- a/packages/playwright-core/src/server/recorder/codeGenerator.ts +++ b/packages/playwright-core/src/server/recorder/codeGenerator.ts @@ -130,7 +130,8 @@ export class CodeGenerator extends EventEmitter { this._currentAction.action.signals.push(signal); return; } - if (this._lastAction && !this._lastAction.committed) { + + if (this._lastAction && (!this._lastAction.committed || signal.name !== 'navigation')) { const signals = this._lastAction.action.signals; if (signal.name === 'navigation' && signals.length && signals[signals.length - 1].name === 'download') return;