Module: Actir::Webdriver::Devices

Included in:
Driver
Defined in:
lib/actir/webdriver/devices.rb

Instance Method Summary collapse

Instance Method Details

#agent_string_for(device) ⇒ Object



16
17
18
19
20
21
# File 'lib/actir/webdriver/devices.rb', line 16

def agent_string_for(device)
  device = (device ? device.downcase : :iphone)
  user_agent_string = devices[device][:user_agent]
  raise "Unsupported user agent: '#{device}'." unless user_agent_string
  user_agent_string
end

#devicesObject



7
8
9
# File 'lib/actir/webdriver/devices.rb', line 7

def devices
  Actir::Config.get_content(config_file)
end

#resolution_for(device_name, orientation) ⇒ Object



11
12
13
14
# File 'lib/actir/webdriver/devices.rb', line 11

def resolution_for(device_name, orientation)
  device = devices[device_name.downcase][orientation.downcase]
  [device[:width],device[:height]]
end