Class: UtilityCommands
- Inherits:
-
Thor
- Object
- Thor
- UtilityCommands
- Defined in:
- lib/commands/utility_commands.rb
Overview
:reek:FeatureEnvy { enabled: false } :reek:UtilityFunction { enabled: false }
Instance Method Summary collapse
- #browser(default_browser = nil) ⇒ Object
- #browser_options(*opts) ⇒ Object
- #build(build_type) ⇒ Object
- #builds ⇒ Object
- #path(default_path) ⇒ Object
- #platform(platform) ⇒ Object
- #raid ⇒ Object
- #start_appium ⇒ Object
- #url(default_url) ⇒ Object
Instance Method Details
#browser(default_browser = nil) ⇒ Object
34 35 36 37 38 |
# File 'lib/commands/utility_commands.rb', line 34 def browser(default_browser = nil) Utilities.browser = default_browser if default_browser = [:opts] () if || [:delete] end |
#browser_options(*opts) ⇒ Object
44 45 46 47 |
# File 'lib/commands/utility_commands.rb', line 44 def (*opts) Utilities. = opts unless opts.empty? Utilities. if [:delete] end |
#build(build_type) ⇒ Object
78 79 80 81 82 |
# File 'lib/commands/utility_commands.rb', line 78 def build(build_type) raise 'Please select one of the following build types: android, ios' unless %w[android ios].include?(build_type) build_type == 'android' ? Utilities.download_android_build : Utilities.download_ios_build end |
#builds ⇒ Object
86 87 88 89 |
# File 'lib/commands/utility_commands.rb', line 86 def builds Utilities.download_android_build Utilities.download_ios_build end |
#path(default_path) ⇒ Object
17 18 19 20 |
# File 'lib/commands/utility_commands.rb', line 17 def path(default_path) type = .empty? ? 'page' : .keys.first Utilities.send("#{type}_path=", default_path) end |
#platform(platform) ⇒ Object
72 73 74 |
# File 'lib/commands/utility_commands.rb', line 72 def platform(platform) Utilities.platform = platform end |
#raid ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/commands/utility_commands.rb', line 55 def raid = [:opts] if [:parallel] Utilities.parallel_run() else Utilities.run() end end |
#start_appium ⇒ Object
92 93 94 |
# File 'lib/commands/utility_commands.rb', line 92 def start_appium system 'appium --base-path /wd/hub' end |
#url(default_url) ⇒ Object
24 25 26 |
# File 'lib/commands/utility_commands.rb', line 24 def url(default_url) Utilities.url = default_url end |