Top Level Namespace

Defined Under Namespace

Modules: ActionController, 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



156
157
158
159
160
161
162
# File 'lib/spree/testing_support/capybara_ext.rb', line 156

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