Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockInteractions tap() does not work when window is not focused. #48

Open
btolsch opened this issue Mar 3, 2016 · 1 comment
Open

Comments

@btolsch
Copy link

btolsch commented Mar 3, 2016

Normally, the following works fine when our tests spawn a browser window and nothing causes the window to lose focus.

MockInteractions.tap(checkboxElement);

Afterwards, checkboxElement.checked has successfully changed state. However, if something causes the test window to lose focus, checkboxElement.checked will be unchanged after the tap().

@valdrinkoshi
Copy link
Member

You could use document.hasFocus() to verify that https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus
Something similar was happening to me in Firefox, where the focus stayed on the searchbar; I got the focus back to the document using window.focus().
I don't think this is a problem that the tap method can/should solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants