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
{{ message }}
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
I've been debugging some sporadic spec failures today, where it seems that Poltergeist tries to click the wrong place in the page. Therefore it misses the button I'm trying to click, and my spec fails because the form is never submitted.
We use web fonts in our project. In this case, it seems that what is happening is that since I'm clicking a button very soon after the page has loaded, sometimes Poltergeist computes the click position before the web fonts have loaded but the click itself happens after the web fonts have loaded. And the web fonts cause the page to re-render, so everything moves around a bit. This can cause the click to fall in the wrong place.
More generally, it seems problematic that the page can change between when Poltergeist measures the click position and when it executes the click. Ideally there would be some way to freeze the page, but I don't know if that is at all possible.
For now, I have managed to work around the issue by checking for document.readyState == "complete" on each page load. This may be the next best thing for Poltergeist to implement if freezing the page is infeasible.
The text was updated successfully, but these errors were encountered:
Unfortunately the way phantomjs works there is no way to freeze the page (it's the same issue that can happen with animated items on the page). Poltergeist calculates the position and then issues the click event at the right position at that moment in time. Unfortunately that event gets added to a queue, in which anything else can happen first, but poltergeist has no access to know what else is happening.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've been debugging some sporadic spec failures today, where it seems that Poltergeist tries to click the wrong place in the page. Therefore it misses the button I'm trying to click, and my spec fails because the form is never submitted.
We use web fonts in our project. In this case, it seems that what is happening is that since I'm clicking a button very soon after the page has loaded, sometimes Poltergeist computes the click position before the web fonts have loaded but the click itself happens after the web fonts have loaded. And the web fonts cause the page to re-render, so everything moves around a bit. This can cause the click to fall in the wrong place.
More generally, it seems problematic that the page can change between when Poltergeist measures the click position and when it executes the click. Ideally there would be some way to freeze the page, but I don't know if that is at all possible.
For now, I have managed to work around the issue by checking for
document.readyState == "complete"
on each page load. This may be the next best thing for Poltergeist to implement if freezing the page is infeasible.The text was updated successfully, but these errors were encountered: