ops_manager_ui_drivers 1.20.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e890a3afd7e4e227190c75f0c4d9383952e74b3
4
- data.tar.gz: b1180e776c99b69fdcea72fc5bc9d2d41c64dfcb
3
+ metadata.gz: 840b4fd326d2a702b67edf5cf79c02e008e44482
4
+ data.tar.gz: 81bc8292afc5e690cc142f0976e75c33713cd30d
5
5
  SHA512:
6
- metadata.gz: b72c9dbfdc3d16a8eee7154b54284da0c8b907def7fad8c3ceebf2313acb8784c1ac1d5d7e3edf2c70e76029dc8be1b1ecbc99abceb78cb90a2236da538ec7ac
7
- data.tar.gz: 9c135b3ecfd131198fbefd542ad49076308caf994b9fad40b552ad85f8ca480e69643739a350022558574e4d6eb3d4dc628d04a63321025c2e81e2c7e2b8dbb0
6
+ metadata.gz: 8a4ae08fabb07810f967ec596498766c2f4eb0e0fac24e166dfc32bfe0962f0e02d1484437d47bf3a280a0c904e1a429102728a86daf24558ce7c78c52bc47f5
7
+ data.tar.gz: abe3562ef125a045dd8ac3e03849c517a432203a808db51b57bd865234840649f318706e57e43b9699d1a149af66f41c0782c0d55d1858fe5c148a241d4a63c5
@@ -1,3 +1,3 @@
1
1
  module OpsManagerUiDrivers
2
- VERSION = '1.20.0'
2
+ VERSION = '1.21.0'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  module OpsManagerUiDrivers
2
2
  module Version17
3
- class JobAvailabilityZoneMappingHelper
3
+ class JobAzAndNetworkMappingHelper
4
4
  def initialize(product_name:, browser:)
5
5
  @product_name = product_name
6
6
  @browser = browser
@@ -8,19 +8,22 @@ module OpsManagerUiDrivers
8
8
 
9
9
  SINGLETON_AVAILABILITY_ZONE_INPUT_SELECTOR = "input[name='product[singleton_availability_zone_reference]']"
10
10
  AVAILABILITY_ZONE_INPUT_SELECTOR = "input[name='product[availability_zone_references][]']"
11
+ NETWORK_FIELD_NAME = "product_network_reference"
11
12
 
12
- def assign_availability_zones!(singleton_availability_zone:, availability_zones:)
13
+ def assign_azs_and_network(singleton_availability_zone: nil, availability_zones: [], network:)
13
14
  open_form
14
15
 
16
+ got_azs = false
15
17
  browser.all(AVAILABILITY_ZONE_INPUT_SELECTOR).each do |checkbox|
18
+ got_azs = true
16
19
  checkbox.set(false)
17
20
  end
18
21
 
19
- availability_zones.each do |az_name|
20
- browser.check("#{az_name}")
21
- end
22
+ availability_zones.each { |az_name| browser.check("#{az_name}") } if got_azs
23
+
24
+ browser.choose("#{singleton_availability_zone}") if got_azs
22
25
 
23
- browser.choose("#{singleton_availability_zone}")
26
+ browser.find_field(NETWORK_FIELD_NAME).find(:option, text: network).select_option
24
27
 
25
28
  save_form
26
29
  end
@@ -44,6 +47,13 @@ module OpsManagerUiDrivers
44
47
  end
45
48
  end
46
49
 
50
+ def product_network
51
+ open_form
52
+ selected_options = browser.find_field(NETWORK_FIELD_NAME).all('option[selected]')
53
+ raise ArgumentError, "#{NETWORK_FIELD_NAME} not selected" if selected_options.empty?
54
+ selected_options.first.text
55
+ end
56
+
47
57
  private
48
58
 
49
59
  attr_reader :browser, :product_name
@@ -51,7 +61,7 @@ module OpsManagerUiDrivers
51
61
  def open_form
52
62
  browser.visit '/'
53
63
  browser.click_on "show-#{product_name}-configure-action"
54
- browser.click_on "show-#{product_name}-availability-zone-assignment-action"
64
+ browser.click_on "show-#{product_name}-azs-and-network-assignment-action"
55
65
  end
56
66
 
57
67
  def save_form
@@ -44,24 +44,24 @@ module OpsManagerUiDrivers
44
44
  Version17::ProductStatusHelper.new(browser: browser, product_name: product_name)
45
45
  end
46
46
 
47
- def job_network_mapping_for(product_name)
48
- Version17::JobNetworkMappingHelper.new(browser: browser, product_name: product_name)
49
- end
50
-
51
47
  def product_availability_zones(product_name)
52
48
  Version17::ProductAvailabilityZones.new(browser: browser, product: product_name)
53
49
  end
54
50
 
55
- def assign_availability_zones_for_product(product:, zones:)
56
- if zones
57
- Version17::JobAvailabilityZoneMappingHelper.new(
58
- browser: browser,
59
- product_name: product,
60
- ).assign_availability_zones!(
61
- singleton_availability_zone: zones[0]['name'],
62
- availability_zones: zones.map { |z| z['name'] },
63
- )
64
- end
51
+ def job_azs_and_network_mapping_for(product_name)
52
+ Version17::JobAzAndNetworkMappingHelper.new(
53
+ browser: browser,
54
+ product_name: product_name,
55
+ )
56
+ end
57
+
58
+ def assign_azs_and_network_for_product(product_name:, zones:, network:)
59
+
60
+ job_azs_and_network_mapping_for(product_name).assign_azs_and_network(
61
+ singleton_availability_zone: zones[0]['name'],
62
+ availability_zones: zones.map { |z| z['name'] },
63
+ network: network
64
+ )
65
65
  end
66
66
 
67
67
  def current_time
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_manager_ui_drivers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-01 00:00:00.000000000 Z
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -244,7 +244,7 @@ files:
244
244
  - lib/ops_manager_ui_drivers/version17/bosh_product_sections/iaas_configuration.rb
245
245
  - lib/ops_manager_ui_drivers/version17/bosh_product_sections/networks.rb
246
246
  - lib/ops_manager_ui_drivers/version17/bosh_product_sections/subnet.rb
247
- - lib/ops_manager_ui_drivers/version17/job_availability_zone_mapping_helper.rb
247
+ - lib/ops_manager_ui_drivers/version17/job_az_and_network_mapping_helper.rb
248
248
  - lib/ops_manager_ui_drivers/version17/job_network_mapping_helper.rb
249
249
  - lib/ops_manager_ui_drivers/version17/job_status_helper.rb
250
250
  - lib/ops_manager_ui_drivers/version17/ops_manager_director.rb