Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
sarandev3 | 5100dda | 2023-02-13 02:59:15 -0600 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "Date and time" sub-menu of "Settings". |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 6 | |
| 7 | Suite Setup Suite Setup Execution |
sarandev3 | df94f6f | 2023-02-22 00:28:27 -0600 | [diff] [blame] | 8 | Suite Teardown Suite Teardown Execution |
sarandev3 | 088958d | 2023-02-09 01:57:12 -0600 | [diff] [blame] | 9 | Test Setup Navigate To Date and Time Page |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 10 | |
| 11 | *** Variables *** |
| 12 | |
sarandev3 | df94f6f | 2023-02-22 00:28:27 -0600 | [diff] [blame] | 13 | ${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")] |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 23 | |
| 24 | *** Test Cases *** |
| 25 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 26 | Verify Navigation To Date And Time Page |
| 27 | [Documentation] Verify navigation to date and time page. |
| 28 | [Tags] Verify_Navigation_To_Date_And_Time_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 29 | |
| 30 | Page Should Contain Element ${xpath_date_time_heading} |
| 31 | |
| 32 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 33 | Verify Existence Of All Sections In Date And Time Page |
| 34 | [Documentation] Verify existence of all sections in date and time page. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 35 | [Tags] Verify_Existence_Of_All_Sections_In_Date_And_Time_Page |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 36 | |
| 37 | Page Should Contain Configure settings |
| 38 | |
| 39 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 40 | Verify Existence Of All Buttons In Date And Time Page |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 41 | [Documentation] Verify existence of all buttons in date and time settings page. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 42 | [Tags] Verify_Existence_Of_All_Buttons_In_Date_And_Time_Page |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 43 | |
| 44 | Page Should Contain Element ${xpath_select_manual} |
| 45 | Page Should Contain Element ${xpath_select_ntp} |
| 46 | Page Should Contain Element ${xpath_select_save_settings} |
| 47 | |
| 48 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 49 | Verify Existence Of All Input Boxes In Date And Time Page |
| 50 | [Documentation] Verify existence of all input boxes in date time page. |
| 51 | [Tags] Verify_Existence_Of_All_Input_Boxes_In_Date_And_Time_Page |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 52 | |
| 53 | Click Element At Coordinates ${xpath_select_manual} 0 0 |
| 54 | Page Should Contain Element ${xpath_manual_date} |
| 55 | Page Should Contain Element ${xpath_manual_time} |
| 56 | |
| 57 | Click Element At Coordinates ${xpath_select_ntp} 0 0 |
| 58 | Page Should Contain Element ${xpath_ntp_server1} |
| 59 | Page Should Contain Element ${xpath_ntp_server2} |
| 60 | Page Should Contain Element ${xpath_ntp_server3} |
| 61 | |
| 62 | |
Sushma M M | 2ba26e8 | 2020-11-25 14:07:15 -0600 | [diff] [blame] | 63 | Verify Date And Time From Configuration Section |
| 64 | [Documentation] Get date and time from configuration section and verify it via BMC CLI. |
| 65 | [Tags] Verify_Date_And_Time_From_Configuration_Section |
| 66 | |
| 67 | Click Element At Coordinates ${xpath_select_manual} 0 0 |
| 68 | ${manual_date}= Get Value ${xpath_manual_date} |
| 69 | ${manual_time}= Get Value ${xpath_manual_time} |
| 70 | |
| 71 | ${cli_date_time}= CLI Get BMC DateTime |
| 72 | Should contain ${cli_date_time} ${manual_date} ${manual_time} |
| 73 | |
| 74 | |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 75 | Verify Display Of Date And Time In GUI Page |
Sushma M M | 17ac1f5 | 2020-11-25 05:38:00 -0600 | [diff] [blame] | 76 | [Documentation] Get date and time from Redfish and verify it via GUI date and time page. |
George Keishing | d6a7797 | 2022-01-31 12:50:29 -0600 | [diff] [blame] | 77 | [Tags] Verify_Display_Of_Date_And_Time_In_GUI_Page |
Sushma M M | 17ac1f5 | 2020-11-25 05:38:00 -0600 | [diff] [blame] | 78 | |
| 79 | # Set Default timezone in profile settings page. |
| 80 | Set Timezone In Profile Settings Page Default |
| 81 | Navigate To Date and Time Page |
| 82 | |
| 83 | # Get date and time from Redfish. |
| 84 | ${redfish_date_time}= CLI Get BMC DateTime |
| 85 | ${redfish_date}= Convert Date ${redfish_date_time} result_format=%Y-%m-%d |
| 86 | ${redfish_time}= Convert Date ${redfish_date_time} result_format=%H:%M |
| 87 | |
| 88 | # Verify date and time via GUI date and time page. |
| 89 | |
| 90 | Page Should Contain ${redfish_date} |
| 91 | Page Should Contain ${redfish_time} |
| 92 | |
sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 93 | |
sarandev3 | 9cbaca8 | 2023-01-10 00:16:55 -0600 | [diff] [blame] | 94 | Verify Profile Setting Button In Date And Time Page |
| 95 | [Documentation] Verify navigation to profile setting page after clicking |
| 96 | ... on profile setting button in date and time page. |
| 97 | [Tags] Verify_Profile_Setting_Button_In_Date_And_Time_Page |
| 98 | |
sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 99 | Click Element ${xpath_profile_settings_link} |
sarandev3 | 9cbaca8 | 2023-01-10 00:16:55 -0600 | [diff] [blame] | 100 | Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10 |
| 101 | Location Should Contain profile-settings |
| 102 | |
Sushma M M | 17ac1f5 | 2020-11-25 05:38:00 -0600 | [diff] [blame] | 103 | |
sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 104 | Verify Existence Of Timezone Buttons In Profile Settings Page |
| 105 | [Documentation] Verify default UTC button and browser offset IST button |
| 106 | ... in Profile settings page |
| 107 | [Tags] Verify_Existence_Of_Timezone_Buttons_In_Profile_Settings_Page |
| 108 | |
sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 109 | Click Element ${xpath_profile_settings_link} |
| 110 | Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=30 |
| 111 | Page Should Contain Element ${xpath_default_UTC} |
| 112 | Page Should Contain Element ${xpath_browser_offset} |
sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 113 | |
| 114 | |
George Keishing | 70bbd94 | 2023-02-09 22:55:04 -0600 | [diff] [blame] | 115 | Verify Date And Time Change To Browser Offset Time |
sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 116 | [Documentation] Verify date and time change to broswer's offset time when |
| 117 | ... 'Browser offset' option is selected in Profile settings page. |
| 118 | [Tags] Verify_Date_And_Time_Change_To_Browser_Offset_Time |
sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 119 | |
sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 120 | Click Element ${xpath_profile_settings_link} |
| 121 | Wait Until Page Contains Element ${xpath_profile_settings_heading} timeout=10 |
| 122 | Click Element At Coordinates ${xpath_browser_offset} 0 0 |
sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 123 | Click Element ${xpath_profile_save_button} |
sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 124 | ${xpath_browser_offset_text}= Get Text ${xpath_browser_offset_textfield} |
| 125 | |
| 126 | # We get an output ${xpath_browser_offset_text} = Browser offset (CST UTC-6). |
| 127 | # Need to compare "CST UTC-6" text so removing the spaces and other values. |
| 128 | |
| 129 | ${text}= Set Variable ${xpath_browser_offset_text.split("(")[1].split(")")[0]} |
sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 130 | Navigate To Date and Time Page |
sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 131 | Page Should Contain ${text} |
sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 132 | |
| 133 | |
Sushma M M | cba1b82 | 2020-11-25 16:02:48 -0600 | [diff] [blame] | 134 | Verify NTP Server Input Fields In Date And Time Page |
| 135 | [Documentation] Verify NTP server input fields in date and time page. |
| 136 | [Tags] Verify_NTP_Server_Input_Fields_In_Date_And_Time_Page |
sarandev3 | 088958d | 2023-02-09 01:57:12 -0600 | [diff] [blame] | 137 | [Setup] Setup To Power Off And Navigate |
Sushma M M | cba1b82 | 2020-11-25 16:02:48 -0600 | [diff] [blame] | 138 | |
sarandev3 | 63c4c29 | 2023-02-07 06:27:27 -0600 | [diff] [blame] | 139 | Click Element At Coordinates ${xpath_select_ntp} 0 0 |
| 140 | Input Text ${xpath_ntp_server1} 10.10.10.10 |
| 141 | Input Text ${xpath_ntp_server2} 20.20.20.20 |
| 142 | Input Text ${xpath_ntp_server3} 30.30.30.30 |
| 143 | Click Element ${xpath_select_save_settings} |
| 144 | |
Sushma M M | cba1b82 | 2020-11-25 16:02:48 -0600 | [diff] [blame] | 145 | |
| 146 | # Refresh the NTP Page. |
| 147 | Click Element ${xpath_refresh_button} |
| 148 | Wait Until Page Contains Element ${xpath_select_ntp} timeout=10s |
| 149 | |
| 150 | Textfield Value Should Be ${xpath_ntp_server1} 10.10.10.10 |
| 151 | Textfield Value Should Be ${xpath_ntp_server2} 20.20.20.20 |
| 152 | Textfield Value Should Be ${xpath_ntp_server3} 30.30.30.30 |
| 153 | |
| 154 | |
sarandev3 | 5100dda | 2023-02-13 02:59:15 -0600 | [diff] [blame] | 155 | Verify Setting Manual BMC Time |
| 156 | [Documentation] Verify changing manual time and comparing it with CLI time. |
| 157 | [Tags] Verify_Setting_Manual_BMC_Time |
| 158 | [Setup] Run Keywords Set Timezone In Profile Settings Page |
| 159 | ... Default AND Setup To Power Off And Navigate |
| 160 | |
| 161 | Click Element At Coordinates ${xpath_select_manual} 0 0 |
| 162 | Input Text ${xpath_manual_date} 2023-05-12 |
| 163 | Input Text ${xpath_manual_time} 15:30 |
| 164 | Click Element ${xpath_select_save_settings} |
| 165 | |
| 166 | # Wait for changes to take effect. |
| 167 | Sleep 120 |
| 168 | ${manual_date}= Get Value ${xpath_manual_date} |
| 169 | ${manual_time}= Get Value ${xpath_manual_time} |
| 170 | |
| 171 | ${cli_date_time}= CLI Get BMC DateTime |
| 172 | Should contain ${cli_date_time} ${manual_date} ${manual_time} |
| 173 | |
| 174 | |
sarandev3 | 90f93d4 | 2023-02-16 04:13:52 -0600 | [diff] [blame] | 175 | Verify Setting Invalid Date And Time Is Not Allowed |
| 176 | [Documentation] Verify if invalid date and invalid time input is given, |
| 177 | ... it should throw error. |
| 178 | [Tags] Verify_Setting_Invalid_Date_And_Time_Is_Not_Allowed |
| 179 | [Setup] Setup To Power Off And Navigate |
| 180 | |
| 181 | Click Element At Coordinates ${xpath_select_manual} 0 0 |
| 182 | Input Text ${xpath_manual_date} 2023-18-48 |
| 183 | Page Should Contain Element ${xpath_invalid_format_message} |
| 184 | Input Text ${xpath_manual_time} 29:48 |
| 185 | Page Should Contain Element ${xpath_invalid_format_message} |
| 186 | |
| 187 | |
sarandev3 | df94f6f | 2023-02-22 00:28:27 -0600 | [diff] [blame] | 188 | Verify Changing BMC Time From NTP To Manual |
| 189 | [Documentation] Verify that BMC time can be changed from NPT to |
| 190 | ... manual time via GUI. |
| 191 | [Tags] Verify_Changing_BMC_Time_From_NTP_To_Manual |
| 192 | [Setup] Setup To Power Off And Navigate |
| 193 | |
| 194 | # Add NPT server for BMC time to sync. |
| 195 | Click Element At Coordinates ${xpath_select_ntp} 0 0 |
| 196 | Input Text ${xpath_ntp_server1} time.google.com |
| 197 | Click Element ${xpath_select_save_settings} |
| 198 | |
| 199 | # Wait for changes to take effect. |
| 200 | Wait Until Page Contains Element ${xpath_select_ntp} timeout=30s |
| 201 | |
| 202 | # Set the manual date and time. |
| 203 | ${cli_date_time}= CLI Get BMC DateTime |
| 204 | ${date_changed}= Add Time To Date ${cli_date_time} 31 days |
| 205 | ${date_changed}= Add Time To Date ${date_changed} 05:10:00 |
| 206 | Log "Setting BMC date : ${date_changed} using Manual option" |
| 207 | ${date}= Convert Date ${date_changed} result_format=%Y-%m-%d |
| 208 | ${time}= Convert Date ${date_changed} result_format=%H:%M |
| 209 | Click Element At Coordinates ${xpath_select_manual} 0 0 |
| 210 | Input Text ${xpath_manual_date} ${date} |
| 211 | Input Text ${xpath_manual_time} ${time} |
| 212 | Click Element ${xpath_select_save_settings} |
| 213 | |
| 214 | # Refresh the NTP Page. |
| 215 | Click Element ${xpath_refresh_button} |
| 216 | Wait Until Page Contains ${date} timeout=60s |
| 217 | Page Should Contain ${time} |
| 218 | |
| 219 | # Wait for the "Saved Successfully" window to close automatically. |
| 220 | Sleep 15 |
| 221 | |
| 222 | |
Rahul Maheshwari | 8c5f054 | 2020-08-12 00:46:40 -0500 | [diff] [blame] | 223 | *** Keywords *** |
| 224 | |
| 225 | Suite Setup Execution |
| 226 | [Documentation] Do test case setup tasks. |
| 227 | |
| 228 | Launch Browser And Login GUI |
sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 229 | Maximize Browser Window |
sarandev3 | 088958d | 2023-02-09 01:57:12 -0600 | [diff] [blame] | 230 | |
sarandev3 | df94f6f | 2023-02-22 00:28:27 -0600 | [diff] [blame] | 231 | Suite Teardown Execution |
| 232 | [Documentation] Do the post suite teardown. |
| 233 | |
| 234 | Logout GUI |
| 235 | Close Browser |
| 236 | |
George Keishing | 70bbd94 | 2023-02-09 22:55:04 -0600 | [diff] [blame] | 237 | Setup To Power Off And Navigate |
sarandev3 | 088958d | 2023-02-09 01:57:12 -0600 | [diff] [blame] | 238 | [Documentation] Power off system if not powered off and go to date and |
| 239 | ... time page. |
| 240 | |
| 241 | Redfish Power off stack_mode=skip |
| 242 | Navigate To Date and Time Page |
| 243 | |
Sushma M M | 17ac1f5 | 2020-11-25 05:38:00 -0600 | [diff] [blame] | 244 | |
| 245 | Navigate To Date and Time Page |
| 246 | [Documentation] Navigate to the date and time page from main menu. |
| 247 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 248 | Click Element ${xpath_settings_menu} |
| 249 | Click Element ${xpath_date_time_sub_menu} |
| 250 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain date-time |
rramyasr-in | 05da0fb | 2022-08-26 05:52:03 -0500 | [diff] [blame] | 251 | Wait Until Element Is Not Visible ${xpath_page_loading_progress_bar} timeout=30 |
| 252 | |