class Superbot::Local::CLI::EasyModeCommand

Public Instance Methods

execute() click to toggle source
# File lib/superbot/local/cli/easy_mode_command.rb, line 9
def execute
  puts "Press [control+c] to exit"
  open_step_editor
  chromedriver_path = Chromedriver::Helper.new.binary_path
  @chromedriver = Kommando.run_async "#{chromedriver_path} --silent --port=9515 --url-base=/wd/hub"
  @web = Superbot::Web.run!(webdriver_type: 'local')
ensure
  close_step_editor
end

Private Instance Methods

close_step_editor() click to toggle source
# File lib/superbot/local/cli/easy_mode_command.rb, line 28
def close_step_editor
  @chromedriver&.kill
  @step_editor&.quit
  @web&.quit!
end
open_step_editor() click to toggle source
# File lib/superbot/local/cli/easy_mode_command.rb, line 21
def open_step_editor
  options = ::Selenium::WebDriver::Chrome::Options.new
  options.add_argument("app=#{Superbot::Local.step_editor_url}")
  options.add_argument('no-sandbox')
  @step_editor = ::Selenium::WebDriver.for :chrome, options: options
end