blob: 9c65316579a206c9f9e31ccdeff5f6ab880b595e [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
Rahul Maheshwari142642d2021-08-24 00:00:15 -050034Verify Existence Of All Sections In Date And Time Page
35 [Documentation] Verify existence of all sections in date and time page.
George Keishingd6a77972022-01-31 12:50:29 -060036 [Tags] Verify_Existence_Of_All_Sections_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050037
38 Page Should Contain Configure settings
39
40
Rahul Maheshwari142642d2021-08-24 00:00:15 -050041Verify Existence Of All Buttons In Date And Time Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050042 [Documentation] Verify existence of all buttons in date and time settings page.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050043 [Tags] Verify_Existence_Of_All_Buttons_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050044
45 Page Should Contain Element ${xpath_select_manual}
46 Page Should Contain Element ${xpath_select_ntp}
47 Page Should Contain Element ${xpath_select_save_settings}
48
49
Rahul Maheshwari142642d2021-08-24 00:00:15 -050050Verify Existence Of All Input Boxes In Date And Time Page
51 [Documentation] Verify existence of all input boxes in date time page.
52 [Tags] Verify_Existence_Of_All_Input_Boxes_In_Date_And_Time_Page
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -050053
54 Click Element At Coordinates ${xpath_select_manual} 0 0
55 Page Should Contain Element ${xpath_manual_date}
56 Page Should Contain Element ${xpath_manual_time}
57
58 Click Element At Coordinates ${xpath_select_ntp} 0 0
59 Page Should Contain Element ${xpath_ntp_server1}
60 Page Should Contain Element ${xpath_ntp_server2}
61 Page Should Contain Element ${xpath_ntp_server3}
62
63
Sushma M M2ba26e82020-11-25 14:07:15 -060064Verify Date And Time From Configuration Section
65 [Documentation] Get date and time from configuration section and verify it via BMC CLI.
66 [Tags] Verify_Date_And_Time_From_Configuration_Section
67
68 Click Element At Coordinates ${xpath_select_manual} 0 0
69 ${manual_date}= Get Value ${xpath_manual_date}
70 ${manual_time}= Get Value ${xpath_manual_time}
71
72 ${cli_date_time}= CLI Get BMC DateTime
73 Should contain ${cli_date_time} ${manual_date} ${manual_time}
74
75
George Keishingd6a77972022-01-31 12:50:29 -060076Verify Display Of Date And Time In GUI Page
Sushma M M17ac1f52020-11-25 05:38:00 -060077 [Documentation] Get date and time from Redfish and verify it via GUI date and time page.
George Keishingd6a77972022-01-31 12:50:29 -060078 [Tags] Verify_Display_Of_Date_And_Time_In_GUI_Page
Sushma M M17ac1f52020-11-25 05:38:00 -060079
80 # Set Default timezone in profile settings page.
81 Set Timezone In Profile Settings Page Default
82 Navigate To Date and Time Page
83
84 # Get date and time from Redfish.
85 ${redfish_date_time}= CLI Get BMC DateTime
86 ${redfish_date}= Convert Date ${redfish_date_time} result_format=%Y-%m-%d
87 ${redfish_time}= Convert Date ${redfish_date_time} result_format=%H:%M
88
89 # Verify date and time via GUI date and time page.
90
91 Page Should Contain ${redfish_date}
92 Page Should Contain ${redfish_time}
93
sarandev3ff7f34b2023-01-16 05:09:20 -060094
sarandev39cbaca82023-01-10 00:16:55 -060095Verify Profile Setting Button In Date And Time Page
96 [Documentation] Verify navigation to profile setting page after clicking
97 ... on profile setting button in date and time page.
98 [Tags] Verify_Profile_Setting_Button_In_Date_And_Time_Page
99
sarandev34d1a7372023-01-27 02:10:38 -0600100 Click Element ${xpath_profile_settings_link}
sarandev39cbaca82023-01-10 00:16:55 -0600101 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10
102 Location Should Contain profile-settings
103
Sushma M M17ac1f52020-11-25 05:38:00 -0600104
sarandev3ff7f34b2023-01-16 05:09:20 -0600105Verify Existence Of Timezone Buttons In Profile Settings Page
106 [Documentation] Verify default UTC button and browser offset IST button
107 ... in Profile settings page
108 [Tags] Verify_Existence_Of_Timezone_Buttons_In_Profile_Settings_Page
109
sarandev34d1a7372023-01-27 02:10:38 -0600110 Click Element ${xpath_profile_settings_link}
111 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=30
112 Page Should Contain Element ${xpath_default_UTC}
113 Page Should Contain Element ${xpath_browser_offset}
sarandev3ff7f34b2023-01-16 05:09:20 -0600114
115
George Keishing70bbd942023-02-09 22:55:04 -0600116Verify Date And Time Change To Browser Offset Time
sarandev34d1a7372023-01-27 02:10:38 -0600117 [Documentation] Verify date and time change to broswer's offset time when
118 ... 'Browser offset' option is selected in Profile settings page.
119 [Tags] Verify_Date_And_Time_Change_To_Browser_Offset_Time
sarandev3ff7f34b2023-01-16 05:09:20 -0600120
sarandev34d1a7372023-01-27 02:10:38 -0600121 Click Element ${xpath_profile_settings_link}
122 Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10
123 Click Element At Coordinates ${xpath_browser_offset} 0 0
sarandev3ff7f34b2023-01-16 05:09:20 -0600124 Click Element ${xpath_profile_save_button}
sarandev34d1a7372023-01-27 02:10:38 -0600125 ${xpath_browser_offset_text}= Get Text ${xpath_browser_offset_textfield}
126
127 # We get an output ${xpath_browser_offset_text} = Browser offset (CST UTC-6).
128 # Need to compare "CST UTC-6" text so removing the spaces and other values.
129
130 ${text}= Set Variable ${xpath_browser_offset_text.split("(")[1].split(")")[0]}
sarandev3ff7f34b2023-01-16 05:09:20 -0600131 Navigate To Date and Time Page
sarandev34d1a7372023-01-27 02:10:38 -0600132 Page Should Contain ${text}
sarandev3ff7f34b2023-01-16 05:09:20 -0600133
134
Sushma M Mcba1b822020-11-25 16:02:48 -0600135Verify NTP Server Input Fields In Date And Time Page
136 [Documentation] Verify NTP server input fields in date and time page.
137 [Tags] Verify_NTP_Server_Input_Fields_In_Date_And_Time_Page
sarandev3088958d2023-02-09 01:57:12 -0600138 [Setup] Setup To Power Off And Navigate
Sushma M Mcba1b822020-11-25 16:02:48 -0600139
sarandev363c4c292023-02-07 06:27:27 -0600140 Click Element At Coordinates ${xpath_select_ntp} 0 0
141 Input Text ${xpath_ntp_server1} 10.10.10.10
142 Input Text ${xpath_ntp_server2} 20.20.20.20
143 Input Text ${xpath_ntp_server3} 30.30.30.30
144 Click Element ${xpath_select_save_settings}
145
Sushma M Mcba1b822020-11-25 16:02:48 -0600146
147 # Refresh the NTP Page.
148 Click Element ${xpath_refresh_button}
149 Wait Until Page Contains Element ${xpath_select_ntp} timeout=10s
150
151 Textfield Value Should Be ${xpath_ntp_server1} 10.10.10.10
152 Textfield Value Should Be ${xpath_ntp_server2} 20.20.20.20
153 Textfield Value Should Be ${xpath_ntp_server3} 30.30.30.30
154
155
sarandev35100dda2023-02-13 02:59:15 -0600156Verify Setting Manual BMC Time
157 [Documentation] Verify changing manual time and comparing it with CLI time.
158 [Tags] Verify_Setting_Manual_BMC_Time
159 [Setup] Run Keywords Set Timezone In Profile Settings Page
160 ... Default AND Setup To Power Off And Navigate
161
162 Click Element At Coordinates ${xpath_select_manual} 0 0
163 Input Text ${xpath_manual_date} 2023-05-12
164 Input Text ${xpath_manual_time} 15:30
165 Click Element ${xpath_select_save_settings}
166
167 # Wait for changes to take effect.
168 Sleep 120
169 ${manual_date}= Get Value ${xpath_manual_date}
170 ${manual_time}= Get Value ${xpath_manual_time}
171
172 ${cli_date_time}= CLI Get BMC DateTime
173 Should contain ${cli_date_time} ${manual_date} ${manual_time}
174
175
sarandev390f93d42023-02-16 04:13:52 -0600176Verify Setting Invalid Date And Time Is Not Allowed
177 [Documentation] Verify if invalid date and invalid time input is given,
178 ... it should throw error.
179 [Tags] Verify_Setting_Invalid_Date_And_Time_Is_Not_Allowed
180 [Setup] Setup To Power Off And Navigate
181
182 Click Element At Coordinates ${xpath_select_manual} 0 0
183 Input Text ${xpath_manual_date} 2023-18-48
184 Page Should Contain Element ${xpath_invalid_format_message}
185 Input Text ${xpath_manual_time} 29:48
186 Page Should Contain Element ${xpath_invalid_format_message}
187
188
sarandev3df94f6f2023-02-22 00:28:27 -0600189Verify Changing BMC Time From NTP To Manual
sarandev3cffb59e2023-03-03 03:14:08 -0600190 [Documentation] Verify that BMC time can be changed from NTP to
sarandev3df94f6f2023-02-22 00:28:27 -0600191 ... manual time via GUI.
192 [Tags] Verify_Changing_BMC_Time_From_NTP_To_Manual
193 [Setup] Setup To Power Off And Navigate
194
sarandev3405572f2023-02-27 03:37:08 -0600195 # Add NTP server for BMC time to sync.
sarandev3df94f6f2023-02-22 00:28:27 -0600196 Click Element At Coordinates ${xpath_select_ntp} 0 0
197 Input Text ${xpath_ntp_server1} time.google.com
198 Click Element ${xpath_select_save_settings}
199
200 # Wait for changes to take effect.
201 Wait Until Page Contains Element ${xpath_select_ntp} timeout=30s
202
203 # Set the manual date and time.
204 ${cli_date_time}= CLI Get BMC DateTime
205 ${date_changed}= Add Time To Date ${cli_date_time} 31 days
206 ${date_changed}= Add Time To Date ${date_changed} 05:10:00
207 Log "Setting BMC date : ${date_changed} using Manual option"
208 ${date}= Convert Date ${date_changed} result_format=%Y-%m-%d
209 ${time}= Convert Date ${date_changed} result_format=%H:%M
210 Click Element At Coordinates ${xpath_select_manual} 0 0
211 Input Text ${xpath_manual_date} ${date}
212 Input Text ${xpath_manual_time} ${time}
213 Click Element ${xpath_select_save_settings}
214
215 # Refresh the NTP Page.
216 Click Element ${xpath_refresh_button}
217 Wait Until Page Contains ${date} timeout=60s
218 Page Should Contain ${time}
219
220 # Wait for the "Saved Successfully" window to close automatically.
221 Sleep 15
222
223
sarandev3cffb59e2023-03-03 03:14:08 -0600224Verify Moving From Manual To NTP
225 [Documentation] Verify switching between manual mode and NTP mode.
226 [Tags] Verify_Moving_From_Manual_To_NTP
sarandev3405572f2023-02-27 03:37:08 -0600227 [Setup] Setup To Power Off And Navigate
sarandev3cffb59e2023-03-03 03:14:08 -0600228 [Template] Switch From Manual To NTP
sarandev3405572f2023-02-27 03:37:08 -0600229
sarandev3cffb59e2023-03-03 03:14:08 -0600230 # loop_count
231 ${LOOP_COUNT}
sarandev3405572f2023-02-27 03:37:08 -0600232
233
Rahul Maheshwari8c5f0542020-08-12 00:46:40 -0500234*** Keywords ***
235
236Suite Setup Execution
237 [Documentation] Do test case setup tasks.
238
239 Launch Browser And Login GUI
sarandev34d1a7372023-01-27 02:10:38 -0600240 Maximize Browser Window
sarandev3088958d2023-02-09 01:57:12 -0600241
sarandev3df94f6f2023-02-22 00:28:27 -0600242Suite Teardown Execution
243 [Documentation] Do the post suite teardown.
244
245 Logout GUI
246 Close Browser
247
George Keishing70bbd942023-02-09 22:55:04 -0600248Setup To Power Off And Navigate
sarandev3088958d2023-02-09 01:57:12 -0600249 [Documentation] Power off system if not powered off and go to date and
250 ... time page.
251
252 Redfish Power off stack_mode=skip
253 Navigate To Date and Time Page
254
Sushma M M17ac1f52020-11-25 05:38:00 -0600255Navigate To Date and Time Page
256 [Documentation] Navigate to the date and time page from main menu.
257
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500258 Click Element ${xpath_settings_menu}
259 Click Element ${xpath_date_time_sub_menu}
260 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain date-time
rramyasr-in05da0fb2022-08-26 05:52:03 -0500261 Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30
262
sarandev3405572f2023-02-27 03:37:08 -0600263Set Manual Date and Time Via GUI
264 [Documentation] Set BMC date and time to one month in future via GUI.
265
266 ${cli_date_time}= CLI Get BMC DateTime
267 ${new_date}= Add Time To Date ${cli_date_time} 31 days
268 ${new_date_time}= Add Time To Date ${new_date} 05:10:00
269 Log "Setting BMC date : ${new_date_time} using Manual option"
270 ${date}= Convert Date ${new_date_time} result_format=%Y-%m-%d
271 ${time}= Convert Date ${new_date_time} result_format=%H:%M
272 Click Element At Coordinates ${xpath_select_manual} 0 0
273 Input Text ${xpath_manual_date} ${date}
274 Input Text ${xpath_manual_time} ${time}
275 Click Element ${xpath_select_save_settings}
276
277 # Wait for changes to take effect.
278 Wait Until Element Is Enabled ${xpath_select_ntp} timeout=30s
279
sarandev3cffb59e2023-03-03 03:14:08 -0600280Switch From Manual To NTP
281 [Documentation] Verify switching from manual mode to NTP mode.
282 [Arguments] ${loop_count}=${LOOP_COUNT}
283
284 # Description of argument(s):
285 # loop_count Number of loops to move from manual to NTP.
286
287 FOR ${x} IN RANGE ${loop_count}
288 Set Manual Date and Time Via GUI
289 # Set BMC date time to sync with NTP server.
290 Click Element At Coordinates ${xpath_select_ntp} 0 0
291 Input Text ${xpath_ntp_server1} 216.239.35.0
292 Click Element ${xpath_select_save_settings}
293
294 # Wait until saved successfully message is visible.
295 Wait Until Element Is Visible ${xpath_success_message} timeout=60
296
297 ${cli_date_time}= CLI Get BMC DateTime
298 ${ntp_date}= Convert Date ${cli_date_time} result_format=%Y-%m-%d
299 ${ntp_time}= Convert Date ${cli_date_time} result_format=%H:%M
300 Wait Until Page Contains ${ntp_date} timeout=60s
301 Page Should Contain ${ntp_time}
302
303 Wait Until Element Is Not Visible ${xpath_success_message} timeout=60
304 Log "Completed Loop for ${x} time"
305 END