Please sign in to comment.
Add a best-effort retry to the Cucumber Around('@selenium') hook to m…
…itigate Selenium UnknownError exceptions This took a while, is ugly as sin, and will cause your nose to bleed if you look at it too long. The basic gist of how/why we have to do these things is: * Cucumber::AST::Scenario, Step and StepCollection don't like to be run multiple times. In order to acheive a "sane" retry we need to re-initialize the Scenario on each retry in order to instantiate new underlying Step/StepCollection/StepInvocation objects * Exceptions are actually swallowed up by the Cucumber::AST::Scenario in order to be reported properly later, so we must fish the exception out of the Scenario in order to tell if we need to retry * Selenium::WebDriver aliases UnhandledError to UnknownError, which fubars any ability to run `e.is_a? Selenium::WebDriver::Errors::UnhandledError`. That said, I think we might find other retryable errors in the future so this forced the approach used to be extendable. I know more than I ever wanted to know about Cucumber::Ast thanks to this bug Fixes #62
- Loading branch information...
Showing with 54 additions and 1 deletion.