Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
False positives on checkbox click (includes test case) #280
We are seeing intermittent failures when trying to click a checkbox. Symptoms sound very similar to #120 - Capybara/Poltergeist acts like the click was successful, but it seemed to have clicked in the wrong spot. In our case we have a form that has options shown/hidden (no animations, just hide/show) depending on other choices, and it seems like there's some sort of a race condition where, intermittently, Poltergeist just misses the checkbox.
Put together a gist that seems to reproduce the problem. Generally fails within the first 10 iterations for me, often even earlier, but it seems to be a timing thing so you might have to play with the delays a bit.
This is using master of capybara/xpath as well as master of poltergeist.
The same gist passes without issue when using either selenium or webkit, so it feels like a poltergeist-specific issue.
This sounds 100% related to #286
I encountered a similar issue with checkboxes whose y-positions were changed very close to the time when the click occurred. One of these could possibly be closed as a duplicate, with the relevant examples carried over.
In my case, using
This would seem to be a duplicate of #286 so I'm going to close this one - as a potential solution - rather than switching to trigger(:click) when you know your checkboxes will hide rows you can use
This will have the effect of testing that your rows do hide as you expect, and also making the test wait until the page is stable to click the next checkbox