chore: fix inspector cli firefox tests flakiness (#20919)
This commit is contained in:
parent
91da67fab1
commit
5f9e2f3db9
|
|
@ -252,6 +252,10 @@ class Recorder {
|
||||||
if (this._mode === 'none')
|
if (this._mode === 'none')
|
||||||
return;
|
return;
|
||||||
const activeElement = this._deepActiveElement(document);
|
const activeElement = this._deepActiveElement(document);
|
||||||
|
// Firefox dispatches "focus" event to body when clicking on a backgrounded headed browser window.
|
||||||
|
// We'd like to ignore this stray event.
|
||||||
|
if (activeElement === document.body)
|
||||||
|
return;
|
||||||
const result = activeElement ? generateSelector(this._injectedScript, activeElement, this._testIdAttributeName) : null;
|
const result = activeElement ? generateSelector(this._injectedScript, activeElement, this._testIdAttributeName) : null;
|
||||||
this._activeModel = result && result.selector ? result : null;
|
this._activeModel = result && result.selector ? result : null;
|
||||||
if (userGesture)
|
if (userGesture)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue