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"] |
| 19 | ${xpath_event_search} //input[@placeholder="Search logs"] |
| 20 | ${xpath_event_from_date} //*[@id="input-from-date"] |
| 21 | ${xpath_event_to_date} //*[@id="input-to-date"] |
| 22 | ${xpath_select_all_events} //*[@data-test-id="eventLogs-checkbox-selectAll"] |
| 23 | ${xpath_event_action_delete} //*[@data-test-id="table-button-deleteSelected"] |
| 24 | ${xpath_event_action_export} //*[contains(text(),"Export")] |
| 25 | ${xpath_event_action_cancel} //button[contains(text(),"Cancel")] |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 26 | ${xpath_delete_first_row} //*[@data-test-id="eventLogs-button-deleteRow-0"][2] |
rramyasr-in | 91e3d4d | 2022-10-27 05:40:58 -0500 | [diff] [blame] | 27 | ${xpath_confirm_delete} //button[text()="Delete"] |
rramyasr-in | a10514e | 2022-09-01 12:10:26 -0500 | [diff] [blame] | 28 | ${xpath_event_status_resolved} //*[@data-test-id="tableFilter-checkbox-Resolved"] |
| 29 | ${xpath_event_status_unresolved} //*[@data-test-id="tableFilter-checkbox-Unresolved"] |
Nandish-Matti | 5575dad | 2023-02-21 01:39:59 -0600 | [diff] [blame] | 30 | ${xpath_event_action_download} //button[text()[normalize-space()='Download']] |
| 31 | ${xpath_success_message} //*[contains(text(),"Success")] |
| 32 | ${xpath_resolved_button} //button[contains(text(),"Resolve")] |
| 33 | ${xpath_unresolved_button} //button[contains(text(),"Unresolve")] |
dnirmala | 2c95efa | 2023-03-10 03:36:44 -0600 | [diff] [blame] | 34 | ${xpath_filter_clearall_button} //button[contains(text(),"Clear all")] |
Sushma M M | 15fa20d | 2020-08-31 02:25:52 -0500 | [diff] [blame] | 35 | |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 36 | *** Test Cases *** |
| 37 | |
Sushma M M | 15fa20d | 2020-08-31 02:25:52 -0500 | [diff] [blame] | 38 | Verify Navigation To Event Logs Page |
| 39 | [Documentation] Verify navigation to Event Logs page. |
| 40 | [Tags] Verify_Navigation_To_Event_Logs_Page |
| 41 | |
| 42 | Page Should Contain Element ${xpath_event_logs_heading} |
| 43 | |
| 44 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 45 | Verify Existence Of All Buttons In Event Logs Page |
| 46 | [Documentation] Verify existence of all buttons in Event Logs page. |
| 47 | [Tags] Verify_Existence_Of_All_Buttons_In_Event_Logs_Page |
dnirmala | 2c95efa | 2023-03-10 03:36:44 -0600 | [diff] [blame] | 48 | [Setup] Click Element ${xpath_filter_event} |
| 49 | [Teardown] Click Button ${xpath_filter_clearall_button} |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 50 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 51 | # Types of event severity: OK, Warning, Critical. |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 52 | Page Should Contain Element ${xpath_event_severity_ok} limit=1 |
| 53 | Page Should Contain Element ${xpath_event_severity_warning} limit=1 |
| 54 | Page Should Contain Element ${xpath_event_severity_critical} limit=1 |
| 55 | |
rramyasr-in | a10514e | 2022-09-01 12:10:26 -0500 | [diff] [blame] | 56 | # Types of event status: Resolved, Unresolved. |
| 57 | Page Should Contain Element ${xpath_event_status_resolved} limit=1 |
| 58 | Page Should Contain Element ${xpath_event_status_unresolved} limit=1 |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 59 | |
dnirmala | 2c95efa | 2023-03-10 03:36:44 -0600 | [diff] [blame] | 60 | |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 61 | Verify Existence Of All Input Boxes In Event Logs Page |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 62 | [Documentation] Verify existence of all input boxes in Event Logs page. |
| 63 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_Event_Logs_Page |
| 64 | |
| 65 | # Search logs. |
| 66 | Page Should Contain Element ${xpath_event_search} |
| 67 | |
| 68 | # Date filter. |
| 69 | Page Should Contain Element ${xpath_event_from_date} limit=1 |
| 70 | Page Should Contain Element ${xpath_event_to_date} limit=1 |
| 71 | |
| 72 | |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 73 | Select Single Error Log And Delete |
| 74 | [Documentation] Select single error log and delete it. |
| 75 | [Tags] Select_Single_Error_Log_And_Delete |
| 76 | |
| 77 | Create Error Logs ${2} |
| 78 | ${number_of_events_before}= Get Number Of Event Logs |
rramyasr-in | ff2f914 | 2022-11-23 01:15:48 -0600 | [diff] [blame] | 79 | Click Element ${xpath_delete_first_row} |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 80 | Wait Until Page Contains Element ${xpath_confirm_delete} |
| 81 | Click Button ${xpath_confirm_delete} |
| 82 | ${number_of_events_after}= Get Number Of Event Logs |
| 83 | Should Be Equal ${number_of_events_before -1} ${number_of_events_after} |
| 84 | ... msg=Failed to delete single error log entry. |
Nandish-Matti | 5575dad | 2023-02-21 01:39:59 -0600 | [diff] [blame] | 85 | Wait Until Element Is Not Visible ${xpath_success_message} timeout=30 |
Anusha Dathatri | 304d346 | 2020-11-12 05:29:12 -0600 | [diff] [blame] | 86 | |
Anusha Dathatri | 9e5070c | 2020-11-12 06:23:58 -0600 | [diff] [blame] | 87 | |
| 88 | Select All Error Logs And Verify Buttons |
| 89 | [Documentation] Select all error logs and verify delete, export and cancel buttons. |
| 90 | [Tags] Select_All_Error_Logs_And_Verify_Buttons |
| 91 | |
| 92 | Create Error Logs ${2} |
| 93 | Wait Until Element Is Visible ${xpath_delete_first_row} |
| 94 | Select All Events |
Nandish-Matti | 5575dad | 2023-02-21 01:39:59 -0600 | [diff] [blame] | 95 | Page Should Contain Element ${xpath_resolved_button} |
| 96 | Page Should Contain Element ${xpath_unresolved_button} |
rramyasr-in | 31eb592 | 2022-10-10 10:17:49 -0500 | [diff] [blame] | 97 | Page Should Contain Element ${xpath_event_action_download} |
| 98 | Page Should Contain Element ${xpath_event_action_delete} |
| 99 | Page Should Contain Element ${xpath_event_action_cancel} |
Anusha Dathatri | 9e5070c | 2020-11-12 06:23:58 -0600 | [diff] [blame] | 100 | |
Anusha Dathatri | 54edcbc | 2020-12-10 04:04:08 -0600 | [diff] [blame] | 101 | Select And Verify Default UTC Timezone For Events |
| 102 | [Documentation] Select and verify that default UTC timezone is displayed for an event. |
| 103 | [Tags] Select_And_Verify_Default_UTC_Timezone_For_Events |
| 104 | [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log |
| 105 | [Teardown] Redfish.Logout |
| 106 | |
| 107 | Create Error Logs ${1} |
| 108 | |
| 109 | # Set Default timezone in profile settings page. |
| 110 | Set Timezone In Profile Settings Page Default |
| 111 | Navigate To Event Logs Page |
| 112 | |
| 113 | # Get date and time from backend. |
| 114 | ${event_data}= Get Event Logs |
| 115 | # Date format: 2020-12-07T15:18:35+00:00. |
| 116 | ${redfish_event_date_time}= Set Variable ${event_data[0]["Created"].split('T')} |
| 117 | |
| 118 | Page Should Contain ${redfish_event_date_time[0]} |
| 119 | Page Should Contain ${redfish_event_date_time[1].split('+')[0]} |
| 120 | |
| 121 | |
Anusha Dathatri | 13cc36e | 2020-12-09 07:55:19 -0600 | [diff] [blame] | 122 | Verify Displayed Event Details With Redfish |
| 123 | [Documentation] Verify event details like severity, desc etc using Redfish. |
| 124 | [Tags] Verify_Displayed_Event_Details_With_Redfish |
| 125 | [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log |
| 126 | [Teardown] Redfish.Logout |
| 127 | |
| 128 | Create Error Logs ${1} |
Ashwini Chandrappa | 154c213 | 2021-06-28 23:44:21 -0500 | [diff] [blame] | 129 | # Added a delay for error log to appear on error log page. |
| 130 | Sleep 5s |
Anusha Dathatri | 13cc36e | 2020-12-09 07:55:19 -0600 | [diff] [blame] | 131 | ${event_data}= Get Event Logs |
| 132 | Page Should Contain ${event_data[0]["Severity"]} |
| 133 | Page Should Contain ${event_data[0]["EntryType"]} |
| 134 | Page Should Contain ${event_data[0]["Message"]} |
| 135 | |
| 136 | |
George Keishing | a87ee1e | 2023-01-11 22:55:45 -0600 | [diff] [blame] | 137 | Verify Existence Of All Fields In Event Logs Page |
rramyasr-in | 666c851 | 2023-01-03 03:19:55 -0600 | [diff] [blame] | 138 | [Documentation] Verify existence of all required fields in Event Logs page. |
| 139 | [Tags] Verify_Existence_Of_All_Fields_In_Event_Logs_Page |
| 140 | [Template] Page Should Contain |
| 141 | |
| 142 | #Expected parameters |
| 143 | ID |
| 144 | Severity |
| 145 | Date |
| 146 | Description |
| 147 | Status |
| 148 | |
| 149 | |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 150 | *** Keywords *** |
| 151 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 152 | Suite Setup Execution |
| 153 | [Documentation] Do suite setup tasks. |
| 154 | |
| 155 | Launch Browser And Login GUI |
| 156 | Navigate To Event Logs Page |
Anusha Dathatri | 7d5c264 | 2021-01-12 23:55:52 -0600 | [diff] [blame] | 157 | Redfish.Login |
rramyasr-in | a10514e | 2022-09-01 12:10:26 -0500 | [diff] [blame] | 158 | 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] | 159 | |
| 160 | Suite Teardown Execution |
| 161 | [Documentation] Suite teardown tasks. |
| 162 | |
| 163 | Redfish.Logout |
| 164 | Close Browser |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 165 | |
| 166 | Navigate To Event Logs Page |
| 167 | [Documentation] Navigate to the event logs page from main menu. |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 168 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 169 | Click Element ${xpath_logs_menu} |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 170 | Click Element ${xpath_event_logs_sub_menu} |
| 171 | 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] | 172 | |
Anusha Dathatri | 44c5aef | 2020-07-30 04:16:02 -0500 | [diff] [blame] | 173 | Create Error Logs |
| 174 | [Documentation] Create given number of error logs. |
| 175 | [Arguments] ${log_count} |
| 176 | |
| 177 | # Description of argument(s): |
| 178 | # log_count Number of error logs to create. |
| 179 | |
| 180 | FOR ${num} IN RANGE ${log_count} |
| 181 | Generate Test Error Log |
| 182 | END |
| 183 | |
| 184 | Select All Events |
| 185 | [Documentation] Select all error logs. |
| 186 | |
| 187 | Click Element At Coordinates ${xpath_select_all_events} 0 0 |