Top Level Namespace

Defined Under Namespace

Modules: CapybaraExt, FriendlyId, Spree Classes: BarAbility, DbMaximumLengthValidator, EmailValidator, OrderWalkthrough

Constant Summary collapse

DB_EXCEPTIONS =
if defined? PG
  [PG::ConnectionBad, ActiveRecord::NoDatabaseError]
elsif defined? Mysql2
  [Mysql2::Error::ConnectionError, ActiveRecord::NoDatabaseError]
else
  [ActiveRecord::ConnectionNotEstablished, ActiveRecord::NoDatabaseError]
end

Instance Method Summary collapse

Instance Method Details

#wait_for(options = {}) ⇒ Object



103
104
105
106
107
108
109
# File 'lib/spree/testing_support/capybara_ext.rb', line 103

def wait_for(options = {})
  default_options = { error: nil, seconds: 5 }.merge(options)

  Selenium::WebDriver::Wait.new(timeout: default_options[:seconds]).until { yield }
rescue Selenium::WebDriver::Error::TimeOutError
  default_options[:error].nil? ? false : raise(default_options[:error])
end