blob: 684bccf7c2d681e836915481286eee61debb154f [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
rramyasr-ina07325b2022-10-28 10:36:48 -05007Library ../../../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
12
Sushma M M15fa20d2020-08-31 02:25:52 -050013*** Variables ***
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050014${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 Dathatri44c5aef2020-07-30 04:16:02 -050019${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 Dathatri304d3462020-11-12 05:29:12 -060025${xpath_delete_first_row} //*[@data-test-id="eventLogs-button-deleteRow-0"][2]
rramyasr-in91e3d4d2022-10-27 05:40:58 -050026${xpath_confirm_delete} //button[text()="Delete"]
rramyasr-ina10514e2022-09-01 12:10:26 -050027${xpath_event_status_resolved} //*[@data-test-id="tableFilter-checkbox-Resolved"]
28${xpath_event_status_unresolved} //*[@data-test-id="tableFilter-checkbox-Unresolved"]
Nandish-Matti5575dad2023-02-21 01:39:59 -060029${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")]
dnirmala2c95efa2023-03-10 03:36:44 -060033${xpath_filter_clearall_button} //button[contains(text(),"Clear all")]
dnirmala4ceb07c2023-03-21 01:51:16 -050034${xpath_clear_search} //button[@title="Clear search input"]
35${xpath_event_log_resolve} //*[@name="switch"]
36${xpath_event_logs_resolve} //button[contains(text(),'Resolve')]
Sushma M M15fa20d2020-08-31 02:25:52 -050037
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050038*** Test Cases ***
39
Sushma M M15fa20d2020-08-31 02:25:52 -050040Verify Navigation To Event Logs Page
41 [Documentation] Verify navigation to Event Logs page.
42 [Tags] Verify_Navigation_To_Event_Logs_Page
43
44 Page Should Contain Element ${xpath_event_logs_heading}
45
46
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050047Verify Existence Of All Buttons In Event Logs Page
48 [Documentation] Verify existence of all buttons in Event Logs page.
49 [Tags] Verify_Existence_Of_All_Buttons_In_Event_Logs_Page
dnirmala2c95efa2023-03-10 03:36:44 -060050 [Setup] Click Element ${xpath_filter_event}
51 [Teardown] Click Button ${xpath_filter_clearall_button}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050052
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050053 # Types of event severity: OK, Warning, Critical.
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050054 Page Should Contain Element ${xpath_event_severity_ok} limit=1
55 Page Should Contain Element ${xpath_event_severity_warning} limit=1
56 Page Should Contain Element ${xpath_event_severity_critical} limit=1
57
rramyasr-ina10514e2022-09-01 12:10:26 -050058 # Types of event status: Resolved, Unresolved.
59 Page Should Contain Element ${xpath_event_status_resolved} limit=1
60 Page Should Contain Element ${xpath_event_status_unresolved} limit=1
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050061
dnirmala2c95efa2023-03-10 03:36:44 -060062
George Keishingd6a77972022-01-31 12:50:29 -060063Verify Existence Of All Input Boxes In Event Logs Page
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050064 [Documentation] Verify existence of all input boxes in Event Logs page.
65 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Event_Logs_Page
66
67 # Search logs.
68 Page Should Contain Element ${xpath_event_search}
69
70 # Date filter.
71 Page Should Contain Element ${xpath_event_from_date} limit=1
72 Page Should Contain Element ${xpath_event_to_date} limit=1
73
74
Anusha Dathatri304d3462020-11-12 05:29:12 -060075Select Single Error Log And Delete
76 [Documentation] Select single error log and delete it.
77 [Tags] Select_Single_Error_Log_And_Delete
78
79 Create Error Logs ${2}
80 ${number_of_events_before}= Get Number Of Event Logs
rramyasr-inff2f9142022-11-23 01:15:48 -060081 Click Element ${xpath_delete_first_row}
Anusha Dathatri304d3462020-11-12 05:29:12 -060082 Wait Until Page Contains Element ${xpath_confirm_delete}
83 Click Button ${xpath_confirm_delete}
84 ${number_of_events_after}= Get Number Of Event Logs
85 Should Be Equal ${number_of_events_before -1} ${number_of_events_after}
86 ... msg=Failed to delete single error log entry.
Nandish-Matti5575dad2023-02-21 01:39:59 -060087 Wait Until Element Is Not Visible ${xpath_success_message} timeout=30
Anusha Dathatri304d3462020-11-12 05:29:12 -060088
Anusha Dathatri9e5070c2020-11-12 06:23:58 -060089
90Select All Error Logs And Verify Buttons
91 [Documentation] Select all error logs and verify delete, export and cancel buttons.
92 [Tags] Select_All_Error_Logs_And_Verify_Buttons
93
94 Create Error Logs ${2}
95 Wait Until Element Is Visible ${xpath_delete_first_row}
96 Select All Events
Nandish-Matti5575dad2023-02-21 01:39:59 -060097 Page Should Contain Element ${xpath_resolved_button}
98 Page Should Contain Element ${xpath_unresolved_button}
rramyasr-in31eb5922022-10-10 10:17:49 -050099 Page Should Contain Element ${xpath_event_action_download}
100 Page Should Contain Element ${xpath_event_action_delete}
101 Page Should Contain Element ${xpath_event_action_cancel}
Anusha Dathatri9e5070c2020-11-12 06:23:58 -0600102
dnirmala91c88ad2023-03-16 06:13:34 -0500103
Anusha Dathatri54edcbc2020-12-10 04:04:08 -0600104Select And Verify Default UTC Timezone For Events
105 [Documentation] Select and verify that default UTC timezone is displayed for an event.
106 [Tags] Select_And_Verify_Default_UTC_Timezone_For_Events
107 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
108 [Teardown] Redfish.Logout
109
110 Create Error Logs ${1}
111
112 # Set Default timezone in profile settings page.
113 Set Timezone In Profile Settings Page Default
114 Navigate To Event Logs Page
115
116 # Get date and time from backend.
117 ${event_data}= Get Event Logs
118 # Date format: 2020-12-07T15:18:35+00:00.
119 ${redfish_event_date_time}= Set Variable ${event_data[0]["Created"].split('T')}
120
121 Page Should Contain ${redfish_event_date_time[0]}
122 Page Should Contain ${redfish_event_date_time[1].split('+')[0]}
123
124
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600125Verify Displayed Event Details With Redfish
126 [Documentation] Verify event details like severity, desc etc using Redfish.
127 [Tags] Verify_Displayed_Event_Details_With_Redfish
128 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
129 [Teardown] Redfish.Logout
130
131 Create Error Logs ${1}
Ashwini Chandrappa154c2132021-06-28 23:44:21 -0500132 # Added a delay for error log to appear on error log page.
133 Sleep 5s
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600134 ${event_data}= Get Event Logs
135 Page Should Contain ${event_data[0]["Severity"]}
136 Page Should Contain ${event_data[0]["EntryType"]}
137 Page Should Contain ${event_data[0]["Message"]}
138
139
George Keishinga87ee1e2023-01-11 22:55:45 -0600140Verify Existence Of All Fields In Event Logs Page
rramyasr-in666c8512023-01-03 03:19:55 -0600141 [Documentation] Verify existence of all required fields in Event Logs page.
142 [Tags] Verify_Existence_Of_All_Fields_In_Event_Logs_Page
143 [Template] Page Should Contain
144
145 #Expected parameters
146 ID
147 Severity
148 Date
149 Description
150 Status
151
152
dnirmala91c88ad2023-03-16 06:13:34 -0500153Verify Invalid Content Search Logs
154 [Documentation] Input invalid PEL ID in the search log and verify error message.
155 [Tags] Verify_Invalid_Content_Search_Logs
156
157 Input Text ${xpath_event_search} AG806993
158 Page Should Contain No items match the search query
dnirmala4ceb07c2023-03-21 01:51:16 -0500159 Click Button ${xpath_clear_search}
160
161
162Verify Resolving Single Error Log In GUI
163 [Documentation] Verify that error log can be resolved via GUI
164 ... and the resolution is reflected in Redfish.
165 [Tags] Verify_Resolving_Single_Error_Log_In_GUI
166 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
167
168 Create Error Logs ${1}
169 # Mark single event log as resolved.
170 Click Element At Coordinates ${xpath_event_log_resolve} 0 0
171 Page Should Contain Successfully resolved 1 log.
172 Wait Until Page Does Not Contain Element Successs
173 # Verify the Redfish response after event log mark as resolved.
174 Get And Verify Value Of Resolved Attribute For Event Logs ${True}
175
176
177Verify Resolving Multiple Error Logs In GUI
178 [Documentation] Verify that error logs can be resolved via GUI
179 ... and the resolution is reflected in Redfish.
180 [Tags] Verify_Resolving_Multiple_Error_Logs_In_GUI
181 [Setup] Redfish Purge Event Log
182
183 Create Error Logs ${3}
184 Select All Events
185 Click Element ${xpath_event_logs_resolve}
186 Page Should Contain Successfully resolved 3 logs.
187 Wait Until Page Does Not Contain Element Successs
188 # Verify the event logs status from Redfish after mark as resolved.
189 Get And Verify Value Of Resolved Attribute For Event Logs ${True}
dnirmala91c88ad2023-03-16 06:13:34 -0500190
191
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500192*** Keywords ***
193
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500194Suite Setup Execution
195 [Documentation] Do suite setup tasks.
196
197 Launch Browser And Login GUI
198 Navigate To Event Logs Page
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600199 Redfish.Login
rramyasr-ina10514e2022-09-01 12:10:26 -0500200 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600201
202Suite Teardown Execution
203 [Documentation] Suite teardown tasks.
204
205 Redfish.Logout
206 Close Browser
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500207
208Navigate To Event Logs Page
209 [Documentation] Navigate to the event logs page from main menu.
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500210
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500211 Click Element ${xpath_logs_menu}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500212 Click Element ${xpath_event_logs_sub_menu}
213 Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain event-logs
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500214
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500215Create Error Logs
216 [Documentation] Create given number of error logs.
217 [Arguments] ${log_count}
218
219 # Description of argument(s):
220 # log_count Number of error logs to create.
221
222 FOR ${num} IN RANGE ${log_count}
223 Generate Test Error Log
224 END
225
dnirmala4ceb07c2023-03-21 01:51:16 -0500226
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500227Select All Events
228 [Documentation] Select all error logs.
229
230 Click Element At Coordinates ${xpath_select_all_events} 0 0
dnirmala4ceb07c2023-03-21 01:51:16 -0500231
232
233Get And Verify Value Of Resolved Attribute For Event Logs
234 [Documentation] Get event log entry and verify resolved attribute value.
235 [Arguments] ${expected_resolved_status}
236
237 # Description of argument(s):
238 # expected_resolved_status expected status of resolved field in error logs.
239
240 ${elog_entry}= Get Event Logs
241
242 FOR ${elog} IN @{elog_entry}
243 Should Be Equal ${elog["Resolved"]} ${expected_resolved_status}
244 END