Class: UiSpecRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/opsmgr/ui_helpers/ui_spec_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(environment:, om_version:) ⇒ UiSpecRunner

Returns a new instance of UiSpecRunner.



4
5
6
7
8
9
10
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 4

def initialize(environment:, om_version:)
  raise 'No Environment Name provided' if environment.nil? || environment.empty?
  raise 'No Ops Manager Version provided' if om_version.nil? || om_version.empty?

  ENV['ENVIRONMENT_NAME'] = environment
  ENV['OM_VERSION'] = om_version
end

Instance Method Details

#add_first_userObject



12
13
14
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 12

def add_first_user
  run_spec([spec_path + '/add_first_user_spec.rb'])
end

#configure_microboshObject



16
17
18
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 16

def configure_microbosh
  run_spec([microbosh_spec_path + '/configure_microbosh_spec.rb'])
end

#delete_installationObject



55
56
57
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 55

def delete_installation
  run_spec([spec_path + '/delete_installation_spec.rb'])
end

#delete_product(product_name, timeout, poll_interval) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 59

def delete_product(product_name, timeout, poll_interval)
  ENV['PRODUCT_NAME'] = product_name
  ENV['DELETE_TIMEOUT'] = timeout
  ENV['POLL_INTERVAL'] = poll_interval

  run_spec([spec_path + '/delete_product_spec.rb'])
end

#delete_product_if_present(product_name, timeout, poll_interval) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 67

def delete_product_if_present(product_name, timeout, poll_interval)
  ENV['PRODUCT_NAME'] = product_name
  ENV['DELETE_TIMEOUT'] = timeout
  ENV['POLL_INTERVAL'] = poll_interval

  run_spec([spec_path + '/delete_product_if_present_spec.rb'])
end

#export_installation(export_destination) ⇒ Object



45
46
47
48
49
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 45

def export_installation(export_destination)
  ENV['EXPORT_DESTINATION'] = export_destination

  run_spec([spec_path + '/export_installation_spec.rb'])
end

#get_latest_install_logObject



27
28
29
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 27

def get_latest_install_log
  run_spec([spec_path + '/get_latest_install_log_spec.rb'])
end

#import_stemcell(stemcell_file, product_name) ⇒ Object



75
76
77
78
79
80
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 75

def import_stemcell(stemcell_file, product_name)
  ENV['STEMCELL_FILE'] = stemcell_file
  ENV['PRODUCT_NAME'] = product_name

  run_spec([spec_path + '/import_stemcell_spec.rb'])
end

#post_import_configurationObject



51
52
53
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 51

def post_import_configuration
  run_spec([spec_path + '/post_import_configuration_spec.rb'])
end

#revert_staged_changesObject



91
92
93
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 91

def revert_staged_changes
  run_spec([spec_path + '/revert_staged_changes_spec.rb'])
end

#trigger_install(install_timeout, poll_interval) ⇒ Object



20
21
22
23
24
25
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 20

def trigger_install(install_timeout, poll_interval)
  ENV['INSTALL_TIMEOUT'] = install_timeout
  ENV['POLL_INTERVAL'] = poll_interval

  run_spec([spec_path + '/trigger_install_spec.rb'])
end

#uncheck_errands(product_name, errand_names) ⇒ Object



82
83
84
85
86
87
88
89
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 82

def uncheck_errands(product_name, errand_names)
  require 'json'

  ENV['PRODUCT_NAME'] = product_name
  ENV['ERRAND_NAMES'] = JSON.generate(errand_names)

  run_spec([spec_path + '/uncheck_errands_spec.rb'])
end

#upload_and_add_product(product_path, product_name) ⇒ Object



31
32
33
34
35
36
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 31

def upload_and_add_product(product_path, product_name)
  ENV['PRODUCT_PATH'] = product_path
  ENV['PRODUCT_NAME'] = product_name

  run_spec([spec_path + '/upload_and_add_product_spec.rb'])
end

#upload_and_upgrade_product(product_path, product_name) ⇒ Object



38
39
40
41
42
43
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 38

def upload_and_upgrade_product(product_path, product_name)
  ENV['PRODUCT_PATH'] = product_path
  ENV['PRODUCT_NAME'] = product_name

  run_spec([spec_path + '/upload_and_upgrade_product_spec.rb'])
end