ops_manager_ui_drivers 1.9.3 → 1.9.4

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: 4f510acbdcf2d2aeb6537e4b179dce9576cfb126
4
- data.tar.gz: 2c3eef6b7e094a9e9639698a872b1d5c230fb890
3
+ metadata.gz: 20692b4303a44d1a543adf9a800ba52c7385344b
4
+ data.tar.gz: 5d1750398c52a38e5a0858be553e86dab731a0ec
5
5
  SHA512:
6
- metadata.gz: 3f24e839459606a081a67560fce35b84d0309874d00888fb1d65cc373ae25423040c4a91c66c3b09aa285b5bf7e2d074760a3d778aa1e0e63136a5f78d9c537e
7
- data.tar.gz: d63ba52c09622e244cb80cf56e222082013f59deeb1ebfc1d85e7fa509f503633a2bc0b4dc33e186e844fdb72c2f1ea6cd3c21793453ca253127db8dedbe0d82
6
+ metadata.gz: 62edb549cf1916a2164cc5b5b0d20edeaeafd9ab934b5e149ed530d8eb46dcb2b6b173b67e74053fd3111329bb9518818d359ef598d4e7c8a66c57f54c40f165
7
+ data.tar.gz: 31cca4d1d8c8cf7726565f81c2d7ac831d37b1d5b70f635ab52ee02046ca7f331efebe35b4471fbeb2d528277cfb689f0420b2f8bbf411b11903681bd79ae1fd
@@ -1,3 +1,3 @@
1
1
  module OpsManagerUiDrivers
2
- VERSION = '1.9.3'
2
+ VERSION = '1.9.4'
3
3
  end
@@ -106,6 +106,7 @@ module OpsManagerUiDrivers
106
106
  end
107
107
 
108
108
  def revert_available?
109
+ open_dashboard
109
110
  browser.all('#open-revert-installation-modal-action').any?
110
111
  end
111
112
 
@@ -122,7 +123,14 @@ module OpsManagerUiDrivers
122
123
  end
123
124
 
124
125
  def nonignorable_verification_failed?
125
- browser.all('.flash-message.error').any? && browser.all('#ignore-install-action').empty?
126
+ result = browser.all('.flash-message.error').any? && browser.all('#ignore-install-action').empty?
127
+ if result
128
+ Logger.debug 'flash message errors; we expect these to be empty'
129
+ Logger.debug browser.all('.flash-message.error').pretty_print_inspect
130
+ Logger.debug 'ignore install action; we expect there to be one of these'
131
+ Logger.debug browser.all('#ignore-install-action').pretty_print_inspect
132
+ end
133
+ result
126
134
  end
127
135
 
128
136
  def allow_cpu_verification_errors
@@ -1,23 +1,8 @@
1
+ require 'ops_manager_ui_drivers/version14/product_dashboard'
2
+
1
3
  module OpsManagerUiDrivers
2
4
  module Version15
3
- class ProductDashboard
4
- def initialize(browser:)
5
- @browser = browser
6
- @allowed_ignorable_errors = []
7
- end
8
-
9
- def apply_updates
10
- open_dashboard
11
- browser.click_on 'install-action'
12
- fail 'Install failed verification' if nonignorable_verification_failed?
13
- allow_cpu_verification_errors
14
- allow_privilege_verification_errors
15
- allow_icmp_verification_errors #this is only for AWS; consider moving out
16
-
17
- ignore_allowable_errors
18
- assert_installation_started
19
- end
20
-
5
+ class ProductDashboard < Version14::ProductDashboard
21
6
  def import_installation_file(file_path)
22
7
  open_dashboard
23
8
  browser.click_on 'toggle-installation-dropdown-action'
@@ -28,88 +13,16 @@ module OpsManagerUiDrivers
28
13
  browser.poll_up_to_times(20) { browser.assert_text('Successfully imported installation.') }
29
14
  end
30
15
 
31
- def upgrade_microbosh
32
- open_dashboard
33
- browser.find('p', text: 'Ops Manager Director').trigger(:mouseover)
34
- browser.click_on 'upgrade-microbosh'
35
- end
36
-
37
- def delete_product(product_name)
38
- open_dashboard
39
- browser.click_on "open-delete-#{product_name}-modal"
40
- wait_for_modal_css_transition_to_complete
41
- browser.click_on "delete-#{product_name}-action"
42
- end
43
-
44
16
  def product_on_dashboard?(product_name)
45
17
  open_dashboard
46
18
  browser.all("a#show-#{product_name}-configure-action").any?
47
19
  end
48
20
 
