Module: Vapir::WatirConfigCompatibility::Speed

Defined in:
lib/vapir-common/browser.rb

Instance Method Summary collapse

Instance Method Details

#set_fast_speedObject



227
228
229
230
231
232
233
234
235
# File 'lib/vapir-common/browser.rb', line 227

def set_fast_speed
  if self==Vapir::Browser
    return browser_class.set_fast_speed
  end
  if config.warn_deprecated
    Kernel.warn_with_caller "WARNING: #set_fast_speed is deprecated; please use the new config framework with config.typing_interval= and config.type_keys="
  end
  self.speed= :fast
end

#set_slow_speedObject



218
219
220
221
222
223
224
225
226
# File 'lib/vapir-common/browser.rb', line 218

def set_slow_speed
  if self==Vapir::Browser
    return browser_class.set_slow_speed
  end
  if config.warn_deprecated
    Kernel.warn_with_caller "WARNING: #set_slow_speed is deprecated; please use the new config framework with config.typing_interval= and config.type_keys="
  end
  self.speed= :slow
end

#speedObject



191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/vapir-common/browser.rb', line 191

def speed
  if self==Vapir::Browser
    return browser_class.speed
  end
  if config.warn_deprecated
    Kernel.warn_with_caller "WARNING: #speed is deprecated; please use the new config framework with config.typing_interval and config.type_keys"
  end
  Speeds.keys.detect do |speed_key|
    Speeds[speed_key].all? do |config_key, value|
      config[config_key] == value
    end
  end || :other
end

#speed=(speed_key) ⇒ Object



204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/vapir-common/browser.rb', line 204

def speed=(speed_key)
  if self==Vapir::Browser
    return browser_class.speed=speed_key
  end
  if config.warn_deprecated
    Kernel.warn_with_caller "WARNING: #speed= is deprecated; please use the new config framework with config.typing_interval= and config.type_keys="
  end
  unless Speeds.key?(speed_key)
    raise ArgumentError, "Invalid speed: #{speed_key}. expected #{Speeds.keys.map{|k| k.inspect }.join(', ')}"
  end
  Speeds[speed_key].each do |config_key, value|
    config[config_key]=value
  end
end