Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "Event logs" sub-menu of "Logs" menu. |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 6 | Resource ../../../lib/logging_utils.robot |
rramyasr-in | a07325b | 2022-10-28 10:36:48 -0500 | [diff] [blame] | 7 | Library ../../../data/pel_variables.py |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 8 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 9 | Suite Setup Suite Setup Execution |
Anusha Dathatri | 7d5c264 | 2021-01-12 23:55:52 -0600 | [diff] [blame] | 10 | Suite Teardown Suite Teardown Execution |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 11 | |
| 12 | |
Sushma M M | 15fa20d | 2020-08-31 02:25:52 -0500 | [diff] [blame] | 13 | *** Variables *** |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 14 | ${xpath_event_logs_heading} //h1[text()="Event logs"] |
| 15 | ${xpath_filter_event} //button[contains(text(),"Filter")] |
| 16 | ${xpath_event_severity_ok} //*[@data-test-id="tableFilter-checkbox-OK"] |
| 17 | ${xpath_event_severity_warning} //*[@data-test-id="tableFilter-checkbox-Warning"] |
| 18 | ${xpath_event_severity_critical} //*[@data-test-id="tableFilter-checkbox-Critical"] |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 19 | ${xpath_event_from_date} //*[@id="input-from-date"] |
| 20 | ${xpath_event_to_date} //*[@id="input-to-date"] |
| 21 | ${xpath_select_all_events} //*[@data-test-id="eventLogs-checkbox-selectAll"] |
| 22 | ${xpath_event_action_delete} //*[@data-test-id="table-button-deleteSelected"] |
| 23 | ${xpath_event_action_export} //*[contains(text(),"Export")] |
| 24 | ${xpath_event_action_cancel} //button[contains(text(),"Cancel")] |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 25 | ${xpath_delete_first_row} //*[@data-test-id="eventLogs-button-deleteRow-0"][2] |
rramyasr-in | 91e3d4d | 2022-10-27 05:40:58 -0500 | [diff] [blame] | 26 | ${xpath_confirm_delete} //button[text()="Delete"] |
rramyasr-in | a10514e | 2022-09-01 12:10:26 -0500 | [diff] [blame] | 27 | ${xpath_event_status_resolved} //*[@data-test-id="tableFilter-checkbox-Resolved"] |
| 28 | ${xpath_event_status_unresolved} //*[@data-test-id="tableFilter-checkbox-Unresolved"] |
Nandish-Matti | 5575dad | 2023-02-21 01:39:59 -0600 | [diff] [blame] | 29 | ${xpath_event_action_download} //button[text()[normalize-space()='Download']] |
| 30 | ${xpath_success_message} //*[contains(text(),"Success")] |
| 31 | ${xpath_resolved_button} //button[contains(text(),"Resolve")] |
| 32 | ${xpath_unresolved_button} //button[contains(text(),"Unresolve")] |
dnirmala | 2c95efa | 2023-03-10 03:36:44 -0600 | [diff] [blame] | 33 | ${xpath_filter_clearall_button} //button[contains(text(),"Clear all")] |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 34 | ${xpath_clear_search} //button[@title="Clear search input"] |
| 35 | ${xpath_event_log_resolve} //*[@name="switch"] |
| 36 | ${xpath_event_logs_resolve} //button[contains(text(),'Resolve')] |
dnirmala | 4c5dfba | 2023-04-06 00:18:01 -0500 | [diff] [blame] | 37 | ${xpath_event_log_data} //td[contains(text(),'Critical')]/following-sibling::td[3] |
Sushma M M | 15fa20d | 2020-08-31 02:25:52 -0500 | [diff] [blame] | 38 | |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 39 | *** Test Cases *** |
| 40 | |
Sushma M M | 15fa20d | 2020-08-31 02:25:52 -0500 | [diff] [blame] | 41 | Verify Navigation To Event Logs Page |
| 42 | [Documentation] Verify navigation to Event Logs page. |
| 43 | [Tags] Verify_Navigation_To_Event_Logs_Page |
| 44 | |
| 45 | Page Should Contain Element ${xpath_event_logs_heading} |
| 46 | |
| 47 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 48 | Verify Existence Of All Buttons In Event Logs Page |
| 49 | [Documentation] Verify existence of all buttons in Event Logs page. |
| 50 | [Tags] Verify_Existence_Of_All_Buttons_In_Event_Logs_Page |
dnirmala | 2c95efa | 2023-03-10 03:36:44 -0600 | [diff] [blame] | 51 | [Setup] Click Element ${xpath_filter_event} |
| 52 | [Teardown] Click Button ${xpath_filter_clearall_button} |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 53 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 54 | # Types of event severity: OK, Warning, Critical. |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 55 | Page Should Contain Element ${xpath_event_severity_ok} limit=1 |
| 56 | Page Should Contain Element ${xpath_event_severity_warning} limit=1 |
| 57 | Page Should Contain Element ${xpath_event_severity_critical} limit=1 |
| 58 | |
rramyasr-in | a10514e | 2022-09-01 12:10:26 -0500 | [diff] [blame] | 59 | # Types of event status: Resolved, Unresolved. |
| 60 | Page Should Contain Element ${xpath_event_status_resolved} limit=1 |
| 61 | Page Should Contain Element ${xpath_event_status_unresolved} limit=1 |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 62 | |
dnirmala | 2c95efa | 2023-03-10 03:36:44 -0600 | [diff] [blame] | 63 | |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 64 | Verify Existence Of All Input Boxes In Event Logs Page |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 65 | [Documentation] Verify existence of all input boxes in Event Logs page. |
| 66 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_Event_Logs_Page |
| 67 | |
| 68 | # Search logs. |
| 69 | Page Should Contain Element ${xpath_event_search} |
| 70 | |
| 71 | # Date filter. |
| 72 | Page Should Contain Element ${xpath_event_from_date} limit=1 |
| 73 | Page Should Contain Element ${xpath_event_to_date} limit=1 |
| 74 | |
| 75 | |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 76 | Select Single Error Log And Delete |
| 77 | [Documentation] Select single error log and delete it. |
| 78 | [Tags] Select_Single_Error_Log_And_Delete |
| 79 | |
| 80 | Create Error Logs ${2} |
| 81 | ${number_of_events_before}= Get Number Of Event Logs |
rramyasr-in | ff2f914 | 2022-11-23 01:15:48 -0600 | [diff] [blame] | 82 | Click Element ${xpath_delete_first_row} |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 83 | Wait Until Page Contains Element ${xpath_confirm_delete} |
| 84 | Click Button ${xpath_confirm_delete} |
| 85 | ${number_of_events_after}= Get Number Of Event Logs |
| 86 | Should Be Equal ${number_of_events_before -1} ${number_of_events_after} |
| 87 | ... msg=Failed to delete single error log entry. |
Nandish-Matti | 5575dad | 2023-02-21 01:39:59 -0600 | [diff] [blame] | 88 | Wait Until Element Is Not Visible ${xpath_success_message} timeout=30 |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 89 | |
Anusha Dathatri | 9e5070c | 2020-11-12 06:23:58 -0600 | [diff] [blame] | 90 | |
| 91 | Select All Error Logs And Verify Buttons |
| 92 | [Documentation] Select all error logs and verify delete, export and cancel buttons. |
| 93 | [Tags] Select_All_Error_Logs_And_Verify_Buttons |
| 94 | |
| 95 | Create Error Logs ${2} |
| 96 | Wait Until Element Is Visible ${xpath_delete_first_row} |
| 97 | Select All Events |
Nandish-Matti | 5575dad | 2023-02-21 01:39:59 -0600 | [diff] [blame] | 98 | Page Should Contain Element ${xpath_resolved_button} |
| 99 | Page Should Contain Element ${xpath_unresolved_button} |
rramyasr-in | 31eb592 | 2022-10-10 10:17:49 -0500 | [diff] [blame] | 100 | Page Should Contain Element ${xpath_event_action_download} |
| 101 | Page Should Contain Element ${xpath_event_action_delete} |
| 102 | Page Should Contain Element ${xpath_event_action_cancel} |
Anusha Dathatri | 9e5070c | 2020-11-12 06:23:58 -0600 | [diff] [blame] | 103 | |
dnirmala | 91c88ad | 2023-03-16 06:13:34 -0500 | [diff] [blame] | 104 | |
Anusha Dathatri | 54edcbc | 2020-12-10 04:04:08 -0600 | [diff] [blame] | 105 | Select And Verify Default UTC Timezone For Events |
| 106 | [Documentation] Select and verify that default UTC timezone is displayed for an event. |
| 107 | [Tags] Select_And_Verify_Default_UTC_Timezone_For_Events |
| 108 | [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log |
| 109 | [Teardown] Redfish.Logout |
| 110 | |
| 111 | Create Error Logs ${1} |
| 112 | |
| 113 | # Set Default timezone in profile settings page. |
| 114 | Set Timezone In Profile Settings Page Default |
| 115 | Navigate To Event Logs Page |
| 116 | |
| 117 | # Get date and time from backend. |
| 118 | ${event_data}= Get Event Logs |
dnirmala | a0ff819 | 2023-05-02 03:30:41 -0500 | [diff] [blame] | 119 | # Date format: 2023-05-02T04:49:29.149+00:00 |
Anusha Dathatri | 54edcbc | 2020-12-10 04:04:08 -0600 | [diff] [blame] | 120 | ${redfish_event_date_time}= Set Variable ${event_data[0]["Created"].split('T')} |
| 121 | |
| 122 | Page Should Contain ${redfish_event_date_time[0]} |
dnirmala | a0ff819 | 2023-05-02 03:30:41 -0500 | [diff] [blame] | 123 | Page Should Contain ${redfish_event_date_time[1].split('.')[0]} |
Anusha Dathatri | 54edcbc | 2020-12-10 04:04:08 -0600 | [diff] [blame] | 124 | |
| 125 | |
Anusha Dathatri | 13cc36e | 2020-12-09 07:55:19 -0600 | [diff] [blame] | 126 | Verify Displayed Event Details With Redfish |
| 127 | [Documentation] Verify event details like severity, desc etc using Redfish. |
| 128 | [Tags] Verify_Displayed_Event_Details_With_Redfish |
| 129 | [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log |
| 130 | [Teardown] Redfish.Logout |
| 131 | |
| 132 | Create Error Logs ${1} |
Ashwini Chandrappa | 154c213 | 2021-06-28 23:44:21 -0500 | [diff] [blame] | 133 | # Added a delay for error log to appear on error log page. |
| 134 | Sleep 5s |
Anusha Dathatri | 13cc36e | 2020-12-09 07:55:19 -0600 | [diff] [blame] | 135 | ${event_data}= Get Event Logs |
| 136 | Page Should Contain ${event_data[0]["Severity"]} |
| 137 | Page Should Contain ${event_data[0]["EntryType"]} |
| 138 | Page Should Contain ${event_data[0]["Message"]} |
| 139 | |
| 140 | |
George Keishing | a87ee1e | 2023-01-11 22:55:45 -0600 | [diff] [blame] | 141 | Verify Existence Of All Fields In Event Logs Page |
rramyasr-in | 666c851 | 2023-01-03 03:19:55 -0600 | [diff] [blame] | 142 | [Documentation] Verify existence of all required fields in Event Logs page. |
| 143 | [Tags] Verify_Existence_Of_All_Fields_In_Event_Logs_Page |
| 144 | [Template] Page Should Contain |
| 145 | |
| 146 | #Expected parameters |
| 147 | ID |
| 148 | Severity |
| 149 | Date |
| 150 | Description |
| 151 | Status |
| 152 | |
| 153 | |
dnirmala | 91c88ad | 2023-03-16 06:13:34 -0500 | [diff] [blame] | 154 | Verify Invalid Content Search Logs |
| 155 | [Documentation] Input invalid PEL ID in the search log and verify error message. |
| 156 | [Tags] Verify_Invalid_Content_Search_Logs |
| 157 | |
| 158 | Input Text ${xpath_event_search} AG806993 |
| 159 | Page Should Contain No items match the search query |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 160 | Click Button ${xpath_clear_search} |
| 161 | |
| 162 | |
| 163 | Verify Resolving Single Error Log In GUI |
| 164 | [Documentation] Verify that error log can be resolved via GUI |
| 165 | ... and the resolution is reflected in Redfish. |
| 166 | [Tags] Verify_Resolving_Single_Error_Log_In_GUI |
| 167 | [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log |
| 168 | |
| 169 | Create Error Logs ${1} |
| 170 | # Mark single event log as resolved. |
| 171 | Click Element At Coordinates ${xpath_event_log_resolve} 0 0 |
dnirmala | 4c5dfba | 2023-04-06 00:18:01 -0500 | [diff] [blame] | 172 | # Given the time to get the notification. |
| 173 | Wait Until Page Contains Successfully resolved 1 log timeout=10 |
rramyasr-in | 5a7cfc9 | 2023-04-24 08:57:26 -0500 | [diff] [blame] | 174 | Wait Until Page Does Not Contain Element Success |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 175 | # Verify the Redfish response after event log mark as resolved. |
dnirmala | 4c5dfba | 2023-04-06 00:18:01 -0500 | [diff] [blame] | 176 | Get And Verify Status Of Resolved Field In Event Logs ${True} |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 177 | |
| 178 | |
| 179 | Verify Resolving Multiple Error Logs In GUI |
| 180 | [Documentation] Verify that error logs can be resolved via GUI |
| 181 | ... and the resolution is reflected in Redfish. |
| 182 | [Tags] Verify_Resolving_Multiple_Error_Logs_In_GUI |
| 183 | [Setup] Redfish Purge Event Log |
| 184 | |
| 185 | Create Error Logs ${3} |
| 186 | Select All Events |
| 187 | Click Element ${xpath_event_logs_resolve} |
| 188 | Page Should Contain Successfully resolved 3 logs. |
rramyasr-in | 5a7cfc9 | 2023-04-24 08:57:26 -0500 | [diff] [blame] | 189 | Wait Until Page Does Not Contain Element Success |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 190 | # Verify the event logs status from Redfish after mark as resolved. |
dnirmala | 4c5dfba | 2023-04-06 00:18:01 -0500 | [diff] [blame] | 191 | Get And Verify Status Of Resolved Field In Event Logs ${True} |
| 192 | |
| 193 | |
| 194 | Verify Default Value Of Resolved Field In Error Log |
| 195 | [Documentation] Verify that error log unresolved status from GUI |
| 196 | [Tags] Verify_Default_Value_Of_Resolved_Field_In_Error_Log |
| 197 | |
| 198 | Redfish Purge Event Log |
| 199 | Create Error Logs ${1} |
| 200 | |
| 201 | # Verify default value of resolved field from GUI. |
| 202 | Element Should Contain ${xpath_event_log_data} Unresolved |
dnirmala | 91c88ad | 2023-03-16 06:13:34 -0500 | [diff] [blame] | 203 | |
| 204 | |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 205 | *** Keywords *** |
| 206 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 207 | Suite Setup Execution |
| 208 | [Documentation] Do suite setup tasks. |
| 209 | |
| 210 | Launch Browser And Login GUI |
| 211 | Navigate To Event Logs Page |
Anusha Dathatri | 7d5c264 | 2021-01-12 23:55:52 -0600 | [diff] [blame] | 212 | Redfish.Login |
rramyasr-in | a10514e | 2022-09-01 12:10:26 -0500 | [diff] [blame] | 213 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
Anusha Dathatri | 7d5c264 | 2021-01-12 23:55:52 -0600 | [diff] [blame] | 214 | |
| 215 | Suite Teardown Execution |
| 216 | [Documentation] Suite teardown tasks. |
| 217 | |
| 218 | Redfish.Logout |
| 219 | Close Browser |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 220 | |
| 221 | Navigate To Event Logs Page |
| 222 | [Documentation] Navigate to the event logs page from main menu. |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 223 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 224 | Click Element ${xpath_logs_menu} |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 225 | Click Element ${xpath_event_logs_sub_menu} |
| 226 | Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain event-logs |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 227 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 228 | Create Error Logs |
| 229 | [Documentation] Create given number of error logs. |
| 230 | [Arguments] ${log_count} |
| 231 | |
| 232 | # Description of argument(s): |
| 233 | # log_count Number of error logs to create. |
| 234 | |
| 235 | FOR ${num} IN RANGE ${log_count} |
| 236 | Generate Test Error Log |
| 237 | END |
| 238 | |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 239 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 240 | Select All Events |
| 241 | [Documentation] Select all error logs. |
| 242 | |
| 243 | Click Element At Coordinates ${xpath_select_all_events} 0 0 |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 244 | |
| 245 | |
dnirmala | 4c5dfba | 2023-04-06 00:18:01 -0500 | [diff] [blame] | 246 | Get And Verify Status Of Resolved Field In Event Logs |
dnirmala | 4ceb07c | 2023-03-21 01:51:16 -0500 | [diff] [blame] | 247 | [Documentation] Get event log entry and verify resolved attribute value. |
| 248 | [Arguments] ${expected_resolved_status} |
| 249 | |
| 250 | # Description of argument(s): |
| 251 | # expected_resolved_status expected status of resolved field in error logs. |
| 252 | |
| 253 | ${elog_entry}= Get Event Logs |
| 254 | |
| 255 | FOR ${elog} IN @{elog_entry} |
| 256 | Should Be Equal ${elog["Resolved"]} ${expected_resolved_status} |
| 257 | END |