49
- def import_product_from(full_path)
50
- open_dashboard
51
- browser.attach_file('component_add[file]', full_path, {visible: false})
52
- end
53
-
54
- def product_available?(product_name, product_version)
55
- open_dashboard
56
- browser.all("li.#{product_name} input#component_version[value='#{product_version}']", {visible: false}).any?
57
- end
58
-
59
21
  def product_complete?(product_name)
60
22
  open_dashboard
61
23
  browser.all("a#show-#{product_name}-configure-action[data-progress='100']").any?
62
24
  end
63
25
 
64
- def upgrade_product(product_name)
65
- open_dashboard
66
- browser.find(".product.#{product_name} p").trigger(:mouseover)
67
- browser.click_on "upgrade-#{product_name}"
68
- expect_no_flash_errors
69
- end
70
-
71
- def version_for_product(product_name)
72
- open_dashboard
73
- browser.find("#show-#{product_name}-configure-action .version").text
74
- end
75
-
76
- def delete_whole_installation
77
- open_dashboard
78
- browser.click_on 'toggle-installation-dropdown-action'
79
- browser.click_on 'show-delete-installation-modal-action'
80
- wait_for_modal_css_transition_to_complete
81
- browser.click_on 'delete-installation-action'
82
- apply_updates
83
- end
84
-
85
- def wait_for_installation_to_be_deleted
86
- browser.poll_up_to_mins(10) do
87
- open_dashboard
88
- assert_install_action_disabled
89
- end
90
- end
91
-
92
- def delete_installation_available?
93
- open_dashboard
94
- browser.click_on 'toggle-installation-dropdown-action'
95
- browser.all('#show-delete-installation-modal-action').any?
96
- end
97
-
98
- def deletion_in_progress?
99
- open_dashboard
100
- browser.all('#delete-in-progress-marker').any?
101
- end
102
-
103
- def reset_state(ops_manager)
104
- revert_pending_changes if revert_available?
105
- if delete_installation_available?
106
- delete_whole_installation
107
- browser.poll_up_to_mins(15) do
108
- browser.expect(ops_manager.state_change_progress).to browser.be_state_change_success
109
- end
110
- end
111
- end
112
-
113
26
  def most_recent_install_log
114
27
  open_dashboard
115
28
  if browser.all('#installation-logs li a', visible: false).any?
@@ -119,79 +32,13 @@ module OpsManagerUiDrivers
119
32
  end
120
33
  end
121
34
 
122
- def revert_pending_changes
123
- open_dashboard
124
- browser.click_on 'open-revert-installation-modal-action'
125
- wait_for_modal_css_transition_to_complete
126
- browser.click_on 'revert-installation-action'
127
- end
128
-
129
- def revert_available?
130
- open_dashboard
131
- browser.all('#open-revert-installation-modal-action').any?
132
- end
133
-
134
35
  private
135
36
 
136
- attr_reader :browser
137
-
138
- def assert_install_action_disabled
139
- browser.expect(browser.page).to browser.have_css('#install-action.disabled')
140
- end
141
-
142
- def assert_installation_started
143
- browser.expect(browser.page).to browser.have_text('Applying Changes')
144
- end
145
-
146
- def nonignorable_verification_failed?
147
- browser.all('.flash-message.error').any? && browser.all('#ignore-install-action').empty?
148
- end
149
-
150
- def allow_cpu_verification_errors
151
- return if @allowed_ignorable_errors.include?(/Installation requires \d+ CPU cores/)
152
-
153
- @allowed_ignorable_errors << /Installation requires \d+ CPU cores/
154
- end
155
-
156
37
  def allow_privilege_verification_errors
157
38
  return if @allowed_ignorable_errors.include?(/required datacenter privileges/i)
158
39
 
159
40
  @allowed_ignorable_errors << /required datacenter privileges/i
160
41
  end
161
-
162
- def allow_icmp_verification_errors
163
- return if @allowed_ignorable_errors.include?(/ignorable if ICMP is disabled/i)
164
-
165
- @allowed_ignorable_errors << /ignorable if ICMP is disabled/i
166
- end
167
-
168
- def ignore_allowable_errors
169
- flash_errors = browser.all('.flash-message.error')
170
-
171
- if flash_errors.any?
172
- unexpected_errors = flash_errors.reject do |error|
173
- @allowed_ignorable_errors.select do |expected_error|
174
- error.text =~ expected_error
175
- end.any?
176
- end
177
-
178
- browser.click_on 'ignore-install-action' if unexpected_errors.empty?
179
- end
180
- end
181
-
182
- def expect_no_flash_errors
183
- if (flash_error = browser.all('.flash-message.error').first)
184
- fail flash_error.text
185
- end
186
- end
187
-
188
- def wait_for_modal_css_transition_to_complete
189
- sleep 5 # Have to wait for the CSS shade effect
190
- end
191
-
192
- def open_dashboard
193
- browser.visit '/'
194
- end
195
42
  end
