Helps
“We are using
page.driver.browser.switch_to.alert.acceptin our cucumber steps in order to accept a JavaScript alert box. This appears to have an effect on the browser’s behavior afterward, causing future scenarios to fail when they pass on their own. We’re seeing timing issues, specifically around when the blur event is called when an input field loses focus. We didn’t manage to find the root cause. Any ideas?”
- Sounds intense! No answers, though.
Interestings
It’s not possible to stub a delegated method; stub it on the object
delegated to instead.In order to get an accurate number of days since the epoch, do this:
(Time.now.to_f / 60 / 60 / 24).round. The key here is theto_f
instead ofto_ito prevent losing precision early on.