Class: Superbot::Cloud::CLI::Schedule::CreateCommand

Inherits:
BaseCommand show all
Defined in:
lib/superbot/cloud/cli/schedule/create_command.rb

Instance Method Summary collapse

Methods inherited from LoginRequiredCommand

#run, run

Methods included from Validations

#require_login

Instance Method Details

#executeObject



17
18
19
# File 'lib/superbot/cloud/cli/schedule/create_command.rb', line 17

def execute
  schedule_test
end

#schedule_paramsObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/superbot/cloud/cli/schedule/create_command.rb', line 26

def schedule_params
  {
    test_name: name,
    region: region,
    organization_name: organization,
    parallel: bots,
    bots_delay: bots_delay,
    starts_at: starts_at,
    loop: loop_count,
    webdriver_api: !local_webdriver?,
    base_url: base_url
  }.compact
end

#schedule_testObject



21
22
23
24
# File 'lib/superbot/cloud/cli/schedule/create_command.rb', line 21

def schedule_test
  Superbot::Cloud::Api.request(:schedule_test, params: schedule_params)
  puts "Cloud run has been scheduled"
end