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



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

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

#delete_product(product_name, timeout) ⇒ Object



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

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

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

#delete_product_if_present(product_name, timeout) ⇒ Object



65
66
67
68
69
70
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 65

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

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

#export_installation(export_destination) ⇒ Object



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

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

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

#get_latest_install_logObject



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

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

#import_stemcell(stemcell_file, product_name) ⇒ Object



72
73
74
75
76
77
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 72

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



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

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

#trigger_install(install_timeout) ⇒ Object



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

def trigger_install(install_timeout)
  ENV['INSTALL_TIMEOUT'] = install_timeout

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

#uncheck_errands(product_name, errand_names) ⇒ Object



79
80
81
82
83
84
85
86
# File 'lib/opsmgr/ui_helpers/ui_spec_runner.rb', line 79

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



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

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



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

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