ops_manager_ui_drivers 2.0.0 → 2.0.2

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: e7286d612b2128a4a6b9366524759bac3548e38c
4
- data.tar.gz: c48113714c723739253939906847a06900159360
3
+ metadata.gz: 209b6508cf051baff7f2a3fa34fbfeb60b0907bd
4
+ data.tar.gz: 1015bf9ad7181603c5b4f87a7c7bdeec8f0a91be
5
5
  SHA512:
6
- metadata.gz: ef1f9389c7e24a0d48024e3c4b64687974017701da651cc2c6fe547ae49b728661969ff5f48ee208f16ac1012dd5af5bbe08cce6b06b5f4bb02b7ef3fe60c045
7
- data.tar.gz: 3b5c711c002780cab1738977b107291c636c02c607df8a8f8228eccb21ddda93f684ad432a8b8d3e004fc9bea5c438a7d6bd471cf49e2fbce4f3fbef904c3e12
6
+ metadata.gz: c882661d818e490db4e04cb6337ffb4d030d958f0b486b17e964146a3bcdc41519a546f92a215953ae651f6f4d826600cb23fded777aa9d89422ec7b0e44ddc0
7
+ data.tar.gz: fb8b9c48ef46dfabab4300218ee0b19928b56137a2ec2dac90c9a839eb0c23e5039ab597e6e9ddd89cb7b1b45041c27f7eee972b1b669f610e6dd36125cb899c
data/.travis.yml CHANGED
@@ -1 +1,4 @@
1
1
  language: ruby
2
+ rvm:
3
+ - 2.3.0
4
+ - 2.1.0
@@ -0,0 +1,34 @@
1
+ module OpsManagerUiDrivers
2
+ module BackportRefinements
3
+ def self.should_refine?
4
+ Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.3.0")
5
+ end
6
+
7
+ def self.ported_dig(obj, indices)
8
+ head = indices.first
9
+ new_obj = obj[head]
10
+ if indices.count == 1
11
+ new_obj
12
+ else
13
+ tail = indices[1..-1]
14
+ ported_dig(new_obj, tail)
15
+ end
16
+ end
17
+
18
+ refine Array do
19
+ next unless BackportRefinements.should_refine?
20
+
21
+ def dig(*indices)
22
+ BackportRefinements.ported_dig(self, indices)
23
+ end
24
+ end
25
+
26
+ refine Hash do
27
+ next unless BackportRefinements.should_refine?
28
+
29
+ def dig(*indices)
30
+ BackportRefinements.ported_dig(self, indices)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,5 +1,7 @@
1
1
  require 'active_support'
2
2
  require 'active_support/core_ext'
3
+ require 'backport_refinements'
4
+
3
5
  Dir[File.join(__dir__, '**', '*.rb')].each do |ops_manager_ui_drivers|
4
6
  require ops_manager_ui_drivers
5
7
  end
@@ -1,3 +1,3 @@
1
1
  module OpsManagerUiDrivers
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.2'
3
3
  end
@@ -1,3 +1,4 @@
1
+ using OpsManagerUiDrivers::BackportRefinements
1
2
  module OpsManagerUiDrivers
2
3
  module Version14
3
4
  class OpsManagerDirector
@@ -73,9 +74,9 @@ module OpsManagerUiDrivers
73
74
  end
74
75
 
75
76
  def add_networks(test_settings)
76
- iaas_networks = test_settings.ops_manager.networks
77
+ iaas_networks = test_settings.dig('ops_manager', 'networks')
77
78
 
78
- case test_settings.iaas_type
79
+ case test_settings.dig('iaas_type')
79
80
  when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE then
80
81
  first_network = iaas_networks.first
81
82
  browser.click_on 'show-network-action'
@@ -148,11 +149,10 @@ module OpsManagerUiDrivers
148
149
  end
149
150
 
150
151
  def assign_networks(ops_manager)
151
- if ops_manager.vcenter
152
+ if ops_manager.dig('vcenter')
152
153
  deployment_network = ops_manager.dig('networks', 0)
