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