ops_manager_ui_drivers 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ops_manager_ui_drivers/page_helpers.rb +9 -1
  3. data/lib/ops_manager_ui_drivers/version.rb +1 -1
  4. data/lib/ops_manager_ui_drivers/version15/api_1_5.rb +42 -0
  5. data/lib/ops_manager_ui_drivers/version16/availability_zones.rb +54 -0
  6. data/lib/ops_manager_ui_drivers/version16/available_products.rb +24 -0
  7. data/lib/ops_manager_ui_drivers/version16/iaas_configuration.rb +28 -0
  8. data/lib/ops_manager_ui_drivers/version16/job_availability_zone_mapping_helper.rb +70 -0
  9. data/lib/ops_manager_ui_drivers/version16/job_network_mapping_helper.rb +47 -0
  10. data/lib/ops_manager_ui_drivers/version16/job_status_helper.rb +17 -0
  11. data/lib/ops_manager_ui_drivers/version16/networks.rb +55 -0
  12. data/lib/ops_manager_ui_drivers/version16/ops_manager_director.rb +190 -0
  13. data/lib/ops_manager_ui_drivers/version16/product_availability_zones.rb +38 -0
  14. data/lib/ops_manager_ui_drivers/version16/product_configuration.rb +34 -0
  15. data/lib/ops_manager_ui_drivers/version16/product_dashboard.rb +177 -0
  16. data/lib/ops_manager_ui_drivers/version16/product_form.rb +61 -0
  17. data/lib/ops_manager_ui_drivers/version16/product_logs.rb +38 -0
  18. data/lib/ops_manager_ui_drivers/version16/product_resource_configuration.rb +69 -0
  19. data/lib/ops_manager_ui_drivers/version16/product_status_helper.rb +64 -0
  20. data/lib/ops_manager_ui_drivers/version16/settings.rb +118 -0
  21. data/lib/ops_manager_ui_drivers/version16/setup.rb +44 -0
  22. data/lib/ops_manager_ui_drivers/version16/state_change_progress.rb +43 -0
  23. data/lib/ops_manager_ui_drivers/version16/web_ui.rb +110 -0
  24. metadata +23 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21c7c086a1115718522bfb347c7e62d6f556ccc7
4
- data.tar.gz: 0a147370f44685cf213bfd4372ff085e8c78471c
3
+ metadata.gz: 080f9d370a42fcef12f7b8ffaff0e020c8864ccf
4
+ data.tar.gz: 9098e4f44d9776474fafdd74a8a69f03a1f2fd9c
5
5
  SHA512:
6
- metadata.gz: ed0247941295b0781c8084d82a97b1c0ea3f4d7e0d0ef38104a523f60e830cb02585cbff9bc1da752f68f8ba99886dddacba99d9545d836c563980d91fa52f73
7
- data.tar.gz: 80537e8cf1844737f85e0c5bcc19ef604a78c3dc548a3869d1ea2e1e55380cf5a07bfeba7a3dcad4b0d4b00f1c0df3bb2a04aa4266266a45fc29e1fa3cf506b2
6
+ metadata.gz: 0f2afa77f68650997c77da3f498c172cef972eba46b54834f54e6c9320bc5543390f1521ba4900ea5e6719da220bde96827e6d648db5635a9a830f32018d3b6f
7
+ data.tar.gz: 43d0022256d0fa0c2c220f708da6b4c79c00512587d5731b3a6d42deb275340e1796b9865b6a531e2e55670595932d07dca063dff6f235afe72f22e23eca67fe
@@ -12,10 +12,14 @@ module OpsManagerUiDrivers
12
12
  @om_1_4 ||= create_web_ui(ops_manager_url, Version14)
13
13
  end
14
14
 
15
- def om_rc(ops_manager_url)
15
+ def om_1_5(ops_manager_url)
16
16
  @om_1_5 ||= create_web_ui(ops_manager_url, Version15)
17
17
  end
18
18
 