153
-
154
154
  infrastructure_network =
155
- ops_manager.networks[1] ? ops_manager.dig('networks', 1) : ops_manager.dig('networks', 0)
155
+ ops_manager.dig('networks', 1) ? ops_manager.dig('networks', 1) : ops_manager.dig('networks', 0)
156
156
 
157
157
  assign_networks_vsphere(
158
158
  deployment_network: deployment_network['name'],
@@ -1,3 +1,4 @@
1
+ using OpsManagerUiDrivers::BackportRefinements
1
2
  module OpsManagerUiDrivers
2
3
  module Version15
3
4
  class OpsManagerDirector
@@ -71,26 +72,26 @@ module OpsManagerUiDrivers
71
72
 
72
73
  def config_director(ops_manager)
73
74
  browser.click_on 'Director Config'
74
- browser.fill_in('director_configuration[ntp_servers_string]', with: ops_manager.ntp_servers)
75
- browser.check('Enable VM Resurrector Plugin') if ops_manager.resurrector_enabled
75
+ browser.fill_in('director_configuration[ntp_servers_string]', with: ops_manager.dig('ntp_servers'))
76
+ browser.check('Enable VM Resurrector Plugin') if ops_manager.dig('resurrector_enabled')
76
77
 
77
- s3_blobstore = ops_manager.s3_blobstore
78
+ s3_blobstore = ops_manager.dig('s3_blobstore')
78
79
  if s3_blobstore
79
80
  browser.choose('S3 Compatible Blobstore')
80
- browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.endpoint)
81
- browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.bucket_name)
82
- browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.access_key_id)
83
- browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.secret_access_key)
81
+ browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.dig('endpoint'))
82
+ browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.dig('bucket_name'))
83
+ browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.dig('access_key_id'))
84
+ browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.dig('secret_access_key'))
84
85
  end
85
86
 
86
- mysql = ops_manager.mysql
87
+ mysql = ops_manager.dig('mysql')
87
88
  if mysql
88
89
  browser.choose('External MySQL Database')
89
- browser.fill_in('director_configuration[external_database_options][host]', with: mysql.host)
90
- browser.fill_in('director_configuration[external_database_options][port]', with: mysql.port)
91
- browser.fill_in('director_configuration[external_database_options][user]', with: mysql.user)
92
- browser.fill_in('director_configuration[external_database_options][password]', with: mysql.password)
93
- browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dbname)
90
+ browser.fill_in('director_configuration[external_database_options][host]', with: mysql.dig('host'))
91
+ browser.fill_in('director_configuration[external_database_options][port]', with: mysql.dig('port'))
92
+ browser.fill_in('director_configuration[external_database_options][user]', with: mysql.dig('user'))
93
+ browser.fill_in('director_configuration[external_database_options][password]', with: mysql.dig('password'))
94
+ browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dig('dbname'))
94
95
  end
95
96
 
96
97
  browser.click_on 'Save'
@@ -111,18 +112,18 @@ module OpsManagerUiDrivers
111
112
  end
112
113
 
113
114
  def assign_networks(ops_manager)
114
- if ops_manager.vcenter
115
- deployment_network = ops_manager.networks[0]
115
+ if ops_manager.dig('vcenter')
116
+ deployment_network = ops_manager.dig('networks', 0)
116
117
 
117
118
  infrastructure_network =
118
- ops_manager.networks[1] ? ops_manager.networks[1] : ops_manager.networks[0]
119
+ ops_manager.dig('networks', 1) ? ops_manager.dig('networks', 1) : ops_manager.dig('networks', 0)
119
120
 
120
121
  assign_networks_vsphere(
121
122
  infrastructure_network: infrastructure_network['name'],
122
123
  deployment_network: deployment_network['name'],
123
124
  )
124
125
  else
125
- assign_network(deployment_network: ops_manager.networks[0]['name'])
126
+ assign_network(deployment_network: ops_manager.dig('networks', 0, 'name'))
126
127
  end
127
128
  end
128
129
 
