Sha256: 090e23498e45869c2c2adfbf099b6e2ba3aeab6bd60b7e49c65db6e0c3deefd2

Contents?: true

Size: 775 Bytes

Versions: 16

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

require ::File.expand_path("../util/configuration", File.dirname(__FILE__))
require ::File.expand_path("finder_diagnostics", File.dirname(__FILE__))

require "active_support/concern"

module Cornucopia
  module Capybara
    module Synchronizable
      extend ActiveSupport::Concern

      # This function uses Capybara's synchronize function to evaluate a block until
      # it becomes true.
      def synchronize_test(seconds = nil, options = {}, &block)
        seconds ||= ::Capybara.respond_to?(:default_max_wait_time) ? ::Capybara.default_max_wait_time : ::Capybara.default_wait_time

        document.synchronize(seconds, options) do
          raise ::Capybara::ElementNotFound unless block.yield
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cornucopia-0.1.56 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.55 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.54 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.53 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.52 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.51 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.50 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.49 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.48 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.47 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.46 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.45 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.44 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.43 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.42 lib/cornucopia/capybara/synchronizable.rb
cornucopia-0.1.41 lib/cornucopia/capybara/synchronizable.rb