Class: UtilityCommands

Inherits:
Thor
  • Object
show all
Defined in:
lib/commands/utility_commands.rb

Overview

:reek:FeatureEnvy { enabled: false } :reek:UtilityFunction { enabled: false }

Instance Method Summary collapse

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
  selected_options = options[:opts]
  browser_options(selected_options) if selected_options || options[:delete]
end

#browser_options(*opts) ⇒ Object



44
45
46
47
# File 'lib/commands/utility_commands.rb', line 44

def browser_options(*opts)
  Utilities.browser_options = opts unless opts.empty?
  Utilities.delete_browser_options if options[:delete]
end

#path(default_path) ⇒ Object



17
18
19
20
# File 'lib/commands/utility_commands.rb', line 17

def path(default_path)
  type = options.empty? ? 'page' : options.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

#raidObject



55
56
57
58
59
60
61
62
# File 'lib/commands/utility_commands.rb', line 55

def raid
  selected_options = options[:opts]
  if options[:parallel]
    Utilities.parallel_run(selected_options)
  else
    Utilities.run(selected_options)
  end
end

#start_appiumObject



77
78
79
# File 'lib/commands/utility_commands.rb', line 77

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