ops_manager_ui_drivers 0.2.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.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE +13 -0
- data/README.md +39 -0
- data/Rakefile +12 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/ci/run_specs.sh +11 -0
- data/lib/ops_manager_ui_drivers.rb +10 -0
- data/lib/ops_manager_ui_drivers/page_helpers.rb +52 -0
- data/lib/ops_manager_ui_drivers/version.rb +3 -0
- data/lib/ops_manager_ui_drivers/version11/api_1_1.rb +40 -0
- data/lib/ops_manager_ui_drivers/version11/available_products.rb +24 -0
- data/lib/ops_manager_ui_drivers/version11/install_progress.rb +24 -0
- data/lib/ops_manager_ui_drivers/version11/login.rb +24 -0
- data/lib/ops_manager_ui_drivers/version11/network_configuration.rb +31 -0
- data/lib/ops_manager_ui_drivers/version11/ntp_servers.rb +28 -0
- data/lib/ops_manager_ui_drivers/version11/ops_manager_director.rb +27 -0
- data/lib/ops_manager_ui_drivers/version11/product_dashboard.rb +73 -0
- data/lib/ops_manager_ui_drivers/version11/vcenter_credentials.rb +31 -0
- data/lib/ops_manager_ui_drivers/version11/vsphere_configuration.rb +31 -0
- data/lib/ops_manager_ui_drivers/version11/web_ui.rb +34 -0
- data/lib/ops_manager_ui_drivers/version12/api_1_2.rb +40 -0
- data/lib/ops_manager_ui_drivers/version12/available_products.rb +24 -0
- data/lib/ops_manager_ui_drivers/version12/install_progress.rb +24 -0
- data/lib/ops_manager_ui_drivers/version12/login.rb +24 -0
- data/lib/ops_manager_ui_drivers/version12/network_configuration.rb +32 -0
- data/lib/ops_manager_ui_drivers/version12/ntp_servers.rb +28 -0
- data/lib/ops_manager_ui_drivers/version12/ops_manager_director.rb +27 -0
- data/lib/ops_manager_ui_drivers/version12/product_dashboard.rb +73 -0
- data/lib/ops_manager_ui_drivers/version12/vcenter_credentials.rb +31 -0
- data/lib/ops_manager_ui_drivers/version12/vsphere_configuration.rb +30 -0
- data/lib/ops_manager_ui_drivers/version12/web_ui.rb +34 -0
- data/lib/ops_manager_ui_drivers/version13/api_1_3.rb +40 -0
- data/lib/ops_manager_ui_drivers/version13/availability_zones.rb +55 -0
- data/lib/ops_manager_ui_drivers/version13/available_products.rb +24 -0
- data/lib/ops_manager_ui_drivers/version13/iaas_configuration.rb +65 -0
- data/lib/ops_manager_ui_drivers/version13/install_progress.rb +43 -0
- data/lib/ops_manager_ui_drivers/version13/job_availability_zone_mapping_helper.rb +70 -0
- data/lib/ops_manager_ui_drivers/version13/job_network_mapping_helper.rb +47 -0
- data/lib/ops_manager_ui_drivers/version13/job_status_helper.rb +17 -0
- data/lib/ops_manager_ui_drivers/version13/networks.rb +83 -0
- data/lib/ops_manager_ui_drivers/version13/ops_manager_director.rb +140 -0
- data/lib/ops_manager_ui_drivers/version13/product_availability_zones.rb +38 -0
- data/lib/ops_manager_ui_drivers/version13/product_dashboard.rb +157 -0
- data/lib/ops_manager_ui_drivers/version13/product_logs.rb +53 -0
- data/lib/ops_manager_ui_drivers/version13/product_resource_configuration.rb +46 -0
- data/lib/ops_manager_ui_drivers/version13/product_status_helper.rb +64 -0
- data/lib/ops_manager_ui_drivers/version13/setup.rb +40 -0
- data/lib/ops_manager_ui_drivers/version13/web_ui.rb +106 -0
- data/lib/ops_manager_ui_drivers/version14/api_1_4.rb +40 -0
- data/lib/ops_manager_ui_drivers/version14/availability_zones.rb +59 -0
- data/lib/ops_manager_ui_drivers/version14/available_products.rb +24 -0
- data/lib/ops_manager_ui_drivers/version14/iaas_configuration.rb +89 -0
- data/lib/ops_manager_ui_drivers/version14/job_availability_zone_mapping_helper.rb +70 -0
- data/lib/ops_manager_ui_drivers/version14/job_network_mapping_helper.rb +47 -0
- data/lib/ops_manager_ui_drivers/version14/job_status_helper.rb +17 -0
- data/lib/ops_manager_ui_drivers/version14/networks.rb +58 -0
- data/lib/ops_manager_ui_drivers/version14/ops_manager_director.rb +252 -0
- data/lib/ops_manager_ui_drivers/version14/product_availability_zones.rb +38 -0
- data/lib/ops_manager_ui_drivers/version14/product_configuration.rb +34 -0
- data/lib/ops_manager_ui_drivers/version14/product_dashboard.rb +175 -0
- data/lib/ops_manager_ui_drivers/version14/product_form.rb +47 -0
- data/lib/ops_manager_ui_drivers/version14/product_logs.rb +38 -0
- data/lib/ops_manager_ui_drivers/version14/product_resource_configuration.rb +46 -0
- data/lib/ops_manager_ui_drivers/version14/product_status_helper.rb +64 -0
- data/lib/ops_manager_ui_drivers/version14/setup.rb +40 -0
- data/lib/ops_manager_ui_drivers/version14/state_change_progress.rb +43 -0
- data/lib/ops_manager_ui_drivers/version14/web_ui.rb +104 -0
- data/lib/ops_manager_ui_drivers/version15/availability_zones.rb +59 -0
- data/lib/ops_manager_ui_drivers/version15/available_products.rb +24 -0
- data/lib/ops_manager_ui_drivers/version15/iaas_configuration.rb +105 -0
- data/lib/ops_manager_ui_drivers/version15/job_availability_zone_mapping_helper.rb +70 -0
- data/lib/ops_manager_ui_drivers/version15/job_network_mapping_helper.rb +47 -0
- data/lib/ops_manager_ui_drivers/version15/job_status_helper.rb +17 -0
- data/lib/ops_manager_ui_drivers/version15/networks.rb +55 -0
- data/lib/ops_manager_ui_drivers/version15/ops_manager_director.rb +261 -0
- data/lib/ops_manager_ui_drivers/version15/product_availability_zones.rb +38 -0
- data/lib/ops_manager_ui_drivers/version15/product_configuration.rb +34 -0
- data/lib/ops_manager_ui_drivers/version15/product_dashboard.rb +176 -0
- data/lib/ops_manager_ui_drivers/version15/product_form.rb +47 -0
- data/lib/ops_manager_ui_drivers/version15/product_logs.rb +38 -0
- data/lib/ops_manager_ui_drivers/version15/product_resource_configuration.rb +63 -0
- data/lib/ops_manager_ui_drivers/version15/product_status_helper.rb +64 -0
- data/lib/ops_manager_ui_drivers/version15/setup.rb +44 -0
- data/lib/ops_manager_ui_drivers/version15/state_change_progress.rb +43 -0
- data/lib/ops_manager_ui_drivers/version15/web_ui.rb +104 -0
- data/lib/ops_manager_ui_drivers/wait_helper.rb +51 -0
- data/ops_manager_ui_drivers.gemspec +29 -0
- metadata +233 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 1f4fba0e86d22ba2395324ea106039c41ff3b3b8
|
|
4
|
+
data.tar.gz: 5654698640617e9e430a01c432839b0ff377e97a
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: fae9036434da361251fdf3174589a53a272140891fa004947cf53bf03609a201f80f474ea49bd3a999a7e1ed95dd57b4ac2f72fe28f7484d31f1b6f87d280f2d
|
|
7
|
+
data.tar.gz: 8d016b9919d904d99fa4fc5d2a16b14bc0fb3c185cf78c61606c21172fd3828880504a62b7f08c5a5929768eed539dc198f85e811775bac81c473a3063a5b4dd
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2015 Pivotal, Inc.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
data/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# OpsManagerUiDrivers
|
|
2
|
+
|
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ops_manager_ui_drivers`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
+
|
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your application's Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem 'ops_manager_ui_drivers'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And then execute:
|
|
16
|
+
|
|
17
|
+
$ bundle
|
|
18
|
+
|
|
19
|
+
Or install it yourself as:
|
|
20
|
+
|
|
21
|
+
$ gem install ops_manager_ui_drivers
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
TODO: Write usage instructions here
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
|
+
|
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
|
+
|
|
33
|
+
## Contributing
|
|
34
|
+
|
|
35
|
+
1. Fork it ( https://github.com/pivotal-cf-experimental/ops_manager_ui_drivers/fork )
|
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
require 'rspec/core/rake_task'
|
|
3
|
+
require 'rubocop/rake_task'
|
|
4
|
+
|
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
6
|
+
|
|
7
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
|
8
|
+
t.options << '--lint'
|
|
9
|
+
t.options << '--display-cop-names'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
task default: [:rubocop, :spec]
|
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
require 'ops_manager_ui_drivers'
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require 'irb'
|
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/ci/run_specs.sh
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -ex
|
|
3
|
+
|
|
4
|
+
echo "-----> Running script: $0"
|
|
5
|
+
|
|
6
|
+
docker run \
|
|
7
|
+
--rm=true \
|
|
8
|
+
--volume=${PWD}:/ops_manager_ui_drivers \
|
|
9
|
+
--workdir=/ops_manager_ui_drivers \
|
|
10
|
+
${DOCKER_REGISTRY}/${DOCKER_IMAGE_NAME} \
|
|
11
|
+
/bin/sh -c 'bundle && bundle exec rake -t'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Dir[File.join(__dir__, '**', '*.rb')].each do |ops_manager_ui_drivers|
|
|
2
|
+
require ops_manager_ui_drivers
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
module OpsManagerUiDrivers
|
|
6
|
+
AWS_IAAS_TYPE = 'aws'.freeze
|
|
7
|
+
OPENSTACK_IAAS_TYPE = 'openstack'.freeze
|
|
8
|
+
VCLOUD_IAAS_TYPE = 'vcloud'.freeze
|
|
9
|
+
VSPHERE_IAAS_TYPE = 'vsphere'.freeze
|
|
10
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require 'ops_manager_ui_drivers/wait_helper'
|
|
2
|
+
|
|
3
|
+
module OpsManagerUiDrivers
|
|
4
|
+
module PageHelpers
|
|
5
|
+
include OpsManagerUiDrivers::WaitHelper
|
|
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
|
+
def om_1_3(ops_manager_url)
|
|
16
|
+
@om_1_3 ||= create_web_ui(ops_manager_url, Version13)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def om_1_4(ops_manager_url)
|
|
20
|
+
@om_1_4 ||= create_web_ui(ops_manager_url, Version14)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def om_rc(ops_manager_url)
|
|
24
|
+
@om_1_5 ||= create_web_ui(ops_manager_url, Version15)
|
|
25
|
+
end
|
|
26
|
+
|
|
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
|
+
def api_1_3(host:, username:, password:)
|
|
36
|
+
Version13::Api.new(host: host, user: username, password: password)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def api_1_4(host:, username:, password:)
|
|
40
|
+
Version14::Api.new(host: host, user: username, password: password)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def create_web_ui(ops_manager_url, version_module)
|
|
46
|
+
Capybara.app_host = ops_manager_url
|
|
47
|
+
page.driver.allow_url(Capybara.app_host)
|
|
48
|
+
puts "Preparing to interact with #{version_module.inspect} at #{Capybara.app_host}"
|
|
49
|
+
version_module::WebUi.new(browser: self)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
|
@@ -0,0 +1,24 @@
|
|
|
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-configure-#{product_name}-action").any?
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
attr_reader :browser
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|