blob: 8a66bccf72ac071b425916b44216a8f8a0f6546f [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
Matt Fischer6fb70d92023-10-24 19:06:33 -060011Test Tags Date_And_Time_Sub_Menu
George Keishing79fcf232023-10-12 17:06:38 +053012
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050013*** Variables ***
14
sarandev3df94f6f2023-02-22 00:28:27 -060015${xpath_date_time_heading} //h1[text()="Date and time"]
16${xpath_select_manual} //*[@data-test-id="dateTime-radio-configureManual"]
17${xpath_select_ntp} //*[@data-test-id="dateTime-radio-configureNTP"]
18${xpath_manual_date} //input[@data-test-id="dateTime-input-manualDate"]
19${xpath_manual_time} //input[@data-test-id="dateTime-input-manualTime"]
20${xpath_ntp_server1} //input[@data-test-id="dateTime-input-ntpServer1"]
21${xpath_ntp_server2} //input[@data-test-id="dateTime-input-ntpServer2"]
22${xpath_ntp_server3} //input[@data-test-id="dateTime-input-ntpServer3"]
23${xpath_select_save_settings} //button[@data-test-id="dateTime-button-saveSettings"]
24${xpath_invalid_format_message} //*[contains(text(), "Invalid format")]
sarandev3cffb59e2023-03-03 03:14:08 -060025${LOOP_COUNT} 2
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050026
27*** Test Cases ***
28
Rahul Maheshwari142642d2021-08-24 00:00:15 -050029Verify Navigation To Date And Time Page
30 [Documentation] Verify navigation to date and time page.
31 [Tags] Verify_Navigation_To_Date_And_Time_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050032
33 Page Should Contain Element ${xpath_date_time_heading}
34
35
sarandev330230502023-03-16 00:40:12 -050036Verify Text Under Date And Time Page
George Keishinga91601b2023-03-21 09:35:49 +053037 [Documentation] Verify the presence of the required text on the date and time page.
sarandev330230502023-03-16 00:40:12 -050038 [Tags] Verify_Text_Under_Date_And_Time_Page
39
40
41 Page Should Contain To change how date and time are displayed
42 ... (either UTC or browser offset) throughout the application, visit Profile Settings
43
44 Page Should Contain If NTP is selected but an NTP server is not given or the
45 ... given NTP server is not reachable, then time.google.com will be used.
46
47
Rahul Maheshwari142642d2021-08-24 00:00:15 -050048Verify Existence Of All Sections In Date And Time Page
49 [Documentation] Verify existence of all sections in date and time page.
George Keishingd6a77972022-01-31 12:50:29 -060050 [Tags] Verify_Existence_Of_All_Sections_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050051
52 Page Should Contain Configure settings
53
54
Rahul Maheshwari142642d2021-08-24 00:00:15 -050055Verify Existence Of All Buttons In Date And Time Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050056 [Documentation] Verify existence of all buttons in date and time settings page.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050057 [Tags] Verify_Existence_Of_All_Buttons_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050058
59 Page Should Contain Element ${xpath_select_manual}
60 Page Should Contain Element ${xpath_select_ntp}
61 Page Should Contain Element ${xpath_select_save_settings}
62
63
Rahul Maheshwari142642d2021-08-24 00:00:15 -050064Verify Existence Of All Input Boxes In Date And Time Page
65 [Documentation] Verify existence of all input boxes in date time page.
66 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050067
68 Click Element At Coordinates ${xpath_select_manual} 0 0
69 Page Should Contain Element ${xpath_manual_date}
70 Page Should Contain Element ${xpath_manual_time}
71
72 Click Element At Coordinates ${xpath_select_ntp} 0 0
73 Page Should Contain Element ${xpath_ntp_server1}
74 Page Should Contain Element ${xpath_ntp_server2}
75 Page Should Contain Element ${xpath_ntp_server3}
76
77
Sushma M M2ba26e82020-11-25 14:07:15 -060078Verify Date And Time From Configuration Section
79 [Documentation] Get date and time from configuration section and verify it via BMC CLI.
80 [Tags] Verify_Date_And_Time_From_Configuration_Section
81
82 Click Element At Coordinates ${xpath_select_manual} 0 0
83 ${manual_date}= Get Value ${xpath_manual_date}
84 ${manual_time}= Get Value ${xpath_manual_time}
85
86 ${cli_date_time}= CLI Get BMC DateTime
87 Should contain ${cli_date_time} ${manual_date} ${manual_time}
88
89
George Keishingd6a77972022-01-31 12:50:29 -060090Verify Display Of Date And Time In GUI Page
Sushma M M17ac1f52020-11-25 05:38:00 -060091 [Documentation] Get date and time from Redfish and verify it via GUI date and time page.
George Keishingd6a77972022-01-31 12:50:29 -060092 [Tags] Verify_Display_Of_Date_And_Time_In_GUI_Page
Sushma M M17ac1f52020-11-25 05:38:00 -060093
94 # Set Default timezone in profile settings page.
95 Set Timezone In Profile Settings Page Default
96 Navigate To Date and Time Page
97
98 # Get date and time from Redfish.
99 ${redfish_date_time}= CLI Get BMC DateTime
100 ${redfish_date}= Convert Date ${redfish_date_time} result_format=%Y-%m-%d
101 ${redfish_time}= Convert Date ${redfish_date_time} result_format=%H:%M
102
103 # Verify date and time via GUI date and time page.
104
105 Page Should Contain ${redfish_date}
106 Page Should Contain ${redfish_time}
107
sarandev3ff7f34b2023-01-16 05:09:20 -0600108
sarandev39cbaca82023-01-10 00:16:55 -0600109Verify Profile Setting Button In Date And Time Page
110 [Documentation] Verify navigation to profile setting page after clicking
111 ... on profile setting button in date and time page.
112 [Tags] Verify_Profile_Setting_Button_In_Date_And_Time_Page
113
sarandev34d1a7372023-01-27 02:10:38 -0600114 Click Element ${xpath_profile_settings_link}
sarandev39cbaca82023-01-10 00:16:55 -0600115 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10
116 Location Should Contain profile-settings
117
Sushma M M17ac1f52020-11-25 05:38:00 -0600118
sarandev3ff7f34b2023-01-16 05:09:20 -0600119Verify Existence Of Timezone Buttons In Profile Settings Page
120 [Documentation] Verify default UTC button and browser offset IST button
121 ... in Profile settings page
122 [Tags] Verify_Existence_Of_Timezone_Buttons_In_Profile_Settings_Page
123
sarandev34d1a7372023-01-27 02:10:38 -0600124 Click Element ${xpath_profile_settings_link}
125 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=30
126 Page Should Contain Element ${xpath_default_UTC}
127 Page Should Contain Element ${xpath_browser_offset}
sarandev3ff7f34b2023-01-16 05:09:20 -0600128
129
George Keishing70bbd942023-02-09 22:55:04 -0600130Verify Date And Time Change To Browser Offset Time
sarandev34d1a7372023-01-27 02:10:38 -0600131 [Documentation] Verify date and time change to broswer's offset time when
132 ... 'Browser offset' option is selected in Profile settings page.
133 [Tags] Verify_Date_And_Time_Change_To_Browser_Offset_Time
sarandev3ff7f34b2023-01-16 05:09:20 -0600134
sarandev34d1a7372023-01-27 02:10:38 -0600135 Click Element ${xpath_profile_settings_link}
136 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10
137 Click Element At Coordinates ${xpath_browser_offset} 0 0
sarandev3ff7f34b2023-01-16 05:09:20 -0600138 Click Element ${xpath_profile_save_button}
sarandev34d1a7372023-01-27 02:10:38 -0600139 ${xpath_browser_offset_text}= Get Text ${xpath_browser_offset_textfield}
140
141 # We get an output ${xpath_browser_offset_text} = Browser offset (CST UTC-6).
142 # Need to compare "CST UTC-6" text so removing the spaces and other values.
143
144 ${text}= Set Variable ${xpath_browser_offset_text.split("(")[1].split(")")[0]}
sarandev3ff7f34b2023-01-16 05:09:20 -0600145 Navigate To Date and Time Page
sarandev34d1a7372023-01-27 02:10:38 -0600146 Page Should Contain ${text}
sarandev3ff7f34b2023-01-16 05:09:20 -0600147
148
Sushma M Mcba1b822020-11-25 16:02:48 -0600149Verify NTP Server Input Fields In Date And Time Page
150 [Documentation] Verify NTP server input fields in date and time page.
151 [Tags] Verify_NTP_Server_Input_Fields_In_Date_And_Time_Page
sarandev3088958d2023-02-09 01:57:12 -0600152 [Setup] Setup To Power Off And Navigate
Sushma M Mcba1b822020-11-25 16:02:48 -0600153
sarandev363c4c292023-02-07 06:27:27 -0600154 Click Element At Coordinates ${xpath_select_ntp} 0 0
155 Input Text ${xpath_ntp_server1} 10.10.10.10
156 Input Text ${xpath_ntp_server2} 20.20.20.20
157 Input Text ${xpath_ntp_server3} 30.30.30.30
158 Click Element ${xpath_select_save_settings}
159
Sushma M Mcba1b822020-11-25 16:02:48 -0600160
161 # Refresh the NTP Page.
162 Click Element ${xpath_refresh_button}
163 Wait Until Page Contains Element ${xpath_select_ntp} timeout=10s
164
165 Textfield Value Should Be ${xpath_ntp_server1} 10.10.10.10
166 Textfield Value Should Be ${xpath_ntp_server2} 20.20.20.20
167 Textfield Value Should Be ${xpath_ntp_server3} 30.30.30.30
168
169
sarandev35100dda2023-02-13 02:59:15 -0600170Verify Setting Manual BMC Time
171 [Documentation] Verify changing manual time and comparing it with CLI time.
172 [Tags] Verify_Setting_Manual_BMC_Time
173 [Setup] Run Keywords Set Timezone In Profile Settings Page
174 ... Default AND Setup To Power Off And Navigate
175
176 Click Element At Coordinates ${xpath_select_manual} 0 0
177 Input Text ${xpath_manual_date} 2023-05-12
178 Input Text ${xpath_manual_time} 15:30
179 Click Element ${xpath_select_save_settings}
180
181 # Wait for changes to take effect.
182 Sleep 120
183 ${manual_date}= Get Value ${xpath_manual_date}
184 ${manual_time}= Get Value ${xpath_manual_time}
185
186 ${cli_date_time}= CLI Get BMC DateTime
187 Should contain ${cli_date_time} ${manual_date} ${manual_time}
188
189
sarandev390f93d42023-02-16 04:13:52 -0600190Verify Setting Invalid Date And Time Is Not Allowed
191 [Documentation] Verify if invalid date and invalid time input is given,
192 ... it should throw error.
193 [Tags] Verify_Setting_Invalid_Date_And_Time_Is_Not_Allowed
194 [Setup] Setup To Power Off And Navigate
195
196 Click Element At Coordinates ${xpath_select_manual} 0 0
197 Input Text ${xpath_manual_date} 2023-18-48
198 Page Should Contain Element ${xpath_invalid_format_message}
199 Input Text ${xpath_manual_time} 29:48
200 Page Should Contain Element ${xpath_invalid_format_message}
201
202
sarandev3df94f6f2023-02-22 00:28:27 -0600203Verify Changing BMC Time From NTP To Manual
sarandev3cffb59e2023-03-03 03:14:08 -0600204 [Documentation] Verify that BMC time can be changed from NTP to
sarandev3df94f6f2023-02-22 00:28:27 -0600205 ... manual time via GUI.
206 [Tags] Verify_Changing_BMC_Time_From_NTP_To_Manual
207 [Setup] Setup To Power Off And Navigate
208
sarandev3405572f2023-02-27 03:37:08 -0600209 # Add NTP server for BMC time to sync.
sarandev3df94f6f2023-02-22 00:28:27 -0600210 Click Element At Coordinates ${xpath_select_ntp} 0 0
211 Input Text ${xpath_ntp_server1} time.google.com
212 Click Element ${xpath_select_save_settings}
213
214 # Wait for changes to take effect.
215 Wait Until Page Contains Element ${xpath_select_ntp} timeout=30s
216
217 # Set the manual date and time.
218 ${cli_date_time}= CLI Get BMC DateTime
219 ${date_changed}= Add Time To Date ${cli_date_time} 31 days
220 ${date_changed}= Add Time To Date ${date_changed} 05:10:00
221 Log "Setting BMC date : ${date_changed} using Manual option"
222 ${date}= Convert Date ${date_changed} result_format=%Y-%m-%d
223 ${time}= Convert Date ${date_changed} result_format=%H:%M
224 Click Element At Coordinates ${xpath_select_manual} 0 0
225 Input Text ${xpath_manual_date} ${date}
226 Input Text ${xpath_manual_time} ${time}
227 Click Element ${xpath_select_save_settings}
228
229 # Refresh the NTP Page.
230 Click Element ${xpath_refresh_button}
231 Wait Until Page Contains ${date} timeout=60s
232 Page Should Contain ${time}
233
234 # Wait for the "Saved Successfully" window to close automatically.
235 Sleep 15
236
237
sarandev3cffb59e2023-03-03 03:14:08 -0600238Verify Moving From Manual To NTP
239 [Documentation] Verify switching between manual mode and NTP mode.
240 [Tags] Verify_Moving_From_Manual_To_NTP
sarandev3405572f2023-02-27 03:37:08 -0600241 [Setup] Setup To Power Off And Navigate
sarandev3cffb59e2023-03-03 03:14:08 -0600242 [Template] Switch From Manual To NTP
sarandev3405572f2023-02-27 03:37:08 -0600243
sarandev3cffb59e2023-03-03 03:14:08 -0600244 # loop_count
245 ${LOOP_COUNT}
sarandev3405572f2023-02-27 03:37:08 -0600246
247
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -0500248*** Keywords ***
249
250Suite Setup Execution
251 [Documentation] Do test case setup tasks.
252
253 Launch Browser And Login GUI
sarandev34d1a7372023-01-27 02:10:38 -0600254 Maximize Browser Window
sarandev3088958d2023-02-09 01:57:12 -0600255
sarandev3df94f6f2023-02-22 00:28:27 -0600256Suite Teardown Execution
257 [Documentation] Do the post suite teardown.
258
George Keishing1a5c1562023-10-12 17:16:01 +0530259 Run Keyword And Ignore Error Logout GUI
sarandev3df94f6f2023-02-22 00:28:27 -0600260 Close Browser
261
George Keishing70bbd942023-02-09 22:55:04 -0600262Setup To Power Off And Navigate
sarandev3088958d2023-02-09 01:57:12 -0600263 [Documentation] Power off system if not powered off and go to date and
264 ... time page.
265
266 Redfish Power off stack_mode=skip
267 Navigate To Date and Time Page
268
Sushma M M17ac1f52020-11-25 05:38:00 -0600269Navigate To Date and Time Page
270 [Documentation] Navigate to the date and time page from main menu.
271
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500272 Click Element ${xpath_settings_menu}
273 Click Element ${xpath_date_time_sub_menu}
274 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain date-time
rramyasr-in05da0fb2022-08-26 05:52:03 -0500275 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
276
sarandev3405572f2023-02-27 03:37:08 -0600277Set Manual Date and Time Via GUI
278 [Documentation] Set BMC date and time to one month in future via GUI.
279
280 ${cli_date_time}= CLI Get BMC DateTime
281 ${new_date}= Add Time To Date ${cli_date_time} 31 days
282 ${new_date_time}= Add Time To Date ${new_date} 05:10:00
283 Log "Setting BMC date : ${new_date_time} using Manual option"
284 ${date}= Convert Date ${new_date_time} result_format=%Y-%m-%d
285 ${time}= Convert Date ${new_date_time} result_format=%H:%M
286 Click Element At Coordinates ${xpath_select_manual} 0 0
287 Input Text ${xpath_manual_date} ${date}
288 Input Text ${xpath_manual_time} ${time}
289 Click Element ${xpath_select_save_settings}
290
291 # Wait for changes to take effect.
292 Wait Until Element Is Enabled ${xpath_select_ntp} timeout=30s
293
sarandev3cffb59e2023-03-03 03:14:08 -0600294Switch From Manual To NTP
295 [Documentation] Verify switching from manual mode to NTP mode.
296 [Arguments] ${loop_count}=${LOOP_COUNT}
297
298 # Description of argument(s):
299 # loop_count Number of loops to move from manual to NTP.
300
301 FOR ${x} IN RANGE ${loop_count}
302 Set Manual Date and Time Via GUI
303 # Set BMC date time to sync with NTP server.
304 Click Element At Coordinates ${xpath_select_ntp} 0 0
305 Input Text ${xpath_ntp_server1} 216.239.35.0
306 Click Element ${xpath_select_save_settings}
307
sarandev3a7b0ba02023-10-18 11:34:07 +0530308 # Wait until progress bar is not visible.
309 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=60
sarandev3cffb59e2023-03-03 03:14:08 -0600310
311 ${cli_date_time}= CLI Get BMC DateTime
312 ${ntp_date}= Convert Date ${cli_date_time} result_format=%Y-%m-%d
313 ${ntp_time}= Convert Date ${cli_date_time} result_format=%H:%M
314 Wait Until Page Contains ${ntp_date} timeout=60s
315 Page Should Contain ${ntp_time}
316
317 Wait Until Element Is Not Visible ${xpath_success_message} timeout=60
318 Log "Completed Loop for ${x} time"
319 END