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