Class: Superbot::CLI::TeleportCommand

Inherits:
Clamp::Command
  • Object
show all
Includes:
Validations
Defined in:
lib/superbot/cli/teleport_command.rb

Instance Method Summary collapse

Methods included from Validations

#validates_browser_type, #validates_project_path

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/superbot/cli/teleport_command.rb', line 15

def execute
  @web = Superbot::Web.new(
    webdriver_type: browser,
    auth_user: auth_user,
    auth_password: auth_password
  ).tap(&:run_async_after_running!)

  @chromedriver = Kommando.run_async 'chromedriver --silent --port=9515' if browser == 'local'
  puts "", "🤖 Teleport is active ☁️ "

  $stdin.gets
rescue
  @chromedriver&.kill
  @web&.quit!
ensure
  @chromedriver&.kill
  @web&.quit!
end