Module: Cukunity::PlatformHelpers
- Extended by:
- Forwardable
- Defined in:
- lib/cukunity/cucumber/support/platform_helpers.rb
Class Method Summary collapse
Instance Method Summary collapse
- #app ⇒ Object
- #current_app ⇒ Object
- #current_app=(path) ⇒ Object
- #keyboard ⇒ Object
- #platform_defined? ⇒ Boolean
- #process ⇒ Object
- #set_current_app(path) ⇒ Object
- #touch ⇒ Object
Class Method Details
.__tags__=(tags) ⇒ Object
72 73 74 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 72 def self.() @@__tags__ = end |
Instance Method Details
#app ⇒ Object
52 53 54 55 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 52 def app raise Exception::UnspecifiedPlatform.new if @platform.nil? @platform::App end |
#current_app ⇒ Object
18 19 20 21 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 18 def current_app raise Exception::InvalidApp.new if @current_app.nil? @current_app end |
#current_app=(path) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 23 def current_app=(path) case File.extname(path).downcase when '.app' set_current_app_ios(path) when '.apk' set_current_app_android(path) else # @ios is defined as a tag? = @@__tags__ if .include?('@ios') or .include?('@~android') path = set_current_app_ios("#{path}.app") # @android is defined as a tag? elsif .include?('@android') or .include?('@~ios') path = set_current_app_android("#{path}.apk") else raise Exception::InvalidApp.new(path) end end @current_app = path end |
#keyboard ⇒ Object
67 68 69 70 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 67 def keyboard raise Exception::UnspecifiedPlatform.new if @platform.nil? @platform::KeyboardInput end |
#platform_defined? ⇒ Boolean
48 49 50 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 48 def platform_defined? not @platform.nil? end |
#process ⇒ Object
57 58 59 60 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 57 def process raise Exception::UnspecifiedPlatform.new if @platform.nil? @platform::Process end |
#set_current_app(path) ⇒ Object
44 45 46 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 44 def set_current_app(path) self.current_app = path end |
#touch ⇒ Object
62 63 64 65 |
# File 'lib/cukunity/cucumber/support/platform_helpers.rb', line 62 def touch raise Exception::UnspecifiedPlatform.new if @platform.nil? @platform::TouchInput end |