You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to monkey patch document.hasFocus() so that it always returns the value of top.document.hasFocus() since a parent frame will always have the same focus as a child frame, which replicates a focused document outside of Cypress.
The text was updated successfully, but these errors were encountered:
this prevents situations where there are differences between running
within Cypress vs out of Cypress. normally the AUT is top and hasFocus
will return true, but in Cypress the AUT iframe has to literally be in
direct focus else it will return false.
hasFocus effectively “bubbles” when in iframes so children iframes in
focus cause their parents to receive the same value
This code fails even when
top
(Cypress) is in focus.We need to monkey patch
document.hasFocus()
so that it always returns the value oftop.document.hasFocus()
since a parent frame will always have the same focus as a child frame, which replicates a focused document outside of Cypress.The text was updated successfully, but these errors were encountered: