blob: 505d72d4dc05da07bb2100788feaf97d05c081e4 [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
Rahul Maheshwarid29cf302020-07-07 03:13:17 -05007
Anusha Dathatri44c5aef2020-07-30 04:16:02 -05008Suite Setup Suite Setup Execution
Anusha Dathatri7d5c2642021-01-12 23:55:52 -06009Suite Teardown Suite Teardown Execution
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050010
11
Sushma M M15fa20d2020-08-31 02:25:52 -050012*** Variables ***
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050013${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 Dathatri304d3462020-11-12 05:29:12 -060025${xpath_delete_first_row} //*[@data-test-id="eventLogs-button-deleteRow-0"][2]
26${xpath_confirm_delete} //button[@class="btn btn-primary"]
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"]
Sushma M M15fa20d2020-08-31 02:25:52 -050029
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050030*** Test Cases ***
31
Sushma M M15fa20d2020-08-31 02:25:52 -050032Verify Navigation To Event Logs Page
33 [Documentation] Verify navigation to Event Logs page.
34 [Tags] Verify_Navigation_To_Event_Logs_Page
35
36 Page Should Contain Element ${xpath_event_logs_heading}
37
38
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050039Verify Existence Of All Buttons In Event Logs Page
40 [Documentation] Verify existence of all buttons in Event Logs page.
41 [Tags] Verify_Existence_Of_All_Buttons_In_Event_Logs_Page
Anusha Dathatri2e93a692021-01-28 05:38:48 -060042 [Teardown] Click Element ${xpath_filter_event}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -050043
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050044 # Types of event severity: OK, Warning, Critical.
45 Click Element ${xpath_filter_event}
46 Page Should Contain Element ${xpath_event_severity_ok} limit=1
47 Page Should Contain Element ${xpath_event_severity_warning} limit=1
48 Page Should Contain Element ${xpath_event_severity_critical} limit=1
49
rramyasr-ina10514e2022-09-01 12:10:26 -050050 # Types of event status: Resolved, Unresolved.
51 Page Should Contain Element ${xpath_event_status_resolved} limit=1
52 Page Should Contain Element ${xpath_event_status_unresolved} limit=1
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050053
George Keishingd6a77972022-01-31 12:50:29 -060054Verify Existence Of All Input Boxes In Event Logs Page
Anusha Dathatri44c5aef2020-07-30 04:16:02 -050055 [Documentation] Verify existence of all input boxes in Event Logs page.
56 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Event_Logs_Page
57
58 # Search logs.
59 Page Should Contain Element ${xpath_event_search}
60
61 # Date filter.
62 Page Should Contain Element ${xpath_event_from_date} limit=1
63 Page Should Contain Element ${xpath_event_to_date} limit=1
64
65
Anusha Dathatri304d3462020-11-12 05:29:12 -060066Select Single Error Log And Delete
67 [Documentation] Select single error log and delete it.
68 [Tags] Select_Single_Error_Log_And_Delete
69
70 Create Error Logs ${2}
71 ${number_of_events_before}= Get Number Of Event Logs
72 Click Element At Coordinates ${xpath_delete_first_row} 0 0
73 Wait Until Page Contains Element ${xpath_confirm_delete}
74 Click Button ${xpath_confirm_delete}
75 ${number_of_events_after}= Get Number Of Event Logs
76 Should Be Equal ${number_of_events_before -1} ${number_of_events_after}
77 ... msg=Failed to delete single error log entry.
78
Anusha Dathatri9e5070c2020-11-12 06:23:58 -060079
80Select All Error Logs And Verify Buttons
81 [Documentation] Select all error logs and verify delete, export and cancel buttons.
82 [Tags] Select_All_Error_Logs_And_Verify_Buttons
83
84 Create Error Logs ${2}
85 Wait Until Element Is Visible ${xpath_delete_first_row}
86 Select All Events
87 Wait Until Element Is Visible ${xpath_event_action_delete}
88 Element Should Be Visible ${xpath_event_action_export}
89 Element Should Be Visible ${xpath_event_action_cancel}
90
91
Anusha Dathatri54edcbc2020-12-10 04:04:08 -060092Select And Verify Default UTC Timezone For Events
93 [Documentation] Select and verify that default UTC timezone is displayed for an event.
94 [Tags] Select_And_Verify_Default_UTC_Timezone_For_Events
95 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
96 [Teardown] Redfish.Logout
97
98 Create Error Logs ${1}
99
100 # Set Default timezone in profile settings page.
101 Set Timezone In Profile Settings Page Default
102 Navigate To Event Logs Page
103
104 # Get date and time from backend.
105 ${event_data}= Get Event Logs
106 # Date format: 2020-12-07T15:18:35+00:00.
107 ${redfish_event_date_time}= Set Variable ${event_data[0]["Created"].split('T')}
108
109 Page Should Contain ${redfish_event_date_time[0]}
110 Page Should Contain ${redfish_event_date_time[1].split('+')[0]}
111
112
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600113Verify Displayed Event Details With Redfish
114 [Documentation] Verify event details like severity, desc etc using Redfish.
115 [Tags] Verify_Displayed_Event_Details_With_Redfish
116 [Setup] Run Keywords Redfish.Login AND Redfish Purge Event Log
117 [Teardown] Redfish.Logout
118
119 Create Error Logs ${1}
Ashwini Chandrappa154c2132021-06-28 23:44:21 -0500120 # Added a delay for error log to appear on error log page.
121 Sleep 5s
Anusha Dathatri13cc36e2020-12-09 07:55:19 -0600122 ${event_data}= Get Event Logs
123 Page Should Contain ${event_data[0]["Severity"]}
124 Page Should Contain ${event_data[0]["EntryType"]}
125 Page Should Contain ${event_data[0]["Message"]}
126
127
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500128*** Keywords ***
129
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500130Suite Setup Execution
131 [Documentation] Do suite setup tasks.
132
133 Launch Browser And Login GUI
134 Navigate To Event Logs Page
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600135 Redfish.Login
rramyasr-ina10514e2022-09-01 12:10:26 -0500136 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
Anusha Dathatri7d5c2642021-01-12 23:55:52 -0600137
138Suite Teardown Execution
139 [Documentation] Suite teardown tasks.
140
141 Redfish.Logout
142 Close Browser
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500143
144Navigate To Event Logs Page
145 [Documentation] Navigate to the event logs page from main menu.
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500146
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500147 Click Element ${xpath_logs_menu}
Rahul Maheshwarid29cf302020-07-07 03:13:17 -0500148 Click Element ${xpath_event_logs_sub_menu}
149 Wait Until Keyword Succeeds 30 sec 5 sec Location Should Contain event-logs
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500150
Anusha Dathatri44c5aef2020-07-30 04:16:02 -0500151Create Error Logs
152 [Documentation] Create given number of error logs.
153 [Arguments] ${log_count}
154
155 # Description of argument(s):
156 # log_count Number of error logs to create.
157
158 FOR ${num} IN RANGE ${log_count}
159 Generate Test Error Log
160 END
161
162Select All Events
163 [Documentation] Select all error logs.
164
165 Click Element At Coordinates ${xpath_select_all_events} 0 0