ops_manager_ui_drivers 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ops_manager_ui_drivers/page_helpers.rb +0 -16
  3. data/lib/ops_manager_ui_drivers/version.rb +1 -1
  4. data/lib/ops_manager_ui_drivers/wait_helper.rb +16 -0
  5. metadata +3 -25
  6. data/lib/ops_manager_ui_drivers/version11/api_1_1.rb +0 -40
  7. data/lib/ops_manager_ui_drivers/version11/available_products.rb +0 -24
  8. data/lib/ops_manager_ui_drivers/version11/install_progress.rb +0 -24
  9. data/lib/ops_manager_ui_drivers/version11/login.rb +0 -24
  10. data/lib/ops_manager_ui_drivers/version11/network_configuration.rb +0 -31
  11. data/lib/ops_manager_ui_drivers/version11/ntp_servers.rb +0 -28
  12. data/lib/ops_manager_ui_drivers/version11/ops_manager_director.rb +0 -27
  13. data/lib/ops_manager_ui_drivers/version11/product_dashboard.rb +0 -73
  14. data/lib/ops_manager_ui_drivers/version11/vcenter_credentials.rb +0 -31
  15. data/lib/ops_manager_ui_drivers/version11/vsphere_configuration.rb +0 -31
  16. data/lib/ops_manager_ui_drivers/version11/web_ui.rb +0 -34
  17. data/lib/ops_manager_ui_drivers/version12/api_1_2.rb +0 -40
  18. data/lib/ops_manager_ui_drivers/version12/available_products.rb +0 -24
  19. data/lib/ops_manager_ui_drivers/version12/install_progress.rb +0 -24
  20. data/lib/ops_manager_ui_drivers/version12/login.rb +0 -24
  21. data/lib/ops_manager_ui_drivers/version12/network_configuration.rb +0 -32
  22. data/lib/ops_manager_ui_drivers/version12/ntp_servers.rb +0 -28
  23. data/lib/ops_manager_ui_drivers/version12/ops_manager_director.rb +0 -27
  24. data/lib/ops_manager_ui_drivers/version12/product_dashboard.rb +0 -73
  25. data/lib/ops_manager_ui_drivers/version12/vcenter_credentials.rb +0 -31
  26. data/lib/ops_manager_ui_drivers/version12/vsphere_configuration.rb +0 -30
  27. data/lib/ops_manager_ui_drivers/version12/web_ui.rb +0 -34
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 456a964e4c5de9545586bc38598a6a626d3cb29b
4
- data.tar.gz: a87d208d929af20e1372f0fb146c61570bd66c1d
3
+ metadata.gz: e9ee69f6177cb3e3fe83ddf62efe72e5ed46e7a4
4
+ data.tar.gz: 826099396b8878c9b0bc796c417a415a0d87a3d4
5
5
  SHA512:
6
- metadata.gz: 518eb67196c163b4cb68ea01b69403f6bf7612db3c57644485d61699bc4b5b7ff2b187408d145dbee187d15e6503329afb793eeec3cf9d4ce66f0785a58254d9
7
- data.tar.gz: 86d3bd77c25ef3837afc0b581ebc8eb825cf84b41d1da3e8755c94543685c36566c1b950179f92b1cac5a255fa527e983dab8759a752f86ed0bdae5572101ed5
6
+ metadata.gz: 0ff6397c37ea12d61420bec5a3f5814dbfc79e917b95d94fb4ed4989393869a33f9da11fa4705b8b65f370dd2d3b2fe600957dda2b8902cee6e74183b7a90021
7
+ data.tar.gz: 5d932a45e9570dcd74819cee8d120c0789dfca1a619effda8497cd59ce3b9c66142851603df9ed52c83c925da172546523e80858343213f3d2ce86e36ec7507c
@@ -4,14 +4,6 @@ module OpsManagerUiDrivers
4
4
  module PageHelpers
5
5
  include OpsManagerUiDrivers::WaitHelper
6
6
 
7
- def om_1_1(ops_manager_url)
8
- @om_1_1 ||= create_web_ui(ops_manager_url, Version11)
9
- end
10
-
11
- def om_1_2(ops_manager_url)
12
- @om_1_2 ||= create_web_ui(ops_manager_url, Version12)
13
- end
14
-
15
7
  def om_1_3(ops_manager_url)
16
8
  @om_1_3 ||= create_web_ui(ops_manager_url, Version13)
17
9
  end
