blob: 4cecdd1b5e71210987a4c7475a1db5bdcc40c95b [file] [log] [blame]
Rahul Maheshwarid29cf302020-07-07 03:13:17 -05001*** Settings ***
2
Rahul Maheshwari142642d2021-08-24 00:00:15 -05003Documentation Test OpenBMC GUI "Event logs" sub-menu of "Logs" menu.
Rahul Maheshwarid29cf302020-07-07 03:13:17 -05004
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
Anusha Dathatri304d3462020-11-12 05:29:12 -06006Resource ../../../lib/logging_utils.robot
George Keishing8ac47b82023-07-12 22:43:47 +05307Variables ../../../data/pel_variables.py
Rahul Maheshwarid29cf302020-07-07 03:13:17 -05008
Anusha Dathatri44c5aef2020-07-30 04:16:02 -05009Suite Setup Suite Setup Execution
Anusha Dathatri7d5c2642021-01-12 23:55:52 -060010Suite Teardown Suite Teardown Execution
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050011
Matt Fischer6fb70d92023-10-24 19:06:33 -060012Test Tags Event_Logs_Sub_Menu
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050013
Sushma M M15fa20d2020-08-31 02:25:52 -050014*** Variables ***
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050015${xpath_event_logs_heading} //h1[text()="Event logs"]
16${xpath_filter_event} //button[contains(text(),"Filter")]
17${xpath_event_severity_ok} //*[@data-test-id="tableFilter-checkbox-OK"]
18${xpath_event_severity_warning} //*[@data-test-id="tableFilter-checkbox-Warning"]
19${xpath_event_severity_critical} //*[@data-test-id="tableFilter-checkbox-Critical"]
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050020${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 Dathatri304d3462020-11-12 05:29:12 -060026${xpath_delete_first_row} //*[@data-test-id="eventLogs-button-deleteRow-0"][2]
rramyasr-in91e3d4d2022-10-27 05:40:58 -050027${xpath_confirm_delete} //button[text()="Delete"]
rramyasr-ina10514e2022-09-01 12:10:26 -050028${xpath_event_status_resolved} //*[@data-test-id="tableFilter-checkbox-Resolved"]
29${xpath_event_status_unresolved} //*[@data-test-id="tableFilter-checkbox-Unresolved"]
Nandish-Matti5575dad2023-02-21 01:39:59 -060030${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")]
dnirmala2c95efa2023-03-10 03:36:44 -060034${xpath_filter_clearall_button} //button[contains(text(),"Clear all")]
dnirmala4ceb07c2023-03-21 01:51:16 -050035${xpath_clear_search} //button[@title="Clear search input"]
36${xpath_event_log_resolve} //*[@name="switch"]
37${xpath_event_logs_resolve} //button[contains(text(),'Resolve')]
dnirmala4c5dfba2023-04-06 00:18:01 -050038${xpath_event_log_data} //td[contains(text(),'Critical')]/following-sibling::td[3]
Sushma M M15fa20d2020-08-31 02:25:52 -050039
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050040*** Test Cases ***
41
Sushma M M15fa20d2020-08-31 02:25:52 -050042Verify Navigation To Event Logs Page
43 [Documentation] Verify navigation to Event Logs page.
44 [Tags] Verify_Navigation_To_Event_Logs_Page
45
46 Page Should Contain Element ${xpath_event_logs_heading}
47
48
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050049Verify Existence Of All Buttons In Event Logs Page
50 [Documentation] Verify existence of all buttons in Event Logs page.
51 [Tags] Verify_Existence_Of_All_Buttons_In_Event_Logs_Page
dnirmala2c95efa2023-03-10 03:36:44 -060052 [Setup] Click Element ${xpath_filter_event}
53 [Teardown] Click Button ${xpath_filter_clearall_button}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050054
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050055 # Types of event severity: OK, Warning, Critical.
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050056 Page Should Contain Element ${xpath_event_severity_ok} limit=1
57 Page Should Contain Element ${xpath_event_severity_warning} limit=1
58 Page Should Contain Element ${xpath_event_severity_critical} limit=1
59
rramyasr-ina10514e2022-09-01 12:10:26 -050060 # Types of event status: Resolved, Unresolved.
61 Page Should Contain Element ${xpath_event_status_resolved} limit=1
62 Page Should Contain Element ${xpath_event_status_unresolved} limit=1
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050063
dnirmala2c95efa2023-03-10 03:36:44 -060064
George Keishingd6a77972022-01-31 12:50:29 -060065Verify Existence Of All Input Boxes In Event Logs Page
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050066 [Documentation] Verify existence of all input boxes in Event Logs page.
67 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Event_Logs_Page
68
69 # Search logs.
70 Page Should Contain Element ${xpath_event_search}
71
72 # Date filter.
73 Page Should Contain Element ${xpath_event_from_date} limit=1
74 Page Should Contain Element ${xpath_event_to_date} limit=1
75
76
Anusha Dathatri304d3462020-11-12 05:29:12 -060077Select Single Error Log And Delete
78 [Documentation] Select single error log and delete it.
79 [Tags] Select_Single_Error_Log_And_Delete
80
81 Create Error Logs ${2}
82 ${number_of_events_before}= Get Number Of Event Logs
rramyasr-inff2f9142022-11-23 01:15:48 -060083 Click Element ${xpath_delete_first_row}
Anusha Dathatri304d3462020-11-12 05:29:12 -060084 Wait Until Page Contains Element ${xpath_confirm_delete}
85 Click Button ${xpath_confirm_delete}
86 ${number_of_events_after}= Get Number Of Event Logs
87 Should Be Equal ${number_of_events_before -1} ${number_of_events_after}
88 ... msg=Failed to delete single error log entry.
Nandish-Matti5575dad2023-02-21 01:39:59 -060089 Wait Until Element Is Not Visible ${xpath_success_message} timeout=30
Anusha Dathatri304d3462020-11-12 05:29:12 -060090
Anusha Dathatri9e5070c2020-11-12 06:23:58 -060091
92Select All Error Logs And Verify Buttons
93 [Documentation] Select all error logs and verify delete, export and cancel buttons.
94 [Tags] Select_All_Error_Logs_And_Verify_Buttons
95
96 Create Error Logs ${2}
97 Wait Until Element Is Visible ${xpath_delete_first_row}
98 Select All Events
Nandish-Matti5575dad2023-02-21 01:39:59 -060099 Page Should Contain Element ${xpath_resolved_button}
100 Page Should Contain Element ${xpath_unresolved_button}
rramyasr-in31eb5922022-10-10 10:17:49 -0500101 Page Should Contain Element ${xpath_event_action_download}
102 Page Should Contain Element ${xpath_event_action_delete}
103 Page Should Contain Element ${xpath_event_action_cancel}
Anusha Dathatri9e5070c2020-11-12 06:23:58 -0600104
dnirmala91c88ad2023-03-16 06:13:34 -0500105
Anusha Dathatri54edcbc2020-12-10 04:04:08 -0600106Select And Verify Default UTC Timezone For Events
107 [Documentation] Select and verify that default UTC timezone is displayed for an event.
108 [Tags] Select_And_Verify_Default_UTC_Timezone_For_Events
109 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
110 [Teardown] Redfish.Logout
111
112 Create Error Logs ${1}
113
114 # Set Default timezone in profile settings page.
115 Set Timezone In Profile Settings Page Default
116 Navigate To Event Logs Page
117
118 # Get date and time from backend.
119 ${event_data}= Get Event Logs
dnirmalaa0ff8192023-05-02 03:30:41 -0500120 # Date format: 2023-05-02T04:49:29.149+00:00
Anusha Dathatri54edcbc2020-12-10 04:04:08 -0600121 ${redfish_event_date_time}= Set Variable ${event_data[0]["Created"].split('T')}
122
123 Page Should Contain ${redfish_event_date_time[0]}
dnirmalaa0ff8192023-05-02 03:30:41 -0500124 Page Should Contain ${redfish_event_date_time[1].split('.')[0]}
Anusha Dathatri54edcbc2020-12-10 04:04:08 -0600125
126
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600127Verify Displayed Event Details With Redfish
128 [Documentation] Verify event details like severity, desc etc using Redfish.
129 [Tags] Verify_Displayed_Event_Details_With_Redfish
130 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
131 [Teardown] Redfish.Logout
132
133 Create Error Logs ${1}
Ashwini Chandrappa154c2132021-06-28 23:44:21 -0500134 # Added a delay for error log to appear on error log page.
135 Sleep 5s
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600136 ${event_data}= Get Event Logs
137 Page Should Contain ${event_data[0]["Severity"]}
138 Page Should Contain ${event_data[0]["EntryType"]}
139 Page Should Contain ${event_data[0]["Message"]}
140
141
George Keishinga87ee1e2023-01-11 22:55:45 -0600142Verify Existence Of All Fields In Event Logs Page
rramyasr-in666c8512023-01-03 03:19:55 -0600143 [Documentation] Verify existence of all required fields in Event Logs page.
144 [Tags] Verify_Existence_Of_All_Fields_In_Event_Logs_Page
145 [Template] Page Should Contain
146
147 #Expected parameters
148 ID
149 Severity
150 Date
151 Description
152 Status
153
154
dnirmala91c88ad2023-03-16 06:13:34 -0500155Verify Invalid Content Search Logs
156 [Documentation] Input invalid PEL ID in the search log and verify error message.
157 [Tags] Verify_Invalid_Content_Search_Logs
158
159 Input Text ${xpath_event_search} AG806993
160 Page Should Contain No items match the search query
dnirmala4ceb07c2023-03-21 01:51:16 -0500161 Click Button ${xpath_clear_search}
162
163
164Verify Resolving Single Error Log In GUI
165 [Documentation] Verify that error log can be resolved via GUI
166 ... and the resolution is reflected in Redfish.
167 [Tags] Verify_Resolving_Single_Error_Log_In_GUI
168 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
169
170 Create Error Logs ${1}
dnirmalaa19640e2023-06-16 08:12:36 -0500171 Refresh GUI
172
dnirmala4ceb07c2023-03-21 01:51:16 -0500173 # Mark single event log as resolved.
174 Click Element At Coordinates ${xpath_event_log_resolve} 0 0
dnirmala4c5dfba2023-04-06 00:18:01 -0500175 # Given the time to get the notification.
176 Wait Until Page Contains Successfully resolved 1 log timeout=10
rramyasr-in5a7cfc92023-04-24 08:57:26 -0500177 Wait Until Page Does Not Contain Element Success
dnirmala4ceb07c2023-03-21 01:51:16 -0500178 # Verify the Redfish response after event log mark as resolved.
dnirmala4c5dfba2023-04-06 00:18:01 -0500179 Get And Verify Status Of Resolved Field In Event Logs ${True}
dnirmala4ceb07c2023-03-21 01:51:16 -0500180
181
182Verify Resolving Multiple Error Logs In GUI
183 [Documentation] Verify that error logs can be resolved via GUI
184 ... and the resolution is reflected in Redfish.
185 [Tags] Verify_Resolving_Multiple_Error_Logs_In_GUI
186 [Setup] Redfish Purge Event Log
187
188 Create Error Logs ${3}
dnirmalaa19640e2023-06-16 08:12:36 -0500189 Refresh GUI
dnirmalaa19640e2023-06-16 08:12:36 -0500190
manashsarmaa34d3cd2024-06-03 02:58:53 -0500191 Select All Events
dnirmala4ceb07c2023-03-21 01:51:16 -0500192 Click Element ${xpath_event_logs_resolve}
manashsarmaa34d3cd2024-06-03 02:58:53 -0500193
194 # Since we are selecting 'all events', 3+1 logs are resolved including informational.
195 Wait Until Page Contains Successfully resolved 4 logs. timeout=10
rramyasr-in5a7cfc92023-04-24 08:57:26 -0500196 Wait Until Page Does Not Contain Element Success
dnirmala4ceb07c2023-03-21 01:51:16 -0500197 # Verify the event logs status from Redfish after mark as resolved.
dnirmala4c5dfba2023-04-06 00:18:01 -0500198 Get And Verify Status Of Resolved Field In Event Logs ${True}
199
200
201Verify Default Value Of Resolved Field In Error Log
202 [Documentation] Verify that error log unresolved status from GUI
203 [Tags] Verify_Default_Value_Of_Resolved_Field_In_Error_Log
204
205 Redfish Purge Event Log
206 Create Error Logs ${1}
dnirmalaa19640e2023-06-16 08:12:36 -0500207 Refresh GUI
dnirmala4c5dfba2023-04-06 00:18:01 -0500208
209 # Verify default value of resolved field from GUI.
210 Element Should Contain ${xpath_event_log_data} Unresolved
dnirmala91c88ad2023-03-16 06:13:34 -0500211
212
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500213*** Keywords ***
214
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500215Suite Setup Execution
216 [Documentation] Do suite setup tasks.
217
218 Launch Browser And Login GUI
219 Navigate To Event Logs Page
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600220 Redfish.Login
rramyasr-ina10514e2022-09-01 12:10:26 -0500221 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600222
223Suite Teardown Execution
224 [Documentation] Suite teardown tasks.
225
226 Redfish.Logout
227 Close Browser
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500228
229Navigate To Event Logs Page
230 [Documentation] Navigate to the event logs page from main menu.
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500231
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500232 Click Element ${xpath_logs_menu}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500233 Click Element ${xpath_event_logs_sub_menu}
234 Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain event-logs
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500235
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500236Create Error Logs
237 [Documentation] Create given number of error logs.
238 [Arguments] ${log_count}
239
240 # Description of argument(s):
241 # log_count Number of error logs to create.
242
243 FOR ${num} IN RANGE ${log_count}
244 Generate Test Error Log
245 END
246
dnirmala4ceb07c2023-03-21 01:51:16 -0500247
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500248Select All Events
249 [Documentation] Select all error logs.
250
251 Click Element At Coordinates ${xpath_select_all_events} 0 0
dnirmala4ceb07c2023-03-21 01:51:16 -0500252
253
dnirmala4c5dfba2023-04-06 00:18:01 -0500254Get And Verify Status Of Resolved Field In Event Logs
dnirmala4ceb07c2023-03-21 01:51:16 -0500255 [Documentation] Get event log entry and verify resolved attribute value.
256 [Arguments] ${expected_resolved_status}
257
258 # Description of argument(s):
259 # expected_resolved_status expected status of resolved field in error logs.
260
261 ${elog_entry}= Get Event Logs
262
263 FOR ${elog} IN @{elog_entry}
264 Should Be Equal ${elog["Resolved"]} ${expected_resolved_status}
265 END