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".
This commit is contained in:
Dmitry Gozman 2024-05-23 17:40:39 -07:00 committed by GitHub
parent ae1e07de10
commit c906448fe2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;