@@ -24,14 +16,6 @@ module OpsManagerUiDrivers
24
16
  @om_1_5 ||= create_web_ui(ops_manager_url, Version15)
25
17
  end
26
18
 
27
- def api_1_1(host:, username:, password:)
28
- Version11::Api.new(host: host, user: username, password: password)
29
- end
30
-
31
- def api_1_2(host:, username:, password:)
32
- Version12::Api.new(host: host, user: username, password: password)
33
- end
34
-
35
19
  def api_1_3(host:, username:, password:)
36
20
  Version13::Api.new(host: host, user: username, password: password)
37
21
  end
@@ -1,3 +1,3 @@
1
1
  module OpsManagerUiDrivers
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -7,6 +7,22 @@ module OpsManagerUiDrivers
7
7
 
8
8
  EarlyFailException = Class.new(Exception)
9
9
 
10
+ def wait(retries_left=20, interval=0.5, &blk)
11
+ blk.call
12
+ rescue EarlyFailException
13
+ raise
14
+ rescue RSpec::Expectations::ExpectationNotMetError, StandardError
15
+ puts "------- retries_left=#{retries_left}"
16
+ retries_left -= 1
17
+ if retries_left > 0
18
+ sleep(interval)
19
+ retry
20
+ else
21
+ puts "------- propagate error=#{retries_left}"
22
+ raise
23
+ end
24
+ end
25
+
10
26
  def fail_early(msg)
11
27
  fail(EarlyFailException.new(msg))
12
28
  end
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: 0.5.0
4
+ version: 0.6.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-05-28 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -128,28 +128,6 @@ files:
128
128
  - lib/ops_manager_ui_drivers.rb
129
129
  - lib/ops_manager_ui_drivers/page_helpers.rb
130
130
  - lib/ops_manager_ui_drivers/version.rb
131
- - lib/ops_manager_ui_drivers/version11/api_1_1.rb
132
- - lib/ops_manager_ui_drivers/version11/available_products.rb
133
- - lib/ops_manager_ui_drivers/version11/install_progress.rb
134
- - lib/ops_manager_ui_drivers/version11/login.rb
135
- - lib/ops_manager_ui_drivers/version11/network_configuration.rb
136
- - lib/ops_manager_ui_drivers/version11/ntp_servers.rb
137
- - lib/ops_manager_ui_drivers/version11/ops_manager_director.rb
138
- - lib/ops_manager_ui_drivers/version11/product_dashboard.rb
139
- - lib/ops_manager_ui_drivers/version11/vcenter_credentials.rb
140
- - lib/ops_manager_ui_drivers/version11/vsphere_configuration.rb
141
- - lib/ops_manager_ui_drivers/version11/web_ui.rb
142
- - lib/ops_manager_ui_drivers/version12/api_1_2.rb
143
- - lib/ops_manager_ui_drivers/version12/available_products.rb
144
- - lib/ops_manager_ui_drivers/version12/install_progress.rb
145
- - lib/ops_manager_ui_drivers/version12/login.rb
146
- - lib/ops_manager_ui_drivers/version12/network_configuration.rb
147
- - lib/ops_manager_ui_drivers/version12/ntp_servers.rb
148
- - lib/ops_manager_ui_drivers/version12/ops_manager_director.rb
149
- - lib/ops_manager_ui_drivers/version12/product_dashboard.rb
150
- - lib/ops_manager_ui_drivers/version12/vcenter_credentials.rb
151
- - lib/ops_manager_ui_drivers/version12/vsphere_configuration.rb
152
- - lib/ops_manager_ui_drivers/version12/web_ui.rb
153
131
  - lib/ops_manager_ui_drivers/version13/api_1_3.rb
154
132
  - lib/ops_manager_ui_drivers/version13/availability_zones.rb
155
133
  - lib/ops_manager_ui_drivers/version13/available_products.rb
@@ -226,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
204
  version: '0'
227
205
  requirements: []
228
206
  rubyforge_project:
229
- rubygems_version: 2.2.2
207
+ rubygems_version: 2.4.7
230
208
  signing_key:
231
209
  specification_version: 4
232
210
  summary: Capybara helpers for configuring Pivotal Ops Manager
