class Juxtapose::AppiumStrategy

Attributes

context[RW]
project_root[RW]

Public Class Methods

new(context) click to toggle source
# File lib/juxtapose/strategy/appium_strategy.rb, line 9
def initialize(context)
  self.context = context
end
setup() click to toggle source
# File lib/juxtapose/strategy/appium_strategy.rb, line 5
def self.setup
  Cucumber::RbSupport::RbDsl.register_rb_hook('before', [], Proc.new {|scenario, block| @__scenario = scenario })
end

Public Instance Methods

current_spec_description() click to toggle source
# File lib/juxtapose/strategy/appium_strategy.rb, line 25
def current_spec_description
  context.instance_variable_get('@__scenario').name
end
device_name() click to toggle source
# File lib/juxtapose/strategy/appium_strategy.rb, line 17
def device_name
  context.driver_attributes[:caps][:deviceName].gsub(" ","-").downcase
end
save_current(filename) click to toggle source
# File lib/juxtapose/strategy/appium_strategy.rb, line 29
def save_current(filename)
  context.screenshot(filename)
end
spec_dir() click to toggle source
# File lib/juxtapose/strategy/appium_strategy.rb, line 13
def spec_dir
  "features/screens"
end
version() click to toggle source
# File lib/juxtapose/strategy/appium_strategy.rb, line 21
def version
  context.driver_attributes[:caps][:platformVersion]
end