Until now, those tests failed if the window did not have the focus. We solve the issue with 2 different fixes: * instead of checking that the focus property is set, we can check the activeElement instead, it seems to work. * instead of calling the focus method, in some tests, we can trigger a * 'focusin' event. I don't know why this works, but it does. Note that this might make the tests work in phantomjs