@@ -1,40 +0,0 @@
1
- require 'net/https'
2
-
3
- module OpsManagerUiDrivers
4
- module Version11
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
- response = http.request(get('installation_zip'))
14
-
15
- Tempfile.new('installation.zip').tap do |tempfile|
16
- tempfile.write(response.body)
17
- tempfile.close
18
- end
19
- end
20
-
21
- private
22
-
23
- def http
24
- uri = URI(@host)
25
- Net::HTTP.new(uri.host, uri.port).tap do |http|
26
- http.use_ssl = true
27
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
28
- http.read_timeout = 900
29
- end
30
- end
31
-
32
- def get(endpoint)
33
- uri = URI("#{@host}/api/#{endpoint}")
34
- Net::HTTP::Get.new(uri.request_uri).tap do |get|
35
- get.basic_auth(@user, @password)
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,24 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
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
@@ -1,24 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class InstallProgress
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def install_success?
9
- browser.visit '/install' unless install_progress_open?
10
- browser.fail_early('Install probably aborted immediately') unless install_progress_open?
11
- browser.fail_early('Install failed') if browser.all('#install-failure-modal').any?
12
- browser.all('#install-success-modal').any?
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser
18
-
19
- def install_progress_open?
20
- browser.current_path == '/install'
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class Login
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def login(user:, password:)
9
- open_login_page
10
- browser.fill_in 'login[user_name]', with: user
11
- browser.fill_in 'login[password]', with: password
12
- browser.click_on 'login-action'
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser
18
-
19
- def open_login_page
20
- browser.visit '/login'
21
- end
22
- end
23
- end
24
- end
@@ -1,31 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class NetworkConfiguration
4
- def initialize(browser:, product_id:)
5
- @browser = browser
6
- @product_id = product_id
7
- end
8
-
9
- def configure(network_configuration)
10
- open_network_configuration
11
- configure_network(network_configuration)
12
- end
13
-
14
- private
15
-
16
- attr_reader :browser, :product_id
17
-
18
- def open_network_configuration
19
- browser.visit("/components/#{product_id}/forms/network/edit")
20
- end
21
-
22
- def configure_network(network_configuration)
23
- browser.fill_in 'network[subnet]', with: network_configuration['subnet']
24
- browser.fill_in 'network[reserved_ip_ranges]', with: network_configuration['reserved_ip_ranges']
25
- browser.fill_in 'network[dns]', with: network_configuration['dns']
26
- browser.fill_in 'network[gateway]', with: network_configuration['gateway']
27
- browser.click_on 'Save'
28
- end
29
- end
30
- end
31
- end
@@ -1,28 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class NtpServers
4
- def initialize(browser:, product_id:)
5
- @browser = browser
6
- @product_id = product_id
7
- end
8
-
9
- def configure(ntp_configuration)
10
- open_ntp_configuration
11
- configure_ntp(ntp_configuration)
12
- end
13
-
14
- private
15
-
16
- attr_reader :browser, :product_id
17
-
18
- def open_ntp_configuration
19
- browser.visit("/components/#{product_id}/forms/ntp/edit")
20
- end
21
-
22
- def configure_ntp(ntp_configuration)
23
- browser.fill_in 'ntp[ntp_servers]', with: ntp_configuration['ntp']
24
- browser.click_on 'Save'
25
- end
26
- end
27
- end
28
- end
@@ -1,27 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class OpsManagerDirector
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def configure(configuration)
9
- Version11::VcenterCredentials.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['vcenter_credentials'])
10
- Version11::VsphereConfiguration.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['vsphere_configuration'])
11
- Version11::NetworkConfiguration.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['network_configuration'])
12
- Version11::NtpServers.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['ntp_configuration'])
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser
18
-
19
- def ops_manager_product_id
20
- @ops_manager_product_id ||= begin
21
- browser.visit '/'
22
- browser.find('#show-microbosh-configure-action')['href'].gsub('/components/', '').gsub(%r{/.*}, '')
23
- end
24
- end
25
- end
26
- end
27
- end
@@ -1,73 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class ProductDashboard
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def apply_updates
9
- open_dashboard
10
- browser.click_on 'install-action'
11
- browser.fail('Install failed verification') if nonignorable_verification_failed?
12
- ignore_cpu_verification
13
- end
14
-
15
- def delete_whole_installation
16
- open_dashboard
17
- browser.click_on 'toggle-installation-dropdown-action'
18
- browser.click_on 'show-delete-installation-modal-action'
19
- wait_for_modal_css_transition_to_complete
20
- browser.click_on 'delete-installation-action'
21
- end
22
-
23
- def delete_installation_available?
24
- open_dashboard
25
- browser.click_on 'toggle-installation-dropdown-action'
26
- browser.all('#show-delete-installation-modal-action').any?
27
- end
28
-
29
- def deletion_in_progress?
30
- open_dashboard
31
- browser.all('#delete-in-progress-marker').any?
32
- end
33
-
34
- def reset_state
35
- revert_pending_changes if revert_available?
36
- delete_whole_installation if delete_installation_available?
37
- end
38
-
39
- private
40
-
41
- attr_reader :browser
42
-
43
- def nonignorable_verification_failed?
44
- browser.all('.flash-message.error').any? && browser.all('#ignore-install-action').empty?
45
- end
46
-
47
- def ignore_cpu_verification
48
- if (flash_error = browser.all('.flash-message.error').first)
49
- browser.click_on 'ignore-install-action' if flash_error.text =~ /Installation requires \d+ CPU cores/
50
- end
51
- end
52
-
53
- def wait_for_modal_css_transition_to_complete
54
- sleep 2 # :(
55
- end
56
-
57
- def open_dashboard
58
- browser.visit '/'
59
- end
60
-
61
- def revert_available?
62
- browser.all('#open-revert-installation-modal-action').any?
63
- end
64
-
65
- def revert_pending_changes
66
- open_dashboard
67
- browser.click_on 'open-revert-installation-modal-action'
68
- wait_for_modal_css_transition_to_complete
69
- browser.click_on 'revert-installation-action'
70
- end
71
- end
72
- end
73
- end
@@ -1,31 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class VcenterCredentials
4
-
5
- def initialize(browser:, product_id:)
6
- @browser = browser
7
- @product_id = product_id
8
- end
9
-
10
- def configure(vcenter_credentials_configuration)
11
- open_vcenter_credentials
12
- configure_vcenter_credentials(vcenter_credentials_configuration)
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser, :product_id
18
-
19
- def open_vcenter_credentials
20
- browser.visit "/components/#{product_id}/forms/vcenter/edit"
21
- end
22
-
23
- def configure_vcenter_credentials(vcenter_credentials_configuration)
24
- browser.fill_in 'vcenter[vcenter_ip]', with: vcenter_credentials_configuration['ip_address']
25
- browser.fill_in 'vcenter[login_credentials][identity]', with: vcenter_credentials_configuration['identity']
26
- browser.fill_in 'vcenter[login_credentials][password]', with: vcenter_credentials_configuration['password']
27
- browser.click_on 'Save'
28
- end
29
- end
30
- end
31
- end
@@ -1,31 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class VsphereConfiguration
4
- def initialize(browser:, product_id:)
5
- @browser = browser
6
- @product_id = product_id
7
- end
8
-
9
- def configure(vsphere_configuration)
10
- open_vsphere_configuration
11
- configure_vsphere(vsphere_configuration)
12
- end
13
-
14
- private
15
-
16
- attr_reader :browser, :product_id
17
-
18
- def open_vsphere_configuration
19
- browser.visit("/components/#{product_id}/forms/vsphere/edit")
20
- end
21
-
22
- def configure_vsphere(vsphere_configuration)
23
- browser.fill_in 'vsphere[network]', with: vsphere_configuration['network']
24
- browser.fill_in 'vsphere[datacenter]', with: vsphere_configuration['datacenter']
25
- browser.fill_in 'vsphere[cluster]', with: vsphere_configuration['cluster']
26
- browser.fill_in 'vsphere[datastore]', with: vsphere_configuration['datastore']
27
- browser.click_on 'Save'
28
- end
29
- end
30
- end
31
- end
@@ -1,34 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version11
3
- class WebUi
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def login_page
9
- @login_page ||= Version11::Login.new(browser: browser)
10
- end
11
-
12
- def product_dashboard
13
- @product_dashboard ||= Version11::ProductDashboard.new(browser: browser)
14
- end
15
-
16
- def available_products
17
- @available_products ||= Version11::AvailableProducts.new(browser: browser)
18
- end
19
-
20
- def ops_manager_director
21
- @ops_manager_director ||= Version11::OpsManagerDirector.new(browser: browser)
22
- end
23
-
24
- def install_progress
25
- @install_progress ||= Version11::InstallProgress.new(browser: browser)
26
- end
27
-
28
- private
29
-
30
- attr_reader :browser
31
-
32
- end
33
- end
34
- end
@@ -1,40 +0,0 @@
1
- require 'net/https'
2
-
3
- module OpsManagerUiDrivers
4
- module Version12
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
- response = http.request(get('installation_asset_collection'))
14
-
15
- Tempfile.new('installation.zip').tap do |tempfile|
16
- tempfile.write(response.body)
17
- tempfile.close
18
- end
19
- end
20
-
21
- private
22
-
23
- def http
24
- uri = URI(@host)
25
- Net::HTTP.new(uri.host, uri.port).tap do |http|
26
- http.use_ssl = true
27
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
28
- http.read_timeout = 900
29
- end
30
- end
31
-
32
- def get(endpoint)
33
- uri = URI("#{@host}/api/#{endpoint}")
34
- Net::HTTP::Get.new(uri.request_uri).tap do |get|
35
- get.basic_auth(@user, @password)
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,24 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
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
@@ -1,24 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class InstallProgress
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def install_success?
9
- browser.visit '/install' unless install_progress_open?
10
- browser.fail_early('Install probably aborted immediately') unless install_progress_open?
11
- browser.fail_early('Install failed') if browser.all('#install-failure-modal').any?
12
- browser.all('#install-success-modal').any?
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser
18
-
19
- def install_progress_open?
20
- browser.current_path == '/install'
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class Login
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def login(user:, password:)
9
- open_login_page
10
- browser.fill_in 'login[user_name]', with: user
11
- browser.fill_in 'login[password]', with: password
12
- browser.click_on 'login-action'
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser
18
-
19
- def open_login_page
20
- browser.visit '/login'
21
- end
22
- end
23
- end
24
- end
@@ -1,32 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class NetworkConfiguration
4
- def initialize(browser:, product_id:)
5
- @browser = browser
6
- @product_id = product_id
7
- end
8
-
9
- def configure(network_configuration)
10
- open_network_configuration
11
- configure_network(network_configuration)
12
- end
13
-
14
- private
15
-
16
- attr_reader :browser, :product_id
17
-
18
- def open_network_configuration
19
- browser.visit("/components/#{product_id}/forms/network/edit")
20
- end
21
-
22
- def configure_network(network_configuration)
23
- browser.fill_in 'network[network]', with: network_configuration['network']
24
- browser.fill_in 'network[subnet]', with: network_configuration['subnet']
25
- browser.fill_in 'network[reserved_ip_ranges]', with: network_configuration['reserved_ip_ranges']
26
- browser.fill_in 'network[dns]', with: network_configuration['dns']
27
- browser.fill_in 'network[gateway]', with: network_configuration['gateway']
28
- browser.click_on 'Save'
29
- end
30
- end
31
- end
32
- end
@@ -1,28 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class NtpServers
4
- def initialize(browser:, product_id:)
5
- @browser = browser
6
- @product_id = product_id
7
- end
8
-
9
- def configure(ntp_configuration)
10
- open_ntp_configuration
11
- configure_ntp(ntp_configuration)
12
- end
13
-
14
- private
15
-
16
- attr_reader :browser, :product_id
17
-
18
- def open_ntp_configuration
19
- browser.visit("/components/#{product_id}/forms/ntp/edit")
20
- end
21
-
22
- def configure_ntp(ntp_configuration)
23
- browser.fill_in 'ntp[ntp_servers]', with: ntp_configuration['ntp']
24
- browser.click_on 'Save'
25
- end
26
- end
27
- end
28
- end
@@ -1,27 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class OpsManagerDirector
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def configure(configuration)
9
- Version12::VcenterCredentials.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['vcenter_credentials'])
10
- Version12::VsphereConfiguration.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['vsphere_configuration'])
11
- Version12::NetworkConfiguration.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['network_configuration'])
12
- Version12::NtpServers.new(browser: browser, product_id: ops_manager_product_id).configure(configuration['ntp_configuration'])
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser
18
-
19
- def ops_manager_product_id
20
- @ops_manager_product_id ||= begin
21
- browser.visit '/'
22
- browser.find('#show-microbosh-configure-action')['href'].gsub('/components/', '').gsub(%r{/.*}, '')
23
- end
24
- end
25
- end
26
- end
27
- end
@@ -1,73 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class ProductDashboard
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def apply_updates
9
- open_dashboard
10
- browser.click_on 'install-action'
11
- browser.fail('Install failed verification') if nonignorable_verification_failed?
12
- ignore_cpu_verification
13
- end
14
-
15
- def delete_whole_installation
16
- open_dashboard
17
- browser.click_on 'toggle-installation-dropdown-action'
18
- browser.click_on 'show-delete-installation-modal-action'
19
- wait_for_modal_css_transition_to_complete
20
- browser.click_on 'delete-installation-action'
21
- end
22
-
23
- def delete_installation_available?
24
- open_dashboard
25
- browser.click_on 'toggle-installation-dropdown-action'
26
- browser.all('#show-delete-installation-modal-action').any?
27
- end
28
-
29
- def deletion_in_progress?
30
- open_dashboard
31
- browser.all('#delete-in-progress-marker').any?
32
- end
33
-
34
- def reset_state
35
- revert_pending_changes if revert_available?
36
- delete_whole_installation if delete_installation_available?
37
- end
38
-
39
- private
40
-
41
- attr_reader :browser
42
-
43
- def nonignorable_verification_failed?
44
- browser.all('.flash-message.error').any? && browser.all('#ignore-install-action').empty?
45
- end
46
-
47
- def ignore_cpu_verification
48
- if (flash_error = browser.all('.flash-message.error').first)
49
- browser.click_on 'ignore-install-action' if flash_error.text =~ /Installation requires \d+ CPU cores/
50
- end
51
- end
52
-
53
- def wait_for_modal_css_transition_to_complete
54
- sleep 2 # :(
55
- end
56
-
57
- def open_dashboard
58
- browser.visit '/'
59
- end
60
-
61
- def revert_available?
62
- browser.all('#open-revert-installation-modal-action').any?
63
- end
64
-
65
- def revert_pending_changes
66
- open_dashboard
67
- browser.click_on 'open-revert-installation-modal-action'
68
- wait_for_modal_css_transition_to_complete
69
- browser.click_on 'revert-installation-action'
70
- end
71
- end
72
- end
73
- end
@@ -1,31 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class VcenterCredentials
4
-
5
- def initialize(browser:, product_id:)
6
- @browser = browser
7
- @product_id = product_id
8
- end
9
-
10
- def configure(vcenter_credentials_configuration)
11
- open_vcenter_credentials
12
- configure_vcenter_credentials(vcenter_credentials_configuration)
13
- end
14
-
15
- private
16
-
17
- attr_reader :browser, :product_id
18
-
19
- def open_vcenter_credentials
20
- browser.visit "/components/#{product_id}/forms/vcenter/edit"
21
- end
22
-
23
- def configure_vcenter_credentials(vcenter_credentials_configuration)
24
- browser.fill_in 'vcenter[vcenter_ip]', with: vcenter_credentials_configuration['ip_address']
25
- browser.fill_in 'vcenter[login_credentials][identity]', with: vcenter_credentials_configuration['identity']
26
- browser.fill_in 'vcenter[login_credentials][password]', with: vcenter_credentials_configuration['password']
27
- browser.click_on 'Save'
28
- end
29
- end
30
- end
31
- end
@@ -1,30 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class VsphereConfiguration
4
- def initialize(browser:, product_id:)
5
- @browser = browser
6
- @product_id = product_id
7
- end
8
-
9
- def configure(vsphere_configuration)
10
- open_vsphere_configuration
11
- configure_vsphere(vsphere_configuration)
12
- end
13
-
14
- private
15
-
16
- attr_reader :browser, :product_id
17
-
18
- def open_vsphere_configuration
19
- browser.visit("/components/#{product_id}/forms/vsphere/edit")
20
- end
21
-
22
- def configure_vsphere(vsphere_configuration)
23
- browser.fill_in 'vsphere[datacenter]', with: vsphere_configuration['datacenter']
24
- browser.fill_in 'vsphere[cluster]', with: vsphere_configuration['cluster']
25
- browser.fill_in 'vsphere[datastores]', with: vsphere_configuration['datastores']
26
- browser.click_on 'Save'
27
- end
28
- end
29
- end
30
- end
@@ -1,34 +0,0 @@
1
- module OpsManagerUiDrivers
2
- module Version12
3
- class WebUi
4
- def initialize(browser:)
5
- @browser = browser
6
- end
7
-
8
- def login_page
9
- @login_page ||= Version12::Login.new(browser: browser)
10
- end
11
-
12
- def product_dashboard
13
- @product_dashboard ||= Version12::ProductDashboard.new(browser: browser)
14
- end
15
-
16
- def available_products
17
- @available_products ||= Version12::AvailableProducts.new(browser: browser)
18
- end
19
-
20
- def ops_manager_director
21
- @ops_manager_director ||= Version12::OpsManagerDirector.new(browser: browser)
22
- end
23
-
24
- def install_progress
25
- @install_progress ||= Version12::InstallProgress.new(browser: browser)
26
- end
27
-
28
- private
29
-
30
- attr_reader :browser
31
-
32
- end
33
- end
34
- end