Class: Juxtapose::AppiumStrategy
- Inherits:
-
Object
- Object
- Juxtapose::AppiumStrategy
- Defined in:
- lib/juxtapose/strategy/appium_strategy.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#project_root ⇒ Object
Returns the value of attribute project_root.
Class Method Summary collapse
Instance Method Summary collapse
- #current_spec_description ⇒ Object
- #device_name ⇒ Object
-
#initialize(context) ⇒ AppiumStrategy
constructor
A new instance of AppiumStrategy.
- #save_current(filename) ⇒ Object
- #spec_dir ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(context) ⇒ AppiumStrategy
Returns a new instance of AppiumStrategy.
9 10 11 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 9 def initialize(context) self.context = context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
3 4 5 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 3 def context @context end |
#project_root ⇒ Object
Returns the value of attribute project_root.
4 5 6 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 4 def project_root @project_root end |
Class Method Details
.setup ⇒ Object
5 6 7 |
# 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 |
Instance Method Details
#current_spec_description ⇒ Object
25 26 27 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 25 def current_spec_description context.instance_variable_get('@__scenario').name end |
#device_name ⇒ Object
17 18 19 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 17 def device_name context.driver_attributes[:caps][:deviceName].gsub(" ","-").downcase end |
#save_current(filename) ⇒ Object
29 30 31 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 29 def save_current(filename) context.screenshot(filename) end |
#spec_dir ⇒ Object
13 14 15 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 13 def spec_dir "features/screens" end |
#version ⇒ Object
21 22 23 |
# File 'lib/juxtapose/strategy/appium_strategy.rb', line 21 def version context.driver_attributes[:caps][:platformVersion] end |