@@ -7,8 +7,10 @@ module OpsManagerUiDrivers
7
7
  open_dashboard
8
8
  browser.click_on 'toggle-installation-dropdown-action'
9
9
  browser.click_on 'show-settings'
10
- browser.click_on 'close-warning'
11
- browser.expect(browser.page).to_not browser.have_selector('#close-warning', visible: true)
10
+ browser.page.document.synchronize do
11
+ browser.click_on 'close-warning'
12
+ browser.find('#warning-modal[aria-hidden=true]')
13
+ end
12
14
  browser.attach_file 'import[file]', file_path
13
15
  browser.click_on 'import-settings'
14
16
  browser.poll_up_to_times(20) { browser.assert_text('Successfully imported installation.') }
@@ -1,3 +1,4 @@
1
+ using OpsManagerUiDrivers::BackportRefinements
1
2
  module OpsManagerUiDrivers
2
3
  module Version15
3
4
  module Settings
@@ -1,3 +1,4 @@
1
+ using OpsManagerUiDrivers::BackportRefinements
1
2
  module OpsManagerUiDrivers
2
3
  module Version16
3
4
  class OpsManagerDirector
@@ -43,9 +44,9 @@ module OpsManagerUiDrivers
43
44
  end
44
45
 
45
46
  def add_networks(test_settings)
46
- iaas_networks = test_settings.ops_manager.networks
47
+ iaas_networks = test_settings.dig('ops_manager', 'networks')
47
48
 
48
- case test_settings.iaas_type
49
+ case test_settings.dig('iaas_type')
49
50
  when OpsManagerUiDrivers::AWS_IAAS_TYPE, OpsManagerUiDrivers::OPENSTACK_IAAS_TYPE
50
51
  first_network = iaas_networks.first
51
52
 
@@ -73,26 +74,26 @@ module OpsManagerUiDrivers
73
74
 
74
75
  def config_director(ops_manager)
75
76
  browser.click_on 'Director Config'
76
- browser.fill_in('director_configuration[ntp_servers_string]', with: ops_manager.ntp_servers)
77
- browser.check('Enable VM Resurrector Plugin') if ops_manager.resurrector_enabled
77
+ browser.fill_in('director_configuration[ntp_servers_string]', with: ops_manager.dig('ntp_servers'))
78
+ browser.check('Enable VM Resurrector Plugin') if ops_manager.dig('resurrector_enabled')
78
79
 
79
- s3_blobstore = ops_manager.s3_blobstore
80
+ s3_blobstore = ops_manager.dig('s3_blobstore')
80
81
  if s3_blobstore
81
82
  browser.choose('S3 Compatible Blobstore')
82
- browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.endpoint)
83
- browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.bucket_name)
84
- browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.access_key_id)
85
- browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.secret_access_key)
83
+ browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.dig('endpoint'))
84
+ browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.dig('bucket_name'))
85
+ browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.dig('access_key_id'))
86
+ browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.dig('secret_access_key'))
86
87
  end
87
88
 
88
- mysql = ops_manager.mysql
89
+ mysql = ops_manager.dig('mysql')
89
90
  if mysql
90
91
  browser.choose('External MySQL Database')
91
- browser.fill_in('director_configuration[external_database_options][host]', with: mysql.host)
92
- browser.fill_in('director_configuration[external_database_options][port]', with: mysql.port)
93
- browser.fill_in('director_configuration[external_database_options][user]', with: mysql.user)
94
- browser.fill_in('director_configuration[external_database_options][password]', with: mysql.password)
95
- browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dbname)
92
+ browser.fill_in('director_configuration[external_database_options][host]', with: mysql.dig('host'))
93
+ browser.fill_in('director_configuration[external_database_options][port]', with: mysql.dig('port'))
94
+ browser.fill_in('director_configuration[external_database_options][user]', with: mysql.dig('user'))
95
+ browser.fill_in('director_configuration[external_database_options][password]', with: mysql.dig('password'))
96
+ browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dig('dbname'))
96
97
  end
97
98
 
