blob: 91a7c9b982199949324455bb7fde9fc90b26e5af [file] [log] [blame]
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -05001*** Settings ***
2
sarandev35100dda2023-02-13 02:59:15 -06003Documentation Test OpenBMC GUI "Date and time" sub-menu of "Settings".
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -05004
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -05006
7Suite Setup Suite Setup Execution
sarandev3df94f6f2023-02-22 00:28:27 -06008Suite Teardown Suite Teardown Execution
sarandev3088958d2023-02-09 01:57:12 -06009Test Setup Navigate To Date and Time Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050010
11*** Variables ***
12
sarandev3df94f6f2023-02-22 00:28:27 -060013${xpath_date_time_heading} //h1[text()="Date and time"]
14${xpath_select_manual} //*[@data-test-id="dateTime-radio-configureManual"]
15${xpath_select_ntp} //*[@data-test-id="dateTime-radio-configureNTP"]
16${xpath_manual_date} //input[@data-test-id="dateTime-input-manualDate"]
17${xpath_manual_time} //input[@data-test-id="dateTime-input-manualTime"]
18${xpath_ntp_server1} //input[@data-test-id="dateTime-input-ntpServer1"]
19${xpath_ntp_server2} //input[@data-test-id="dateTime-input-ntpServer2"]
20${xpath_ntp_server3} //input[@data-test-id="dateTime-input-ntpServer3"]
21${xpath_select_save_settings} //button[@data-test-id="dateTime-button-saveSettings"]
22${xpath_invalid_format_message} //*[contains(text(), "Invalid format")]
sarandev3cffb59e2023-03-03 03:14:08 -060023${LOOP_COUNT} 2
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050024
25*** Test Cases ***
26
Rahul Maheshwari142642d2021-08-24 00:00:15 -050027Verify Navigation To Date And Time Page
28 [Documentation] Verify navigation to date and time page.
29 [Tags] Verify_Navigation_To_Date_And_Time_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050030
31 Page Should Contain Element ${xpath_date_time_heading}
32
33
sarandev330230502023-03-16 00:40:12 -050034Verify Text Under Date And Time Page
35 [Documentation] Verify the presence of the required text on the date and time page.
36 [Tags] Verify_Text_Under_Date_And_Time_Page
37
38
39 Page Should Contain To change how date and time are displayed
40 ... (either UTC or browser offset) throughout the application, visit Profile Settings
41
42 Page Should Contain If NTP is selected but an NTP server is not given or the
43 ... given NTP server is not reachable, then time.google.com will be used.
44
45
Rahul Maheshwari142642d2021-08-24 00:00:15 -050046Verify Existence Of All Sections In Date And Time Page
47 [Documentation] Verify existence of all sections in date and time page.
George Keishingd6a77972022-01-31 12:50:29 -060048 [Tags] Verify_Existence_Of_All_Sections_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050049
50 Page Should Contain Configure settings
51
52
Rahul Maheshwari142642d2021-08-24 00:00:15 -050053Verify Existence Of All Buttons In Date And Time Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050054 [Documentation] Verify existence of all buttons in date and time settings page.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050055 [Tags] Verify_Existence_Of_All_Buttons_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050056
57 Page Should Contain Element ${xpath_select_manual}
58 Page Should Contain Element ${xpath_select_ntp}
59 Page Should Contain Element ${xpath_select_save_settings}
60
61
Rahul Maheshwari142642d2021-08-24 00:00:15 -050062Verify Existence Of All Input Boxes In Date And Time Page
63 [Documentation] Verify existence of all input boxes in date time page.
64 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050065
66 Click Element At Coordinates ${xpath_select_manual} 0 0
67 Page Should Contain Element ${xpath_manual_date}
68 Page Should Contain Element ${xpath_manual_time}
69
70 Click Element At Coordinates ${xpath_select_ntp} 0 0
71 Page Should Contain Element ${xpath_ntp_server1}
72 Page Should Contain Element ${xpath_ntp_server2}
73 Page Should Contain Element ${xpath_ntp_server3}
74
75
Sushma M M2ba26e82020-11-25 14:07:15 -060076Verify Date And Time From Configuration Section
77 [Documentation] Get date and time from configuration section and verify it via BMC CLI.
78 [Tags] Verify_Date_And_Time_From_Configuration_Section
79
80 Click Element At Coordinates ${xpath_select_manual} 0 0
81 ${manual_date}= Get Value ${xpath_manual_date}
82 ${manual_time}= Get Value ${xpath_manual_time}
83
84 ${cli_date_time}= CLI Get BMC DateTime
85 Should contain ${cli_date_time} ${manual_date} ${manual_time}
86
87
George Keishingd6a77972022-01-31 12:50:29 -060088Verify Display Of Date And Time In GUI Page
Sushma M M17ac1f52020-11-25 05:38:00 -060089 [Documentation] Get date and time from Redfish and verify it via GUI date and time page.
George Keishingd6a77972022-01-31 12:50:29 -060090 [Tags] Verify_Display_Of_Date_And_Time_In_GUI_Page
Sushma M M17ac1f52020-11-25 05:38:00 -060091
92 # Set Default timezone in profile settings page.
93 Set Timezone In Profile Settings Page Default
94 Navigate To Date and Time Page
95
96 # Get date and time from Redfish.
97 ${redfish_date_time}= CLI Get BMC DateTime
98 ${redfish_date}= Convert Date ${redfish_date_time} result_format=%Y-%m-%d
99 ${redfish_time}= Convert Date ${redfish_date_time} result_format=%H:%M
100
101 # Verify date and time via GUI date and time page.
102
103 Page Should Contain ${redfish_date}
104 Page Should Contain ${redfish_time}
105
sarandev3ff7f34b2023-01-16 05:09:20 -0600106
sarandev39cbaca82023-01-10 00:16:55 -0600107Verify Profile Setting Button In Date And Time Page
108 [Documentation] Verify navigation to profile setting page after clicking
109 ... on profile setting button in date and time page.
110 [Tags] Verify_Profile_Setting_Button_In_Date_And_Time_Page
111
sarandev34d1a7372023-01-27 02:10:38 -0600112 Click Element ${xpath_profile_settings_link}
sarandev39cbaca82023-01-10 00:16:55 -0600113 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10
114 Location Should Contain profile-settings
115
Sushma M M17ac1f52020-11-25 05:38:00 -0600116
sarandev3ff7f34b2023-01-16 05:09:20 -0600117Verify Existence Of Timezone Buttons In Profile Settings Page
118 [Documentation] Verify default UTC button and browser offset IST button
119 ... in Profile settings page
120 [Tags] Verify_Existence_Of_Timezone_Buttons_In_Profile_Settings_Page
121
sarandev34d1a7372023-01-27 02:10:38 -0600122 Click Element ${xpath_profile_settings_link}
123 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=30
124 Page Should Contain Element ${xpath_default_UTC}
125 Page Should Contain Element ${xpath_browser_offset}
sarandev3ff7f34b2023-01-16 05:09:20 -0600126
127
George Keishing70bbd942023-02-09 22:55:04 -0600128Verify Date And Time Change To Browser Offset Time
sarandev34d1a7372023-01-27 02:10:38 -0600129 [Documentation] Verify date and time change to broswer's offset time when
130 ... 'Browser offset' option is selected in Profile settings page.
131 [Tags] Verify_Date_And_Time_Change_To_Browser_Offset_Time
sarandev3ff7f34b2023-01-16 05:09:20 -0600132
sarandev34d1a7372023-01-27 02:10:38 -0600133 Click Element ${xpath_profile_settings_link}
134 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10
135 Click Element At Coordinates ${xpath_browser_offset} 0 0
sarandev3ff7f34b2023-01-16 05:09:20 -0600136 Click Element ${xpath_profile_save_button}
sarandev34d1a7372023-01-27 02:10:38 -0600137 ${xpath_browser_offset_text}= Get Text ${xpath_browser_offset_textfield}
138
139 # We get an output ${xpath_browser_offset_text} = Browser offset (CST UTC-6).
140 # Need to compare "CST UTC-6" text so removing the spaces and other values.
141
142 ${text}= Set Variable ${xpath_browser_offset_text.split("(")[1].split(")")[0]}
sarandev3ff7f34b2023-01-16 05:09:20 -0600143 Navigate To Date and Time Page
sarandev34d1a7372023-01-27 02:10:38 -0600144 Page Should Contain ${text}
sarandev3ff7f34b2023-01-16 05:09:20 -0600145
146
Sushma M Mcba1b822020-11-25 16:02:48 -0600147Verify NTP Server Input Fields In Date And Time Page
148 [Documentation] Verify NTP server input fields in date and time page.
149 [Tags] Verify_NTP_Server_Input_Fields_In_Date_And_Time_Page
sarandev3088958d2023-02-09 01:57:12 -0600150 [Setup] Setup To Power Off And Navigate
Sushma M Mcba1b822020-11-25 16:02:48 -0600151
sarandev363c4c292023-02-07 06:27:27 -0600152 Click Element At Coordinates ${xpath_select_ntp} 0 0
153 Input Text ${xpath_ntp_server1} 10.10.10.10
154 Input Text ${xpath_ntp_server2} 20.20.20.20
155 Input Text ${xpath_ntp_server3} 30.30.30.30
156 Click Element ${xpath_select_save_settings}
157
Sushma M Mcba1b822020-11-25 16:02:48 -0600158
159 # Refresh the NTP Page.
160 Click Element ${xpath_refresh_button}
161 Wait Until Page Contains Element ${xpath_select_ntp} timeout=10s
162
163 Textfield Value Should Be ${xpath_ntp_server1} 10.10.10.10
164 Textfield Value Should Be ${xpath_ntp_server2} 20.20.20.20
165 Textfield Value Should Be ${xpath_ntp_server3} 30.30.30.30
166
167
sarandev35100dda2023-02-13 02:59:15 -0600168Verify Setting Manual BMC Time
169 [Documentation] Verify changing manual time and comparing it with CLI time.
170 [Tags] Verify_Setting_Manual_BMC_Time
171 [Setup] Run Keywords Set Timezone In Profile Settings Page
172 ... Default AND Setup To Power Off And Navigate
173
174 Click Element At Coordinates ${xpath_select_manual} 0 0
175 Input Text ${xpath_manual_date} 2023-05-12
176 Input Text ${xpath_manual_time} 15:30
177 Click Element ${xpath_select_save_settings}
178
179 # Wait for changes to take effect.
180 Sleep 120
181 ${manual_date}= Get Value ${xpath_manual_date}
182 ${manual_time}= Get Value ${xpath_manual_time}
183
184 ${cli_date_time}= CLI Get BMC DateTime
185 Should contain ${cli_date_time} ${manual_date} ${manual_time}
186
187
sarandev390f93d42023-02-16 04:13:52 -0600188Verify Setting Invalid Date And Time Is Not Allowed
189 [Documentation] Verify if invalid date and invalid time input is given,
190 ... it should throw error.
191 [Tags] Verify_Setting_Invalid_Date_And_Time_Is_Not_Allowed
192 [Setup] Setup To Power Off And Navigate
193
194 Click Element At Coordinates ${xpath_select_manual} 0 0
195 Input Text ${xpath_manual_date} 2023-18-48
196 Page Should Contain Element ${xpath_invalid_format_message}
197 Input Text ${xpath_manual_time} 29:48
198 Page Should Contain Element ${xpath_invalid_format_message}
199
200
sarandev3df94f6f2023-02-22 00:28:27 -0600201Verify Changing BMC Time From NTP To Manual
sarandev3cffb59e2023-03-03 03:14:08 -0600202 [Documentation] Verify that BMC time can be changed from NTP to
sarandev3df94f6f2023-02-22 00:28:27 -0600203 ... manual time via GUI.
204 [Tags] Verify_Changing_BMC_Time_From_NTP_To_Manual
205 [Setup] Setup To Power Off And Navigate
206
sarandev3405572f2023-02-27 03:37:08 -0600207 # Add NTP server for BMC time to sync.
sarandev3df94f6f2023-02-22 00:28:27 -0600208 Click Element At Coordinates ${xpath_select_ntp} 0 0
209 Input Text ${xpath_ntp_server1} time.google.com
210 Click Element ${xpath_select_save_settings}
211
212 # Wait for changes to take effect.
213 Wait Until Page Contains Element ${xpath_select_ntp} timeout=30s
214
215 # Set the manual date and time.
216 ${cli_date_time}= CLI Get BMC DateTime
217 ${date_changed}= Add Time To Date ${cli_date_time} 31 days
218 ${date_changed}= Add Time To Date ${date_changed} 05:10:00
219 Log "Setting BMC date : ${date_changed} using Manual option"
220 ${date}= Convert Date ${date_changed} result_format=%Y-%m-%d
221 ${time}= Convert Date ${date_changed} result_format=%H:%M
222 Click Element At Coordinates ${xpath_select_manual} 0 0
223 Input Text ${xpath_manual_date} ${date}
224 Input Text ${xpath_manual_time} ${time}
225 Click Element ${xpath_select_save_settings}
226
227 # Refresh the NTP Page.
228 Click Element ${xpath_refresh_button}
229 Wait Until Page Contains ${date} timeout=60s
230 Page Should Contain ${time}
231
232 # Wait for the "Saved Successfully" window to close automatically.
233 Sleep 15
234
235
sarandev3cffb59e2023-03-03 03:14:08 -0600236Verify Moving From Manual To NTP
237 [Documentation] Verify switching between manual mode and NTP mode.
238 [Tags] Verify_Moving_From_Manual_To_NTP
sarandev3405572f2023-02-27 03:37:08 -0600239 [Setup] Setup To Power Off And Navigate
sarandev3cffb59e2023-03-03 03:14:08 -0600240 [Template] Switch From Manual To NTP
sarandev3405572f2023-02-27 03:37:08 -0600241
sarandev3cffb59e2023-03-03 03:14:08 -0600242 # loop_count
243 ${LOOP_COUNT}
sarandev3405572f2023-02-27 03:37:08 -0600244
245
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -0500246*** Keywords ***
247
248Suite Setup Execution
249 [Documentation] Do test case setup tasks.
250
251 Launch Browser And Login GUI
sarandev34d1a7372023-01-27 02:10:38 -0600252 Maximize Browser Window
sarandev3088958d2023-02-09 01:57:12 -0600253
sarandev3df94f6f2023-02-22 00:28:27 -0600254Suite Teardown Execution
255 [Documentation] Do the post suite teardown.
256
257 Logout GUI
258 Close Browser
259
George Keishing70bbd942023-02-09 22:55:04 -0600260Setup To Power Off And Navigate
sarandev3088958d2023-02-09 01:57:12 -0600261 [Documentation] Power off system if not powered off and go to date and
262 ... time page.
263
264 Redfish Power off stack_mode=skip
265 Navigate To Date and Time Page
266
Sushma M M17ac1f52020-11-25 05:38:00 -0600267Navigate To Date and Time Page
268 [Documentation] Navigate to the date and time page from main menu.
269
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500270 Click Element ${xpath_settings_menu}
271 Click Element ${xpath_date_time_sub_menu}
272 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain date-time
rramyasr-in05da0fb2022-08-26 05:52:03 -0500273 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
274
sarandev3405572f2023-02-27 03:37:08 -0600275Set Manual Date and Time Via GUI
276 [Documentation] Set BMC date and time to one month in future via GUI.
277
278 ${cli_date_time}= CLI Get BMC DateTime
279 ${new_date}= Add Time To Date ${cli_date_time} 31 days
280 ${new_date_time}= Add Time To Date ${new_date} 05:10:00
281 Log "Setting BMC date : ${new_date_time} using Manual option"
282 ${date}= Convert Date ${new_date_time} result_format=%Y-%m-%d
283 ${time}= Convert Date ${new_date_time} result_format=%H:%M
284 Click Element At Coordinates ${xpath_select_manual} 0 0
285 Input Text ${xpath_manual_date} ${date}
286 Input Text ${xpath_manual_time} ${time}
287 Click Element ${xpath_select_save_settings}
288
289 # Wait for changes to take effect.
290 Wait Until Element Is Enabled ${xpath_select_ntp} timeout=30s
291
sarandev3cffb59e2023-03-03 03:14:08 -0600292Switch From Manual To NTP
293 [Documentation] Verify switching from manual mode to NTP mode.
294 [Arguments] ${loop_count}=${LOOP_COUNT}
295
296 # Description of argument(s):
297 # loop_count Number of loops to move from manual to NTP.
298
299 FOR ${x} IN RANGE ${loop_count}
300 Set Manual Date and Time Via GUI
301 # Set BMC date time to sync with NTP server.
302 Click Element At Coordinates ${xpath_select_ntp} 0 0
303 Input Text ${xpath_ntp_server1} 216.239.35.0
304 Click Element ${xpath_select_save_settings}
305
306 # Wait until saved successfully message is visible.
307 Wait Until Element Is Visible ${xpath_success_message} timeout=60
308
309 ${cli_date_time}= CLI Get BMC DateTime
310 ${ntp_date}= Convert Date ${cli_date_time} result_format=%Y-%m-%d
311 ${ntp_time}= Convert Date ${cli_date_time} result_format=%H:%M
312 Wait Until Page Contains ${ntp_date} timeout=60s
313 Page Should Contain ${ntp_time}
314
315 Wait Until Element Is Not Visible ${xpath_success_message} timeout=60
316 Log "Completed Loop for ${x} time"
317 END