196
43
  end
197
44
  end
@@ -1,190 +1,10 @@
1
+ require 'ops_manager_ui_drivers/version15/product_dashboard'
2
+
1
3
  module OpsManagerUiDrivers
2
4
  module Version16
3
- class ProductDashboard
4
- def initialize(browser:)
5
- @browser = browser
6
- @allowed_ignorable_errors = []
7
- end
8
-
9
- def apply_updates
10
- open_dashboard
11
- browser.click_on 'install-action'
12
- fail 'Install failed verification' if nonignorable_verification_failed?
13
- allow_cpu_verification_errors
14
- allow_privilege_verification_errors
15
- allow_icmp_verification_errors #this is only for AWS; consider moving out
16
-
17
- ignore_allowable_errors
18
- assert_installation_started
19
- end
20
-
21
- def import_installation_file(file_path)
22
- open_dashboard
23
- browser.click_on 'toggle-installation-dropdown-action'
24
- browser.click_on 'show-settings'
25
- browser.click_on 'close-warning'
26
- browser.attach_file 'import[file]', file_path
27
- browser.click_on 'import-settings'
28
- browser.poll_up_to_times(20) { browser.assert_text('Successfully imported installation.') }
29
- end
30
-
31
- def delete_product(product_name)
32
- open_dashboard
33
- browser.click_on "open-delete-#{product_name}-modal"
34
- wait_for_modal_css_transition_to_complete
35
- browser.click_on "delete-#{product_name}-action"
36
- end
37
-
38
- def product_on_dashboard?(product_name)
39
- open_dashboard
40
- browser.all("a#show-#{product_name}-configure-action").any?
41
- end
42
-
43
- def import_product_from(full_path)
44
- open_dashboard
45
- browser.attach_file('component_add[file]', full_path, {visible: false})
46
- end
47
-
48
- def product_available?(product_name, product_version)
49
- open_dashboard
50
- browser.all("li.#{product_name} input#component_version[value='#{product_version}']", {visible: false}).any?
51
- end
52
-
53
- def product_complete?(product_name)
54
- open_dashboard
55
- browser.all("a#show-#{product_name}-configure-action[data-progress='100']").any?
56
- end
57
-
58
- def upgrade_product(product_name)
59
- open_dashboard
60
- browser.find(".product.#{product_name} p").trigger(:mouseover)
61
- browser.click_on "upgrade-#{product_name}"
62
- expect_no_flash_errors
63
- end
64
-
65
- def version_for_product(product_name)
66
- open_dashboard
67
- browser.find("#show-#{product_name}-configure-action .version").text
68
- end
69
-
70
- def delete_whole_installation
71
- open_dashboard
72
- browser.click_on 'toggle-installation-dropdown-action'
73
- browser.click_on 'show-delete-installation-modal-action'
74
- wait_for_modal_css_transition_to_complete
75
- browser.click_on 'delete-installation-action'
76
- apply_updates
77
- end
78
-
79
- def wait_for_installation_to_be_deleted
80
- browser.poll_up_to_mins(10) do
81
- open_dashboard
82
- assert_install_action_disabled
83
- end
84
- end
85
-
86
- def delete_installation_available?
87
- open_dashboard
88
- browser.click_on 'toggle-installation-dropdown-action'
89
- browser.all('#show-delete-installation-modal-action').any?
90
- end
91
-
92
- def deletion_in_progress?
93
- open_dashboard
94
- browser.all('#delete-in-progress-marker').any?
95
- end
96
-
97
- def reset_state(ops_manager)
98
- revert_pending_changes if revert_available?
99
- if delete_installation_available?
100
- delete_whole_installation
101
- browser.poll_up_to_mins(15) do
102
- browser.expect(ops_manager.state_change_progress).to browser.be_state_change_success
103
- end
104
- end
105
- end
106
-
107
- def most_recent_install_log
108
- open_dashboard
109
- if browser.all('#installation-logs li a', visible: false).any?
110
- base_url = browser.first('#installation-logs li a', visible: false)[:href]
111
- browser.visit "#{base_url}.text"
112
- browser.source
113
- end
114
- end
115
-
116
- def revert_pending_changes
117
- open_dashboard
118
- browser.click_on 'open-revert-installation-modal-action'
119
- wait_for_modal_css_transition_to_complete
120
- browser.click_on 'revert-installation-action'
121
- end
122
-
123
- def revert_available?
124
- open_dashboard
125
- browser.all('#open-revert-installation-modal-action').any?
126
- end
127
-
128
- private
129
-
130
- attr_reader :browser
131
-
132
- def assert_install_action_disabled
133
- browser.expect(browser.page).to browser.have_css('#install-action.disabled')
134
- end
135
-
136
- def assert_installation_started
137
- browser.expect(browser.page).to browser.have_text('Applying Changes')
138
- end
139
-
140
- def nonignorable_verification_failed?
141
- browser.all('.flash-message.error').any? && browser.all('#ignore-install-action').empty?
142
- end
143
-
144
- def allow_cpu_verification_errors
145
- return if @allowed_ignorable_errors.include?(/Installation requires \d+ CPU cores/)
146
-
147
- @allowed_ignorable_errors << /Installation requires \d+ CPU cores/
148
- end
149
-
150
- def allow_privilege_verification_errors
151
- return if @allowed_ignorable_errors.include?(/required datacenter privileges/i)
152
-
153
- @allowed_ignorable_errors << /required datacenter privileges/i
154
- end
155
-
156
- def allow_icmp_verification_errors
157
- return if @allowed_ignorable_errors.include?(/ignorable if ICMP is disabled/i)
158
-
159
- @allowed_ignorable_errors << /ignorable if ICMP is disabled/i
160
- end
161
-
162
- def ignore_allowable_errors
163
- flash_errors = browser.all('.flash-message.error')
164
-
165
- if flash_errors.any?
166
- unexpected_errors = flash_errors.reject do |error|
167
- @allowed_ignorable_errors.select do |expected_error|
168
- error.text =~ expected_error
169
- end.any?
170
- end
171
-
172
- browser.click_on 'ignore-install-action' if unexpected_errors.empty?
173
- end
174
- end
175
-
176
- def expect_no_flash_errors
177
- if (flash_error = browser.all('.flash-message.error').first)
178
- fail flash_error.text
179
- end
180
- end
181
-
182
- def wait_for_modal_css_transition_to_complete
183
- sleep 5 # Have to wait for the CSS shade effect
184
- end
185
-
186
- def open_dashboard
187
- browser.visit '/'
5
+ class ProductDashboard < Version15::ProductDashboard
6
+ def upgrade_microbosh
7
+ fail('No longer implemented in this version')
188
8
  end