98
99
  browser.click_on 'Save'
@@ -113,15 +114,15 @@ module OpsManagerUiDrivers
113
114
  end
114
115
 
115
116
  def assign_networks(ops_manager)
116
- if ops_manager.vcenter
117
- network = ops_manager.networks[0]
117
+ if ops_manager.dig('vcenter')
118
+ network = ops_manager.dig('networks', 0)
118
119
 
119
120
  assign_networks_vsphere(
120
- infrastructure_network: network['name'],
121
- deployment_network: network['name'],
121
+ infrastructure_network: network.dig('name'),
122
+ deployment_network: network.dig('name'),
122
123
  )
123
124
  else
124
- assign_network(deployment_network: ops_manager.networks[0]['name'])
125
+ assign_network(deployment_network: ops_manager.dig('networks', 0, 'name'))
125
126
  end
126
127
  end
127
128
 
@@ -1,3 +1,4 @@
1
+ using OpsManagerUiDrivers::BackportRefinements
1
2
  module OpsManagerUiDrivers
2
3
  module Version16
3
4
  module Settings
@@ -1,3 +1,5 @@
1
+ using OpsManagerUiDrivers::BackportRefinements
2
+
1
3
  module OpsManagerUiDrivers
2
4
  module Version17
3
5
  class OpsManagerDirector
@@ -67,20 +69,20 @@ module OpsManagerUiDrivers
67
69
  s3_blobstore = ops_manager.dig('s3_blobstore')
68
70
  if s3_blobstore
69
71
  browser.choose('S3 Compatible Blobstore')
70
- browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.endpoint)
71
- browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.bucket_name)
72
- browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.access_key_id)
73
- browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.secret_access_key)
72
+ browser.fill_in('director_configuration[s3_blobstore_options][endpoint]', with: s3_blobstore.dig('endpoint'))
73
+ browser.fill_in('director_configuration[s3_blobstore_options][bucket_name]', with: s3_blobstore.dig('bucket_name'))
74
+ browser.fill_in('director_configuration[s3_blobstore_options][access_key]', with: s3_blobstore.dig('access_key_id'))
75
+ browser.fill_in('director_configuration[s3_blobstore_options][secret_key]', with: s3_blobstore.dig('secret_access_key'))
74
76
  end
75
77
 
76
78
  mysql = ops_manager.dig('mysql')
77
79
  if mysql
78
80
  browser.choose('External MySQL Database')
79
- browser.fill_in('director_configuration[external_database_options][host]', with: mysql.host)
80
- browser.fill_in('director_configuration[external_database_options][port]', with: mysql.port)
81
- browser.fill_in('director_configuration[external_database_options][user]', with: mysql.user)
82
- browser.fill_in('director_configuration[external_database_options][password]', with: mysql.password)
83
- browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dbname)
81
+ browser.fill_in('director_configuration[external_database_options][host]', with: mysql.dig('host'))
82
+ browser.fill_in('director_configuration[external_database_options][port]', with: mysql.dig('port'))
83
+ browser.fill_in('director_configuration[external_database_options][user]', with: mysql.dig('user'))
84
+ browser.fill_in('director_configuration[external_database_options][password]', with: mysql.dig('password'))
85
+ browser.fill_in('director_configuration[external_database_options][database]', with: mysql.dig('dbname'))
84
86
  end
85
87
 
86
88
  browser.click_on 'Save'
@@ -1,3 +1,5 @@
1
+ using OpsManagerUiDrivers::BackportRefinements
2
+
1
3
  module OpsManagerUiDrivers
2
4
  module Version17
3
5
  module Settings
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: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-08 00:00:00.000000000 Z
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -182,6 +182,7 @@ files:
182
182
  - bin/console
183
183
  - bin/setup
184
184
  - ci/run_specs.sh
185
+ - lib/backport_refinements.rb
185
186
  - lib/ops_manager_ui_drivers.rb
186
187
  - lib/ops_manager_ui_drivers/logger.rb
187
188
  - lib/ops_manager_ui_drivers/page_helpers.rb