Sha256: 74981579f1b3237bb8c72c8cd1d57cefea2fb27b470b68b9e28f1c3ca15ca512

Contents?: true

Size: 728 Bytes

Versions: 1

Compression:

Stored size: 728 Bytes

Contents

module CapybaraPatched
  class Capybara::Selenium::PatchedDriver < Capybara::Selenium::Driver
    RETRY_ON = [
        ::Selenium::WebDriver::Error::UnhandledError,
        ::Selenium::WebDriver::Error::UnknownError,
        ::Selenium::WebDriver::Error::InvalidSelectorError
    ]

    # workaround for transferring correct arguments via call stack
    Capybara::Session.instance_eval do
      self::NODE_METHODS.each do |method|
        class_eval <<-RUBY
        def #{method}(*args, &block)
          retryable(tries:3, logger: log, trace: true, on: RETRY_ON) do
            @touched = true
            current_scope.send(:#{method}, *args.flatten, &block)
          end
        end
        RUBY
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
howitzer-1.0.1 lib/howitzer/utils/capybara_patched.rb