blob: e1e96092405a4779b6d720a67fec89d71b700da2 [file] [log] [blame]
Sivas SRR008dcc62018-02-27 06:34:56 -06001*** Settings ***
2
3Documentation Test Open BMC GUI server health under GUI Header.
4
5Resource ../../lib/resource.robot
Rahul Maheshwarib89977a2019-02-05 00:21:48 -06006Resource ../../../lib/boot_utils.robot
7Resource ../../../lib/utils.robot
8Resource ../../../lib/openbmc_ffdc.robot
9Resource ../../../lib/state_manager.robot
10Resource ../../../lib/openbmc_ffdc_methods.robot
11Resource ../../../lib/dump_utils.robot
12Resource ../../../lib/logging_utils.robot
13Library ../../../lib/gen_robot_keyword.py
Sivas SRR008dcc62018-02-27 06:34:56 -060014
Sivas SRRbe026912018-03-14 11:33:02 -050015Test Setup Test Setup Execution
16Test Teardown Test Teardown Execution
17
Anusha Dathatrie9650a62019-11-15 04:02:24 -060018*** Variables ***
19
20${xpath_delete_remote_server} //*[@class="remote-logging-server"]//button[2]
21${xpath_add_server} //*[@class="remote-logging-server"]//button[1]
22${xpath_remote_server_ip} //input[@id="remoteServerIP"]
23${xpath_remote_server_port} //input[@id="remoteServerPort"]
Sivas SRR008dcc62018-02-27 06:34:56 -060024
25*** Test Cases ***
26
27Verify Event Log Text Appears By Clicking Server Health
28 [Documentation] Check that "Event Log" text appears by clicking server
29 ... health in GUI header.
30 [Tags] Verify_Event_Log_Text_Appears_By_Clicking_Server_Health
31
32 Wait Until Page Contains Element event-log
33 Page should contain Event log
34
35
36Verify Filters By Severity Elements Appears
Sivas SRR179208e2018-03-01 04:08:23 -060037 [Documentation] Check that the "event log" filters appears by clicking
38 ... server health in GUI header.
Sivas SRR008dcc62018-02-27 06:34:56 -060039 [Tags] Verify_Filters_By_Severity_Elements_Appears
40
41 # Types of event severity: All, High, Medium, Low.
42 Page Should Contain Element ${xpath_event_severity_all} limit=1
43 Page Should Contain Element ${xpath_event_severity_high} limit=1
44 Page Should Contain Element ${xpath_event_severity_medium} limit=1
45 Page Should Contain Element ${xpath_event_severity_low} limit=1
46
47
48Verify Drop Down Button User Timezone Appears
Sivas SRR179208e2018-03-01 04:08:23 -060049 [Documentation] Check that the "drop down" button of user timezone appears
50 ... by clicking server health in GUI header.
Sivas SRR008dcc62018-02-27 06:34:56 -060051 [Tags] Verify_Drop_Down_Button_User_Timezone_Appears
52
53 Page Should Contain Button ${xpath_drop_down_timezone_edt}
54 # Ensure that page is not in refreshing state.
55 # It helps to click the drop down element.
56 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Rahul Maheshwaribc7adca2018-11-26 01:13:41 -060057 Click Element //*[@class='dropdown__button']
Sivas SRR008dcc62018-02-27 06:34:56 -060058 Page Should Contain Button ${xpath_drop_down_timezone_utc}
59
Sivas SRR179208e2018-03-01 04:08:23 -060060
61Verify Content Search Element Appears
62 [Documentation] Check that the "event search element is available with
63 ... filter" button appears.
64 [Tags] Verify_Content_Search_Element_Appears
65
66 Page Should Contain Element content__search-input limit=1
67 # Ensure that page is not in refreshing state.
68 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
69 Page Should Contain Button content__search-submit
70
71
72Verify Filter By Date Element Appears
73 [Documentation] Check that the "filter by date" elements are available and
74 ... visible.
75 [Tags] Verify_Filter_By_Date_Element_Appears
76
77 Wait Until Element Is Visible event-filter-start-date
78 Page Should Contain Element event-filter-start-date limit=1
79 Page Should Contain Element event-filter-end-date limit=1
80
81
82Verify Filter By Event Status Element Appears
83 [Documentation] Check that the "filter by event status" element appears.
84 [Tags] Verify_Filter_By_Event_Status_Element_Appears
85
86 # Ensure that page is not in refreshing state.
87 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Rahul Maheshwaribc7adca2018-11-26 01:13:41 -060088 Wait Until Element is Visible //*[@class='dropdown__wrapper']
89 Click Element //*[@class='dropdown__wrapper']
Anusha Dathatricae580a2019-10-16 06:17:19 -050090 Page Should Contain Element ${xpath_event_filter_all} limit=2
Sivas SRR179208e2018-03-01 04:08:23 -060091 Page Should Contain Element ${xpath_event_filter_resolved} limit=1
92 Page Should Contain Element ${xpath_event_filter_unresolved} limit=1
Sivas SRR162bf482018-03-02 07:01:16 -060093
94
95Verify Event Action Bar Element Appears
96 [Documentation] Check that "event action bar" element appears.
97 [Tags] Verify_Event_Action_Bar_Element_Appears
98
99 # Ensure that page is not in refreshing state.
100 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
101 Page Should Contain Element ${xpath_event_action_bars} limit=1
Anusha Dathatricae580a2019-10-16 06:17:19 -0500102 Page Should Contain Element ${xpath_select_all_events}
Sivas SRR162bf482018-03-02 07:01:16 -0600103
104
105Verify Click Events Check Box
106 [Documentation] Check that "event check box" element appears and on click
107 ... should be able to see elements like "Delete" button and "Export"
108 ... element.
109 [Tags] Verify_Click_Events_Check_Box
110
Anusha Dathatricae580a2019-10-16 06:17:19 -0500111 Create Test Error Log
112 Click Element ${xpath_select_refresh_button}
Sivas SRR162bf482018-03-02 07:01:16 -0600113 # Ensure that page is not in refreshing state.
114 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Anusha Dathatricae580a2019-10-16 06:17:19 -0500115 Click Element ${xpath_select_all_events}
Sivas SRR162bf482018-03-02 07:01:16 -0600116 Page Should Contain Button ${xpath_event_action_delete} limit=1
117 Page Should Contain Element ${xpath_event_action_export} limit=1
118
119
120Verify Number of Events Appears
121 [Documentation] Check that "number of events" element appears and value is
122 ... visible.
123 [Tags] Verify_Number_of_Events_Appears
124
125 # Ensure that page is not in refreshing state.
126 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
127 Page Should Contain Element ${xpath_number_of_events}
128 ${number_of_events}= Get Text ${xpath_number_of_events}
129 Log To Console \n Number of Events:${number_of_events}
Sivas SRRbe026912018-03-14 11:33:02 -0500130
131
132Select All Error Logs And Mark As Resolved
133 [Documentation] Select all error logs and mark them as resolved.
134 [Tags] Select_All_Error_Logs_And_Mark_As_Resolved
135
136 Create Test Error Log
137 Create Test Error Log
Anusha Dathatricae580a2019-10-16 06:17:19 -0500138 Click Element ${xpath_select_refresh_button}
Sivas SRRbe026912018-03-14 11:33:02 -0500139 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
140 Page Should Contain Element ${xpath_number_of_events}
141 ${number_of_events}= Get Text ${xpath_number_of_events}
Anusha Dathatricae580a2019-10-16 06:17:19 -0500142 Click Element ${xpath_select_all_events}
Sivas SRRbe026912018-03-14 11:33:02 -0500143 Run Keyword If ${number_of_events} > 0
144 ... Click Element ${xpath_mark_as_resolved}
145 Element Should Be Disabled ${xpath_mark_as_resolved}
146
147
148Select All Error Logs And Click Export
149 [Documentation] Select all error logs and click export element.
150 [Tags] Select_All_Error_Logs_And_Click_Export
151
152 Create Test Error Log
153 Create Test Error Log
Anusha Dathatricae580a2019-10-16 06:17:19 -0500154 Click Element ${xpath_select_refresh_button}
Sivas SRRbe026912018-03-14 11:33:02 -0500155 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
156 Page Should Contain Element ${xpath_number_of_events}
157 ${number_of_events}= Get Text ${xpath_number_of_events}
Anusha Dathatricae580a2019-10-16 06:17:19 -0500158 Click Element ${xpath_select_all_events}
Sivas SRRbe026912018-03-14 11:33:02 -0500159 Page Should Contain Element ${xpath_events_export}
160 Run Keyword If ${number_of_events} > 0
161 ... Click Element ${xpath_events_export}
162
163
164Select All Error Logs And Delete
165 [Documentation] Select all error logs and delete them.
166 [Tags] Select_All_Error_Logs_And_Delete
167
168 Create Test Error Log
169 Create Test Error Log
Anusha Dathatricae580a2019-10-16 06:17:19 -0500170 Click Element ${xpath_select_refresh_button}
Sivas SRRbe026912018-03-14 11:33:02 -0500171 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
172 Page Should Contain Element ${xpath_number_of_events}
173 ${number_of_events}= Get Text ${xpath_number_of_events}
Sivas SRRbe026912018-03-14 11:33:02 -0500174 Run Keyword If ${number_of_events} > 0
Anusha Dathatricae580a2019-10-16 06:17:19 -0500175 ... Common Event Log Click Element ${xpath_individual_event_delete}
176 ... ${xpath_yes_button} ${xpath_select_all_events}
Sivas SRRbe026912018-03-14 11:33:02 -0500177 ${number_of_events}= Get Text ${xpath_number_of_events}
178 Should Be Equal ${number_of_events} 0
179
180
Sivas SRR2631b632018-04-04 11:33:21 -0500181Select Single Error Log And Delete
182 [Documentation] Select single error log and delete it.
183 [Tags] Select_Single_Error_Log_And_Delete
184
185 Create Test Error Log
186 # Refresh the GUI to get the latest update.
187 Click Element ${xpath_select_refresh_button}
188 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
189 Page Should Contain Element ${xpath_number_of_events}
190 ${number_of_events}= Get Text ${xpath_number_of_events}
191 Run Keyword If ${number_of_events} > 0
192 ... Common Event Log Click Element ${xpath_individual_event_delete}
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600193 ... ${xpath_yes_button}
Sivas SRR2631b632018-04-04 11:33:21 -0500194 ${number_of_events}= Get Text ${xpath_number_of_events}
195 Should Be Equal ${number_of_events} 0
196 ... msg=Failed to delete single error log entry.
197
198
199Select Multiple Error Logs And Delete
200 [Documentation] Select multiple error logs and delete them.
201 [Tags] Select_Multiple_Error_Logs_And_Delete
202
203 Create Test Error Log
204 Create Test Error Log
205 # Refresh the GUI to get the latest update.
206 Click Element ${xpath_select_refresh_button}
207 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
208 Page Should Contain Element ${xpath_number_of_events}
209 ${number_of_events}= Get Text ${xpath_number_of_events}
210 Run Keyword If ${number_of_events} > 0
Sivas SRR1a94d002018-04-06 08:48:58 -0500211 ... Double Event Log Click Element ${xpath_individual_event_delete}
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600212 ... ${xpath_yes_button}
Sivas SRR2631b632018-04-04 11:33:21 -0500213 ${number_of_events}= Get Text ${xpath_number_of_events}
214 Should Be Equal ${number_of_events} 0
215 ... msg=Failed to delete multiple error log entries.
216
217
218Select Single Error Log And Mark As Resolved
219 [Documentation] Select single error log and mark as resolved.
220 [Tags] Select_Single_Error_Log_And_Mark_As_Resolved
221
222 Create Test Error Log
Sivas SRR1a94d002018-04-06 08:48:58 -0500223 # Refresh the GUI to get the latest update.
Sivas SRR2631b632018-04-04 11:33:21 -0500224 Click Element ${xpath_select_refresh_button}
225 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
226 Page Should Contain Element ${xpath_number_of_events}
227 ${number_of_events}= Get Text ${xpath_number_of_events}
228 Run Keyword If ${number_of_events} > 0
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600229 ... Common Event Log Click Element ${xpath_individual_event_resolved}
Sivas SRR2631b632018-04-04 11:33:21 -0500230 ${number_of_events}= Get Text ${xpath_number_of_events}
231 Should Be Equal ${number_of_events} 1
232 ... msg=Failed to mark single error log entry as resolved.
233
Sivas SRR1a94d002018-04-06 08:48:58 -0500234
235Select Multiple Error Logs And Mark As Resolved
236 [Documentation] Select multiple error logs and mark as resolved.
237 [Tags] Select_Multiple_Error_Logs_And_Mark_As_Resolved
238
239 Create Test Error Log
240 Create Test Error Log
241 # Refresh the GUI to get the latest update.
242 Click Element ${xpath_select_refresh_button}
243 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
244 Page Should Contain Element ${xpath_number_of_events}
245 ${number_of_events}= Get Text ${xpath_number_of_events}
246 Run Keyword If ${number_of_events} > 0
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600247 ... Double Event Log Click Element ${xpath_individual_event_resolved}
Sivas SRR1a94d002018-04-06 08:48:58 -0500248 ${number_of_events}= Get Text ${xpath_number_of_events}
249 Should Be Equal ${number_of_events} 2
250 ... msg=Failed to mark multiple error log entries as resolved.
251
252
253Select Single Error Log And Export
254 [Documentation] Select single error log and export.
255 [Tags] Select_Single_Error_Log_And_Export
256
257 Create Test Error Log
258 # Refresh the GUI to get the latest update.
259 Click Element ${xpath_select_refresh_button}
260 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
261 Page Should Contain Element ${xpath_number_of_events}
262 ${number_of_events}= Get Text ${xpath_number_of_events}
263 Run Keyword If ${number_of_events} > 0
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600264 ... Common Event Log Click Element ${xpath_individual_event_export}
Sivas SRR1a94d002018-04-06 08:48:58 -0500265 ${number_of_events}= Get Text ${xpath_number_of_events}
266 Should Be Equal ${number_of_events} 1
267 ... msg=Failed to export single error log entry.
268
269
270Select Multiple Error Log And Export
271 [Documentation] Select multiple error log and export.
272 [Tags] Select_Multiple_Error_Log_And_Export
273
274 Create Test Error Log
275 Create Test Error Log
276 # Refresh the GUI to get the latest update.
277 Click Element ${xpath_select_refresh_button}
278 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
279 Page Should Contain Element ${xpath_number_of_events}
280 ${number_of_events}= Get Text ${xpath_number_of_events}
281 Run Keyword If ${number_of_events} > 0
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600282 ... Double Event Log Click Element ${xpath_individual_event_export}
Sivas SRR1a94d002018-04-06 08:48:58 -0500283 ${number_of_events}= Get Text ${xpath_number_of_events}
284 Should Be Equal ${number_of_events} 2
285 ... msg=Failed to export multiple error log entries.
286
Anusha Dathatrie9650a62019-11-15 04:02:24 -0600287
288Verify Existence Of All Buttons In Remote Logging Server Page
289 [Documentation] Verify existence of all buttons in remote logging server
290 ... page.
291 [Tags] Verify_Existence_Of_All_Buttons_In_Remote_Logging_Server_Page
292 [Setup] Setup For Remote Logging Server
293 [Teardown] Teardown For Remote Logging Server
294
295 Page Should Contain Button ${xpath_cancel_button}
296 Page Should Contain Button ${xpath_add_button}
297
298
299Verify Existence Of All Input Boxes In Remote Logging Server Page
300 [Documentation] Verify existence of all input boxes in remote logging server
301 ... page.
302 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Remote_Logging_Server_Page
303 [Setup] Setup For Remote Logging Server
304 [Teardown] Teardown For Remote Logging Server
305
306 Page Should Contain Textfield ${xpath_remote_server_ip}
307 Page Should Contain Textfield ${xpath_remote_server_port}
308
Sivas SRRbe026912018-03-14 11:33:02 -0500309*** Keywords ***
310
Sivas SRR2631b632018-04-04 11:33:21 -0500311Common Event Log Click Element
312 [Documentation] Keep common click elements associated with event log.
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600313 [Arguments] ${action_element} ${action_click_confirmation}=${None}
Anusha Dathatricae580a2019-10-16 06:17:19 -0500314 ... ${xpath_event_select}=${xpath_individual_event_select}
Sivas SRR2631b632018-04-04 11:33:21 -0500315
316 # Description of argument(s):
Sivas SRR1a94d002018-04-06 08:48:58 -0500317 # action_element xpath value of the element to be actioned
318 # (e.g. "Delete" or "Resolved" or "Export").
319 # action_click_confirmation Confirmation of action by pressing yes
320 # (e.g. "Yes" or "No").
Anusha Dathatricae580a2019-10-16 06:17:19 -0500321 # xpath_event_select xpath to select event log.
Sivas SRR2631b632018-04-04 11:33:21 -0500322
Anusha Dathatricae580a2019-10-16 06:17:19 -0500323 Click Element ${xpath_event_select}
Sivas SRR1a94d002018-04-06 08:48:58 -0500324 Page Should Contain Element ${action_element}
Sivas SRR2631b632018-04-04 11:33:21 -0500325 Click Element ${action_element}
326 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600327 Run Keyword If "${action_click_confirmation}" != "${None}"
Sivas SRR2631b632018-04-04 11:33:21 -0500328 ... Click Element ${action_click_confirmation}
329 Click Element ${xpath_select_refresh_button}
330 Run Key Sleep \ 50s
331
332Double Event Log Click Element
Sivas SRR1a94d002018-04-06 08:48:58 -0500333 [Documentation] Keep double click elements associated with event logs.
Rahul Maheshwari65f69442018-11-27 04:43:00 -0600334 [Arguments] ${action_element} ${action_click_confirmation}=${None}
Sivas SRR1a94d002018-04-06 08:48:58 -0500335
336 # Description of argument(s):
337 # action_element xpath value of the element to be actioned
338 # (e.g. "Delete" or "Resolved" or "Export").
339 # action_click_confirmation Confirmation of action by pressing yes
340 # (e.g. "Yes" or "No").
Sivas SRR2631b632018-04-04 11:33:21 -0500341
342 Click Element ${xpath_second_event_select}
Sivas SRR1a94d002018-04-06 08:48:58 -0500343 Common Event Log Click Element ${action_element}
344 ... ${action_click_confirmation}
Sivas SRR2631b632018-04-04 11:33:21 -0500345
Anusha Dathatrie9650a62019-11-15 04:02:24 -0600346Navigate To Event Log Page
347 [Documentation] Go to event log page from BMC homepage.
348
349 Launch Browser And Login OpenBMC GUI
350 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
351 Click Element ${xpath_select_server_health}
352 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
353 Wait Until Page Contains Event Log
354
Sivas SRRbe026912018-03-14 11:33:02 -0500355Test Setup Execution
356 [Documentation] Do test case setup tasks.
Rahul Maheshwari2f8aaa02018-11-29 00:23:09 -0600357
Sivas SRRbe026912018-03-14 11:33:02 -0500358 ${status}= Run Keyword And Return Status Logging Test Binary Exist
359 Run Keyword If ${status} == ${False} Install Tarball
360 Delete Error Logs And Verify
Sivas SRRbe026912018-03-14 11:33:02 -0500361
Anusha Dathatrie9650a62019-11-15 04:02:24 -0600362 Navigate To Event Log Page
Sivas SRRbe026912018-03-14 11:33:02 -0500363
364Test Teardown Execution
365 [Documentation] Do the post test teardown.
366
367 FFDC On Test Case Fail
368 Delete All Error Logs
369 Close All Connections
Rahul Maheshwari2a674e22018-12-06 01:40:56 -0600370 Close Browser
Anusha Dathatrie9650a62019-11-15 04:02:24 -0600371
372Delete Remote Logging Server
373 [Documentation] Delete remote logging server entry.
374
375 Click Button ${xpath_delete_remote_server}
376 Click Button ${xpath_remove_button}
377
378Setup For Remote Logging Server
379 [Documentation] Test setup for remote logging server page.
380
381 Navigate To Event Log Page
382
383 # An entry for remote server may not exist so ignoring if there is a fail
384 # when deleting the entry.
385 Run Keyword And Ignore Error Delete Remote Logging Server
386 Click Button ${xpath_add_server}
387 Page Should Contain Add remote logging server
388
389Teardown For Remote Logging Server
390 [Documentation] Test teardown for remote logging server page.
391
392 Click Button ${xpath_cancel_button}
393 FFDC On Test Case Fail
394 Close Browser