19
+ def om_rc(ops_manager_url)
20
+ @om_1_6 ||= create_web_ui(ops_manager_url, Version16)
21
+ end
22
+
19
23
  def api_1_3(host:, username:, password:)
20
24
  Version13::Api.new(host: host, user: username, password: password)
21
25
  end
@@ -24,6 +28,10 @@ module OpsManagerUiDrivers
24
28
  Version14::Api.new(host: host, user: username, password: password)
25
29
  end
26
30
 
31
+ def api_1_5(host:, username:, password:)
32
+ Version15::Api.new(host: host, user: username, password: password)
33
+ end
34
+
27
35
  private
28
36
 
29
37
  def create_web_ui(ops_manager_url, version_module)
@@ -1,3 +1,3 @@
1
1
  module OpsManagerUiDrivers
2
- VERSION = '0.13.0'
2
+ VERSION = '0.14.0'
3
3
  end
@@ -0,0 +1,42 @@
1
+ require 'net/https'
2
+
3
+ module OpsManagerUiDrivers
4
+ module Version15
5
+ class Api
6
+ def initialize(host: nil, user: nil, password: nil)
7
+ @host = host
8
+ @user = user
9
+ @password = password
10
+ end
11
+
12
+ def export_installation
13
+ tmpfile = Tempfile.new('installation.zip')
14
+ http.request(get('installation_asset_collection')) do |response|
15
+ response.read_body do |chunk|
16
+ tmpfile.write(chunk)
17
+ end
18
+ end
19
+ tmpfile.close
20
+ tmpfile
21
+ end
22
+
23
+ private
24
+
25
+ def http
26
+ uri = URI(@host)
27
+ Net::HTTP.new(uri.host, uri.port).tap do |http|
28
+ http.use_ssl = true
29
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
30
+ http.read_timeout = 900
31
+ end
32
+ end
33
+
34
+ def get(endpoint)
35
+ uri = URI("#{@host}/api/#{endpoint}")
36
+ Net::HTTP::Get.new(uri.request_uri).tap do |get|
37
+ get.basic_auth(@user, @password)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,54 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class AvailabilityZones
4
+ def initialize(browser:)
5
+ @browser = browser
6
+ end
7
+
8
+ def add_single_az(iaas_identifier)
9
+ open_form('availability_zones')
10
+
11
+ set_fields(fields: {'iaas_identifier' => iaas_identifier})
12
+
13
+ save_form
14
+ end
15
+
16
+ def add_az(fields)
17
+ open_form('availability_zones')
18
+
19
+ browser.click_on 'Add'
20
+ set_fields(fields: fields)
21
+ save_form
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :browser
27
+
28
+ def save_form
29
+ browser.click_on 'Save'
30
+ browser.expect(browser.page).to browser.have_css('.flash-message.success')
31
+ end
32
+
33
+ def open_form(form)
34
+ browser.visit '/'
35
+ browser.click_on 'show-microbosh-configure-action'
36
+ browser.click_on "show-#{form}-action"
37
+ end
38
+
39
+ def set_fields(fields:)
40
+ fields.each do |field, value|
41
+ set_field(field, value)
42
+ end
43
+ end
44
+
45
+ def set_field(field, value)
46
+ last_field(field).set(value)
47
+ end
48
+
49
+ def last_field(field)
50
+ browser.all(:field, "availability_zones[availability_zones][][#{field}]").last
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,24 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class AvailableProducts
4
+ def initialize(browser:)
5
+ @browser = browser
6
+ end
7
+
8
+ def add_product_to_install(product_name)
9
+ browser.visit '/'
10
+ browser.click_on "add-#{product_name}"
11
+ end
12
+
13
+ def product_added?(product_name)
14
+ browser.visit '/'
15
+ browser.all("#show-#{product_name}-configure-action").any?
16
+ end
17
+
18
+ private
19
+
20
+ attr_reader :browser
21
+
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,28 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class IaasConfiguration
4
+ def initialize(browser:)
5
+ @browser = browser
6
+ end
7
+
8
+ def open_form
9
+ browser.visit '/'
10
+ browser.click_on 'show-microbosh-configure-action'
11
+ browser.click_on 'show-iaas_configuration-action'
12
+ end
13
+
14
+ def save_form
15
+ browser.click_on 'Save'
16
+ browser.expect(browser.page).to browser.have_css('.flash-message.success')
17
+ end
18
+
19
+ def set_field(field, value)
20
+ browser.find_field("iaas_configuration[#{field}]").set(value)
21
+ end
22
+
23
+ private
24
+
25
+ attr_reader :browser
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,70 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class JobAvailabilityZoneMappingHelper
4
+ def initialize(product_name: nil, browser: nil)
5
+ @product_name = product_name
6
+ @browser = browser
7
+ end
8
+
9
+ SINGLETON_AVAILABILITY_ZONE_INPUT_SELECTOR = "input[name='product[singleton_availability_zone_reference]']"
10
+ AVAILABILITY_ZONE_INPUT_SELECTOR = "input[name='product[availability_zone_references][]']"
11
+
12
+ def assign_availability_zones!(singleton_availability_zone:, availability_zones:)
13
+ open_form
14
+
15
+ browser.all(AVAILABILITY_ZONE_INPUT_SELECTOR).each do |checkbox|
16
+ checkbox.set(false)
17
+ end
18
+
19
+ availability_zones.each do |az_name|
20
+ browser.check("#{az_name}")
21
+ end
22
+
23
+ browser.choose("#{singleton_availability_zone}")
24
+
25
+ save_form
26
+ end
27
+
28
+ def singleton_availability_zone
29
+ open_form
30
+
31
+ selected_options = browser.all("#{SINGLETON_AVAILABILITY_ZONE_INPUT_SELECTOR}[selected='selected']").map do |radio|
32
+ browser.find("label[for='#{radio[:id]}']").text
33
+ end
34
+
35
+ raise ArgumentError, 'availability_zone not selected' if selected_options.empty?
36
+ selected_options.first
37
+ end
38
+
39
+ def availability_zones
40
+ open_form
41
+
42
+ browser.all("#{AVAILABILITY_ZONE_INPUT_SELECTOR}[checked='checked']").map do |checkbox|
43
+ browser.find("label[for='#{checkbox[:id]}']").text
44
+ end
45
+ end
46
+
47
+ private
48
+
49
+ attr_reader :browser, :product_name
50
+
51
+ def open_form
52
+ browser.visit '/'
53
+ browser.click_on "show-#{product_name}-configure-action"
54
+ browser.click_on "show-#{product_name}-availability-zone-assignment-action"
55
+ end
56
+
57
+ def save_form
58
+ browser.click_on 'Save'
59
+
60
+ unless browser.has_css?('.flash-message.success')
61
+ if browser.has_css?('.flash-message.error')
62
+ raise browser.find('.flash-message.error').text
63
+ else
64
+ raise 'unexpected failure'
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,47 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class JobNetworkMappingHelper
4
+ PRODUCT_NETWORK_FIELD_NAME = 'product_network_assignment'
5
+
6
+ def initialize(product_name:, browser:)
7
+ @product_name = product_name
8
+ @browser = browser
9
+ end
10
+
11
+ def assign_product_to_network(network)
12
+ open_form
13
+ browser.find_field(PRODUCT_NETWORK_FIELD_NAME).find(:option, text: network).select_option
14
+ save_form
15
+ end
16
+
17
+ def product_network
18
+ open_form
19
+ selected_options = browser.find_field(PRODUCT_NETWORK_FIELD_NAME).all('option[selected]')
20
+ raise ArgumentError, "#{PRODUCT_NETWORK_FIELD_NAME} not selected" if selected_options.empty?
21
+ selected_options.first.text
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :product_name, :browser
27
+
28
+ def open_form
29
+ browser.visit '/'
30
+ browser.click_on "show-#{product_name}-configure-action"
31
+ browser.click_on "show-#{product_name}-network-assignment-action"
32
+ end
33
+
34
+ def save_form
35
+ browser.click_on 'Save'
36
+
37
+ unless browser.has_css?('.flash-message.success')
38
+ if browser.has_css?('.flash-message.error')
39
+ raise browser.find('.flash-message.error').text
40
+ else
41
+ raise 'unexpected failure'
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,17 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class JobStatusHelper
4
+ def self.from_job_row(job_row)
5
+ ips_string = job_row.find('.actual-ips').text
6
+ ips = ips_string.split(', ')
7
+ new(ips: ips)
8
+ end
9
+
10
+ def initialize(ips:)
11
+ @ips = ips
12
+ end
13
+
14
+ attr_reader :ips
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,55 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class Networks
4
+ def initialize(browser:)
5
+ @browser = browser
6
+ end
7
+
8
+ def add_network(name:, iaas_network_identifier:, subnet:, dns:, gateway:, reserved_ip_ranges:)
9
+ open_form('network')
10
+
11
+ browser.click_on 'Add'
12
+ set_fields(
13
+ fields: {
14
+ 'name' => name,
15
+ 'iaas_network_identifier' => iaas_network_identifier,
16
+ 'subnet' => subnet,
17
+ 'dns' => dns,
18
+ 'gateway' => gateway,
19
+ 'reserved_ip_ranges' => reserved_ip_ranges,
20
+ }
21
+ )
22
+ save_form
23
+ end
24
+
25
+ private
26
+
27
+ attr_reader :browser
28
+
29
+ def save_form
30
+ browser.click_on 'Save'
31
+ browser.expect(browser.page).to browser.have_css('.flash-message.success')
32
+ end
33
+
34
+ def open_form(form)
35
+ browser.visit '/'
36
+ browser.click_on 'show-microbosh-configure-action'
37
+ browser.click_on "show-#{form}-action"
38
+ end
39
+
40
+ def set_fields(fields:)
41
+ fields.each do |field, value|
42
+ set_field(field, value)
43
+ end
44
+ end
45
+
46
+ def set_field(field, value)
47
+ last_field(field).set(value)
48
+ end
49
+
50
+ def last_field(field)
51
+ browser.all(:field, "network[networks][][#{field}]").last
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,190 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class OpsManagerDirector
4
+ def initialize(browser:, iaas_configuration: Version16::IaasConfiguration.new(browser: browser))
5
+ @browser = browser
6
+ @iaas_configuration = iaas_configuration
7
+ end
8
+
9
+ def configure_microbosh(test_settings)
10
+ configure_iaas(test_settings)
11
+
12
+ config_director(test_settings.ops_manager)
13
+
14
+ add_availability_zones(test_settings.iaas_type, test_settings.ops_manager.availability_zones)
15
+
16
+ assign_availability_zone(test_settings.iaas_type, test_settings.ops_manager.availability_zones)
17
+
18
+ add_networks(test_settings)
19
+
20
+ assign_networks(test_settings.ops_manager)
21
+
22
+ customize_resource_config(test_settings.ops_manager.resource_config)
23
+ end
24
+
25
+ def configure_iaas(test_settings)
26
+ iaas_configuration.open_form
27
+ iaas_settings = Settings.for(test_settings)
28
+ iaas_settings.fields.each do |name, value|
29
+ iaas_configuration.set_field(name, value)
30
+ end
31
+ iaas_configuration.save_form
32
+ end
33
+
34
+ def add_availability_zones(iaas_type, iaas_availability_zones)
35
+ case iaas_type
36
+ when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE
37
+ return unless iaas_availability_zones
38
+ availability_zones.add_single_az(iaas_availability_zones.first['iaas_identifier'])
39
+ when OpsManagerUiDrivers::VSPHERE_IAAS_TYPE
40
+ iaas_availability_zones && iaas_availability_zones.each do |az|
41
+ availability_zones.add_az('name' => az['name'], 'cluster' => az['cluster'], 'resource_pool' => az['resource_pool'])
42
+ end
43
+ end
44
+ end
45
+
46
+ def add_networks(test_settings)
47
+ iaas_networks = test_settings.ops_manager.networks
48
+
49
+ case test_settings.iaas_type
50
+ when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE
51
+ first_network = iaas_networks.first
52
+ browser.click_on 'show-network-action'
53
+ browser.fill_in 'network[networks][][name]', with: first_network['name']
54
+ browser.fill_in 'network[networks][][iaas_network_identifier]', with: first_network['identifier']
55
+ browser.fill_in 'network[networks][][subnet]', with: first_network['subnet']
56
+ browser.fill_in 'network[networks][][reserved_ip_ranges]', with: first_network['reserved_ips']
57
+ browser.fill_in 'network[networks][][dns]', with: first_network['dns']
58
+ browser.fill_in 'network[networks][][gateway]', with: first_network['gateway']
59
+ browser.click_on 'Save'
60
+ flash_errors = browser.all('.flash-message.error ul.message li').to_a
61
+ flash_errors.reject! { |node| node.text =~ /cannot reach gateway/i }
62
+
63
+ if (flash_errors.length > 0)
64
+ fail flash_errors.collect(&:text).inspect
65
+ end
66
+ else
67
+ iaas_networks && iaas_networks.each do |network|
68
+ networks.add_network(
69
+ name: network['name'],
70
+ iaas_network_identifier: network['identifier'],
71
+ subnet: network['subnet'],
72
+ reserved_ip_ranges: network['reserved_ips'],
73
+ dns: network['dns'],
74
+ gateway: network['gateway'],
75
+ )
76
+ end
77
+ end
78
+ end
79
+
80
+ def config_director(ops_manager)
81
+ browser.click_on 'Director Config'
82
+ browser.fill_in('director_configuration[ntp_servers_string]', with: ops_manager.ntp_servers)
83
+ browser.check('Enable VM Resurrector Plugin') if ops_manager.resurrector_enabled
84
+
85
+ s3_blobstore = ops_manager.s3_blobstore
86
+ if s3_blobstore
87
+ browser.choose('S3 Compatible Blobstore')
88
+ browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.endpoint)
89
+ browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.bucket_name)
90
+ browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.access_key_id)
91
+ browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.secret_access_key)
92
+ end
93
+
94
+ mysql = ops_manager.mysql
95
+ if mysql
96
+ browser.choose('External MySQL Database')
97
+ browser.fill_in('director_configuration[external_database_options][host]', with: mysql.host)
98
+ browser.fill_in('director_configuration[external_database_options][port]', with: mysql.port)
99
+ browser.fill_in('director_configuration[external_database_options][user]', with: mysql.user)
100
+ browser.fill_in('director_configuration[external_database_options][password]', with: mysql.password)
101
+ browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dbname)
102
+ end
103
+
104
+ browser.click_on 'Save'
105
+ end
106
+
107
+ def assign_availability_zone(iaas_type, iaas_availability_zones)
108
+ return unless iaas_availability_zones
109
+ case iaas_type
110
+ when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE
111
+ browser.click_on 'Assign Availability Zones'
112
+ browser.select(iaas_availability_zones.first['iaas_identifier'])
113
+ browser.click_on 'Save'
114
+ when OpsManagerUiDrivers::VSPHERE_IAAS_TYPE
115
+ browser.click_on 'Assign Availability Zones'
116
+ browser.select(iaas_availability_zones.first['name'])
117
+ browser.click_on 'Save'
118
+ end
119
+ end
120
+
121
+ def assign_networks(ops_manager)
122
+ if ops_manager.vcenter
123
+ deployment_network = ops_manager.networks[0]
124
+
125
+ infrastructure_network =
126
+ ops_manager.networks[1] ? ops_manager.networks[1] : ops_manager.networks[0]
127
+
128
+ assign_networks_vsphere(
129
+ infrastructure_network: infrastructure_network['name'],
130
+ deployment_network: deployment_network['name'],
131
+ )
132
+ else
133
+ assign_network(deployment_network: ops_manager.networks[0]['name'])
134
+ end
135
+ end
136
+
137
+ def customize_resource_config(resource_config)
138
+ browser.click_on 'Resource Config'
139
+ if resource_config
140
+ browser.fill_in('product_resources_form[director][persistent_disk][value]', with: resource_config.persistent_disk)
141
+ end
142
+ end
143
+
144
+ def assign_networks_vsphere(infrastructure_network:, deployment_network:)
145
+ browser.click_on 'Assign Networks'
146
+
147
+ browser.within browser.find '#director_network_assignments_infrastructure_network' do
148
+ browser.select infrastructure_network
149
+ end
150
+
151
+ browser.within browser.find '#director_network_assignments_deployment_network' do
152
+ browser.select deployment_network
153
+ end
154
+ browser.click_on 'Save'
155
+ browser.wait { browser.has_text?('Successfully assigned infrastructure network') }
156
+ end
157
+
158
+ def assign_network(deployment_network:)
159
+ browser.click_on 'Assign Networks'
160
+
161
+ browser.select(deployment_network, from: 'Network')
162
+ browser.click_on 'Save'
163
+ end
164
+
165
+ def configure_vm_passwords(use_generated_passwords: true)
166
+ browser.click_on 'VM Passwords'
167
+ if use_generated_passwords
168
+ browser.choose('Generate passwords')
169
+ else
170
+ browser.choose('Use default BOSH password')
171
+ end
172
+ browser.click_on 'Save'
173
+ browser.wait { browser.has_text?('Settings updated') }
174
+ end
175
+
176
+ private
177
+
178
+ attr_reader :browser, :iaas_configuration
179
+
180
+
181
+ def availability_zones
182
+ @availability_zones ||= Version16::AvailabilityZones.new(browser: browser)
183
+ end
184
+
185
+ def networks
186
+ @networks ||= Version16::Networks.new(browser: browser)
187
+ end
188
+ end
189
+ end
190
+ end
@@ -0,0 +1,38 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class WebUi
4
+ class ProductAvailabilityZones
5
+ def initialize(browser:, product_name:)
6
+ @browser = browser
7
+ @product_name = product_name
8
+ end
9
+
10
+ def assign_availability_zones(singleton_availability_zone:, availability_zones:)
11
+ open_form
12
+ browser.choose(singleton_availability_zone)
13
+ # we don't change the assignments in clean install yet,
14
+ # otherwise we'd want to clear them out first
15
+ availability_zones.each do |az_name|
16
+ browser.check(az_name)
17
+ end
18
+ save_form
19
+ end
20
+
21
+ private
22
+ attr_reader :browser, :product_name
23
+
24
+ def open_form
25
+ browser.visit '/'
26
+ browser.click_on "show-#{product_name}-configure-action"
27
+ browser.click_on "show-#{product_name}-availability-zone-assignment-action"
28
+ end
29
+
30
+ def save_form
31
+ browser.click_on 'Save'
32
+
33
+ browser.expect(browser.page).to browser.have_css('.flash-message.success')
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,34 @@
1
+ module OpsManagerUiDrivers
2
+ module Version16
3
+ class ProductConfiguration
4
+ attr_reader :product_name
5
+
6
+ def initialize(browser:, product_name:)
7
+ @browser = browser
8
+ @product_name = product_name
9
+ end
10
+
11
+ def upload_stemcell(stemcell_file_path)
12
+ visit_product_page
13
+ browser.click_on "show-#{product_name}-stemcell-assignment-action"
14
+ browser.attach_file('product_stemcell[file]', stemcell_file_path, {visible: false})
15
+ browser.wait {
16
+ browser.has_text?("Stemcell '#{File.basename(stemcell_file_path)}' has been uploaded successfully.")
17
+ }
18
+ end
19
+
20
+ def product_form(form_name)
21
+ Version16::ProductForm.new(browser: browser, product_name: product_name, form_name: form_name)
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :browser, :product_name
27
+
28
+ def visit_product_page
29
+ browser.visit '/'
30
+ browser.click_on "show-#{product_name}-configure-action"
31
+ end
32
+ end
33
+ end
34
+ end