189
9
  end
190
10
  end
@@ -1,191 +1,8 @@
1
+ require 'ops_manager_ui_drivers/version16/product_dashboard'
2
+
1
3
  module OpsManagerUiDrivers
2
4
  module Version17
3
- class ProductDashboard
4
- def initialize(browser:)
5
- @browser = browser
6
- @allowed_ignorable_errors = []
7
- end
8
-
9
- def apply_updates
10
- open_dashboard
11
- browser.click_on 'install-action'
12
- fail 'Install failed verification' if nonignorable_verification_failed?
13
- allow_cpu_verification_errors
14
- allow_privilege_verification_errors
15
- allow_icmp_verification_errors #this is only for AWS; consider moving out
16
-
17
- ignore_allowable_errors
18
- assert_installation_started
19
- end
20
-
21
- def import_installation_file(file_path)
22
- open_dashboard
23
- browser.click_on 'toggle-installation-dropdown-action'
24
- browser.click_on 'show-settings'
25
- browser.click_on 'close-warning'
26
- browser.attach_file 'import[file]', file_path
27
- browser.click_on 'import-settings'
28
- browser.poll_up_to_times(20) { browser.assert_text('Successfully imported installation.') }
29
- end
30
-
31
- def delete_product(product_name)
32
- open_dashboard
33
- browser.click_on "open-delete-#{product_name}-modal"
34
- wait_for_modal_css_transition_to_complete
35
- browser.click_on "delete-#{product_name}-action"
36
- end
37
-
38
- def product_on_dashboard?(product_name)
39
- open_dashboard
40
- browser.all("a#show-#{product_name}-configure-action").any?
41
- end
42
-
43
- def import_product_from(full_path)
44
- open_dashboard
45
- browser.attach_file('component_add[file]', full_path, {visible: false})
46
- end
47
-
48
- def product_available?(product_name, product_version)
49
- open_dashboard
50
- browser.all("li.#{product_name} input#component_version[value='#{product_version}']", {visible: false}).any?
51
- end
52
-
53
- def product_complete?(product_name)
54
- open_dashboard
55
- browser.all("a#show-#{product_name}-configure-action[data-progress='100']").any?
56
- end
57
-
58
- def upgrade_product(product_name)
59
- open_dashboard
60
- browser.find(".product.#{product_name} p").trigger(:mouseover)
61
- browser.click_on "upgrade-#{product_name}"
62
- expect_no_flash_errors
63
- end
64
-
65
- def version_for_product(product_name)
66
- open_dashboard
67
- browser.find("#show-#{product_name}-configure-action .version").text
68
- end
69
-
70
- def delete_whole_installation
71
- open_dashboard
72
- browser.click_on 'toggle-installation-dropdown-action'
73
- browser.click_on 'show-delete-installation-modal-action'
74
- wait_for_modal_css_transition_to_complete
75
- browser.click_on 'delete-installation-action'
76
- apply_updates
77
- end
78
-
79
- def wait_for_installation_to_be_deleted
80
- browser.poll_up_to_mins(10) do
81
- open_dashboard
82
- assert_install_action_disabled
83
- end
84
- end
85
-
86
- def delete_installation_available?
87
- open_dashboard
88
- browser.click_on 'toggle-installation-dropdown-action'
89
- browser.all('#show-delete-installation-modal-action').any?
90
- end
91
-
92
- def deletion_in_progress?
93
- open_dashboard
94
- browser.all('#delete-in-progress-marker').any?
95
- end
96
-
97
- def reset_state(ops_manager)
98
- revert_pending_changes if revert_available?
99
- if delete_installation_available?
100
- delete_whole_installation
101
- browser.poll_up_to_mins(15) do
102
- browser.expect(ops_manager.state_change_progress).to browser.be_state_change_success
103
- end
104
- end
105
- end
106
-
107
- def most_recent_install_log
108
- open_dashboard
109
- if browser.all('#installation-logs li a', visible: false).any?
110
- base_url = browser.first('#installation-logs li a', visible: false)[:href]
111
- browser.visit "#{base_url}.text"
112
- browser.source
113
- end
114
- end
115
-
116
- def revert_pending_changes
117
- open_dashboard
118
- browser.click_on 'open-revert-installation-modal-action'
119
- wait_for_modal_css_transition_to_complete
120
- browser.click_on 'revert-installation-action'
121
- end
122
-
123
- def revert_available?
124
- open_dashboard
125
- browser.all('#open-revert-installation-modal-action').any?
126
- end
127
-
128
- private
129
-
130
- attr_reader :browser
131
-
132
- def assert_install_action_disabled
133
- browser.expect(browser.page).to browser.have_css('#install-action.disabled')
134
- end
135
-
136
- def assert_installation_started
137
- browser.expect(browser.page).to browser.have_text('Applying Changes')
138
- end
139
-
140
- def nonignorable_verification_failed?
141
- browser.all('.flash-message.error').any? && browser.all('#ignore-install-action').empty?
142
- end
143
-
144
- def allow_cpu_verification_errors
145
- return if @allowed_ignorable_errors.include?(/Installation requires \d+ CPU cores/)
146
-
147
- @allowed_ignorable_errors << /Installation requires \d+ CPU cores/
148
- end
149
-
150
- def allow_privilege_verification_errors
151
- return if @allowed_ignorable_errors.include?(/required datacenter privileges/i)
152
-
153
- @allowed_ignorable_errors << /required datacenter privileges/i
154
- end
155
-
156
- def allow_icmp_verification_errors
157
- return if @allowed_ignorable_errors.include?(/ignorable if ICMP is disabled/i)
158
-
159
- @allowed_ignorable_errors << /ignorable if ICMP is disabled/i
160
- end
161
-
162
- def ignore_allowable_errors
163
- flash_errors = browser.all('.flash-message.error')
164
-
165
- if flash_errors.any?
166
- unexpected_errors = flash_errors.reject do |error|
167
- @allowed_ignorable_errors.select do |expected_error|
168
- error.text =~ expected_error
169
- end.any?
170
- end
171
-
172
- browser.click_on 'ignore-install-action' if unexpected_errors.empty?
173
- end
174
- end
175
-
176
- def expect_no_flash_errors
177
- if (flash_error = browser.all('.flash-message.error').first)
178
- fail flash_error.text
179
- end
180
- end
181
-
182
- def wait_for_modal_css_transition_to_complete
183
- sleep 5 # Have to wait for the CSS shade effect
184
- end
185
-
186
- def open_dashboard
187
- browser.visit '/'
188
- end
5
+ class ProductDashboard < Version16::ProductDashboard
189
6
  end
190
7
  end
191
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ops_manager_ui_drivers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal, Inc.