blob: 81adb52cbbd3df59bc22ad0aa9d52e6142889fa5 [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"]
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 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")]
Sushma M M15fa20d2020-08-31 02:25:52 -050034
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050035*** Test Cases ***
36
Sushma M M15fa20d2020-08-31 02:25:52 -050037Verify Navigation To Event Logs Page
38 [Documentation] Verify navigation to Event Logs page.
39 [Tags] Verify_Navigation_To_Event_Logs_Page
40
41 Page Should Contain Element ${xpath_event_logs_heading}
42
43
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050044Verify Existence Of All Buttons In Event Logs Page
45 [Documentation] Verify existence of all buttons in Event Logs page.
46 [Tags] Verify_Existence_Of_All_Buttons_In_Event_Logs_Page
Anusha Dathatri2e93a692021-01-28 05:38:48 -060047 [Teardown] Click Element ${xpath_filter_event}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050048
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050049 # Types of event severity: OK, Warning, Critical.
50 Click Element ${xpath_filter_event}
51 Page Should Contain Element ${xpath_event_severity_ok} limit=1
52 Page Should Contain Element ${xpath_event_severity_warning} limit=1
53 Page Should Contain Element ${xpath_event_severity_critical} limit=1
54
rramyasr-ina10514e2022-09-01 12:10:26 -050055 # Types of event status: Resolved, Unresolved.
56 Page Should Contain Element ${xpath_event_status_resolved} limit=1
57 Page Should Contain Element ${xpath_event_status_unresolved} limit=1
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050058
George Keishingd6a77972022-01-31 12:50:29 -060059Verify Existence Of All Input Boxes In Event Logs Page
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050060 [Documentation] Verify existence of all input boxes in Event Logs page.
61 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Event_Logs_Page
62
63 # Search logs.
64 Page Should Contain Element ${xpath_event_search}
65
66 # Date filter.
67 Page Should Contain Element ${xpath_event_from_date} limit=1
68 Page Should Contain Element ${xpath_event_to_date} limit=1
69
70
Anusha Dathatri304d3462020-11-12 05:29:12 -060071Select Single Error Log And Delete
72 [Documentation] Select single error log and delete it.
73 [Tags] Select_Single_Error_Log_And_Delete
74
75 Create Error Logs ${2}
76 ${number_of_events_before}= Get Number Of Event Logs
rramyasr-inff2f9142022-11-23 01:15:48 -060077 Click Element ${xpath_delete_first_row}
Anusha Dathatri304d3462020-11-12 05:29:12 -060078 Wait Until Page Contains Element ${xpath_confirm_delete}
79 Click Button ${xpath_confirm_delete}
80 ${number_of_events_after}= Get Number Of Event Logs
81 Should Be Equal ${number_of_events_before -1} ${number_of_events_after}
82 ... msg=Failed to delete single error log entry.
Nandish-Matti5575dad2023-02-21 01:39:59 -060083 Wait Until Element Is Not Visible ${xpath_success_message} timeout=30
Anusha Dathatri304d3462020-11-12 05:29:12 -060084
Anusha Dathatri9e5070c2020-11-12 06:23:58 -060085
86Select All Error Logs And Verify Buttons
87 [Documentation] Select all error logs and verify delete, export and cancel buttons.
88 [Tags] Select_All_Error_Logs_And_Verify_Buttons
89
90 Create Error Logs ${2}
91 Wait Until Element Is Visible ${xpath_delete_first_row}
92 Select All Events
Nandish-Matti5575dad2023-02-21 01:39:59 -060093 Page Should Contain Element ${xpath_resolved_button}
94 Page Should Contain Element ${xpath_unresolved_button}
rramyasr-in31eb5922022-10-10 10:17:49 -050095 Page Should Contain Element ${xpath_event_action_download}
96 Page Should Contain Element ${xpath_event_action_delete}
97 Page Should Contain Element ${xpath_event_action_cancel}
Anusha Dathatri9e5070c2020-11-12 06:23:58 -060098
Anusha Dathatri54edcbc2020-12-10 04:04:08 -060099Select And Verify Default UTC Timezone For Events
100 [Documentation] Select and verify that default UTC timezone is displayed for an event.
101 [Tags] Select_And_Verify_Default_UTC_Timezone_For_Events
102 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
103 [Teardown] Redfish.Logout
104
105 Create Error Logs ${1}
106
107 # Set Default timezone in profile settings page.
108 Set Timezone In Profile Settings Page Default
109 Navigate To Event Logs Page
110
111 # Get date and time from backend.
112 ${event_data}= Get Event Logs
113 # Date format: 2020-12-07T15:18:35+00:00.
114 ${redfish_event_date_time}= Set Variable ${event_data[0]["Created"].split('T')}
115
116 Page Should Contain ${redfish_event_date_time[0]}
117 Page Should Contain ${redfish_event_date_time[1].split('+')[0]}
118
119
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600120Verify Displayed Event Details With Redfish
121 [Documentation] Verify event details like severity, desc etc using Redfish.
122 [Tags] Verify_Displayed_Event_Details_With_Redfish
123 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
124 [Teardown] Redfish.Logout
125
126 Create Error Logs ${1}
Ashwini Chandrappa154c2132021-06-28 23:44:21 -0500127 # Added a delay for error log to appear on error log page.
128 Sleep 5s
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600129 ${event_data}= Get Event Logs
130 Page Should Contain ${event_data[0]["Severity"]}
131 Page Should Contain ${event_data[0]["EntryType"]}
132 Page Should Contain ${event_data[0]["Message"]}
133
134
George Keishinga87ee1e2023-01-11 22:55:45 -0600135Verify Existence Of All Fields In Event Logs Page
rramyasr-in666c8512023-01-03 03:19:55 -0600136 [Documentation] Verify existence of all required fields in Event Logs page.
137 [Tags] Verify_Existence_Of_All_Fields_In_Event_Logs_Page
138 [Template] Page Should Contain
139
140 #Expected parameters
141 ID
142 Severity
143 Date
144 Description
145 Status
146
147
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500148*** Keywords ***
149
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500150Suite Setup Execution
151 [Documentation] Do suite setup tasks.
152
153 Launch Browser And Login GUI
154 Navigate To Event Logs Page
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600155 Redfish.Login
rramyasr-ina10514e2022-09-01 12:10:26 -0500156 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600157
158Suite Teardown Execution
159 [Documentation] Suite teardown tasks.
160
161 Redfish.Logout
162 Close Browser
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500163
164Navigate To Event Logs Page
165 [Documentation] Navigate to the event logs page from main menu.
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500166
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500167 Click Element ${xpath_logs_menu}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500168 Click Element ${xpath_event_logs_sub_menu}
169 Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain event-logs
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500170
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500171Create Error Logs
172 [Documentation] Create given number of error logs.
173 [Arguments] ${log_count}
174
175 # Description of argument(s):
176 # log_count Number of error logs to create.
177
178 FOR ${num} IN RANGE ${log_count}
179 Generate Test Error Log
180 END
181
182Select All Events
183 [Documentation] Select all error logs.
184
185 Click Element At Coordinates ${xpath_select_all_events} 0 0