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