Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 3 | Documentation Test OpenBMC GUI "Network" sub-menu of "Settings". |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Anves Kumar rayankula | 65e5ed2 | 2020-09-17 04:44:44 -0500 | [diff] [blame] | 6 | Resource ../../../lib/bmc_network_utils.robot |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 7 | |
| 8 | Suite Setup Suite Setup Execution |
| 9 | Suite Teardown Close Browser |
| 10 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 11 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 12 | *** Variables *** |
| 13 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 14 | ${xpath_network_heading} //h1[text()="Network"] |
| 15 | ${xpath_interface_settings} //h2[text()="Interface settings"] |
| 16 | ${xpath_network_settings} //h2[text()="Network settings"] |
| 17 | ${xpath_static_ipv4} //h2[text()="IPv4"] |
| 18 | ${xpath_static_dns} //h2[text()="Static DNS"] |
| 19 | ${xpath_domain_name_toggle} //*[@data-test-id="networkSettings-switch-useDomainName"] |
| 20 | ${xpath_dns_servers_toggle} //*[@data-test-id="networkSettings-switch-useDns"] |
| 21 | ${xpath_ntp_servers_toggle} //*[@data-test-id="networkSettings-switch-useNtp"] |
| 22 | ${xpath_add_static_ipv4_address_button} //button[contains(text(),"Add static IPv4 address")] |
| 23 | ${xpath_add_dns_ip_address_button} //button[contains(text(),"Add IP address")] |
meghagn | cca733c | 2021-12-20 04:34:55 -0600 | [diff] [blame] | 24 | ${xpath_hostname} //*[@title="Edit hostname"] |
| 25 | ${xpath_hostname_input} //*[@id="hostname"] |
| 26 | ${xpath_input_ip_address} //*[@id="ipAddress"] |
| 27 | ${xpath_input_gateway} //*[@id="gateway"] |
| 28 | ${xpath_input_subnetmask} //*[@id="subnetMask"] |
| 29 | ${xpath_input_static_dns} //*[@id="staticDns"] |
| 30 | ${xpath_cancel_button} //button[contains(text(),'Cancel')] |
| 31 | ${xpath_add_button} //button[contains(text(),'Add')] |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame^] | 32 | ${xpath_delete_dns_server} //*[@title="Delete DNS address"] |
| 33 | ${xpath_add_dns_server} //button[normalize-space(text())='Add'] |
| 34 | |
| 35 | ${dns_server} 10.10.10.10 |
Anves Kumar rayankula | 4c88447 | 2020-11-24 05:03:45 -0600 | [diff] [blame] | 36 | |
Anves Kumar rayankula | ef4d34f | 2021-02-12 03:26:42 -0600 | [diff] [blame] | 37 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 38 | *** Test Cases *** |
| 39 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 40 | Verify Navigation To Network Page |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 41 | [Documentation] Login to GUI and navigate to the settings sub-menu network page. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 42 | [Tags] Verify_Navigation_To_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 43 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 44 | Page Should Contain Element ${xpath_network_heading} |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 45 | |
| 46 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 47 | Verify Existence Of All Sections In Network Page |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 48 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 49 | ... and confirm the page contains sections that should be accessible. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 50 | [Tags] Verify_Existence_Of_All_Sections_In_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 51 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 52 | Wait Until Page Contains Element ${xpath_network_settings} timeout=1min |
| 53 | Page Should Contain Element ${xpath_interface_settings} |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 54 | Page Should Contain Element ${xpath_static_ipv4} |
| 55 | Page Should Contain Element ${xpath_static_dns} |
| 56 | |
| 57 | |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 58 | Verify Existence Of All Buttons In Network Page |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 59 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 60 | ... and confirm the page contains basic features button that should be accessible. |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 61 | [Tags] Verify_Existence_Of_All_Buttons_In_Network_Page |
Anusha Dathatri | e11a54d | 2020-08-31 08:35:47 -0500 | [diff] [blame] | 62 | |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 63 | Page Should Contain Button ${xpath_add_static_ipv4_address_button} |
| 64 | Page Should Contain Button ${xpath_add_dns_ip_address_button} |
| 65 | Page Should Contain Button ${xpath_domain_name_toggle} |
| 66 | Page Should Contain Button ${xpath_dns_servers_toggle} |
| 67 | Page Should Contain Button ${xpath_ntp_servers_toggle} |
Anves Kumar rayankula | c3a37e4 | 2021-06-17 06:56:51 -0500 | [diff] [blame] | 68 | |
| 69 | |
meghagn | cca733c | 2021-12-20 04:34:55 -0600 | [diff] [blame] | 70 | Verify Existence Of All Fields In Hostname |
| 71 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 72 | ... and confirm hostname contains all the fields. |
| 73 | [Tags] Verify_Existence_Of_All_Fields_In_Hostname |
| 74 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 75 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
| 76 | ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network |
| 77 | |
| 78 | Click Element ${xpath_hostname} |
| 79 | Wait Until Page Contains Edit hostname timeout=1min |
| 80 | Page Should Contain Textfield ${xpath_hostname_input} |
| 81 | Page Should Contain Button ${xpath_cancel_button} |
| 82 | Page Should Contain Button ${xpath_add_button} |
| 83 | |
| 84 | |
| 85 | Verify Existence Of All Fields In Static IP Address |
| 86 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 87 | ... and confirm section static IPv4 contains all the fields. |
| 88 | [Tags] Verify_Existence_Of_All_Fields_In_Static_IP_Address |
| 89 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 90 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
| 91 | ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network |
| 92 | |
| 93 | Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_static_ipv4_address_button} |
| 94 | Wait Until Page Contains Add static IPv4 address timeout=15s |
| 95 | Page Should Contain Textfield ${xpath_input_ip_address} |
| 96 | Page Should Contain Textfield ${xpath_input_gateway} |
| 97 | Page Should Contain Textfield ${xpath_input_subnetmask} |
| 98 | Page Should Contain Button ${xpath_cancel_button} |
| 99 | Page Should Contain Button ${xpath_add_button} |
| 100 | |
| 101 | |
| 102 | Verify Existence Of All Fields In Static DNS |
| 103 | [Documentation] Login to GUI and navigate to the settings sub-menu network page |
| 104 | ... and confirm section static DNS contains all the fields. |
| 105 | [Tags] Verify_Existence_Of_All_Fields_In_Static_DNS |
| 106 | [Teardown] Run Keywords Click Button ${xpath_cancel_button} AND |
| 107 | ... Wait Until Keyword Succeeds 10 sec 5 sec |
| 108 | ... Refresh GUI And Verify Element Value ${xpath_network_heading} Network |
| 109 | |
| 110 | Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_dns_ip_address_button} |
| 111 | Wait Until Page Contains Add IP address timeout=11s |
| 112 | Page Should Contain Textfield ${xpath_input_static_dns} |
| 113 | Page Should Contain Button ${xpath_cancel_button} |
| 114 | Page Should Contain Button ${xpath_add_button} |
| 115 | |
| 116 | |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame^] | 117 | Configure And Verify DNS Server Via GUI |
| 118 | [Documentation] Login to GUI Network page, add DNS server IP |
| 119 | ... and verify that the page reflects server IP. |
| 120 | [Tags] Configure_And_Verify_DNS_Server_Via_GUI |
| 121 | [Teardown] Delete DNS Servers And Verify |
| 122 | |
| 123 | Add DNS Servers And Verify ${dns_server} |
| 124 | |
| 125 | |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 126 | *** Keywords *** |
| 127 | |
| 128 | Suite Setup Execution |
meghagn | 1bd3928 | 2021-12-19 23:56:42 -0600 | [diff] [blame] | 129 | [Documentation] Do suite setup tasks. |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 130 | |
| 131 | Launch Browser And Login GUI |
Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 132 | Click Element ${xpath_settings_menu} |
| 133 | Click Element ${xpath_network_sub_menu} |
| 134 | Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network |
meghagn | 2007beb | 2022-01-11 08:23:13 -0600 | [diff] [blame^] | 135 | |
| 136 | |
| 137 | Add DNS Servers And Verify |
| 138 | [Documentation] Login to GUI Network page,add DNS server on BMC |
| 139 | ... and verify it via BMC CLI. |
| 140 | [Arguments] ${dns_server} ${expected_status}=Valid format |
| 141 | |
| 142 | # Description of the argument(s): |
| 143 | # dns_server A list of static name server IPs to be |
| 144 | # configured on the BMC. |
| 145 | # expected_status Expected status while adding DNS server address |
| 146 | # ... (e.g. Invalid format / Field required). |
| 147 | |
| 148 | Wait Until Page Contains Element ${xpath_add_dns_ip_address_button} timeout=15sec |
| 149 | |
| 150 | Click Button ${xpath_add_dns_ip_address_button} |
| 151 | Input Text ${xpath_input_static_dns} ${dns_server} |
| 152 | Click Button ${xpath_add_dns_server} |
| 153 | Run keyword if '${expected_status}' != 'Valid format' |
| 154 | ... Run keywords Page Should Contain ${expected_status} AND Return From Keyword |
| 155 | |
| 156 | Wait Until Page Contains Element ${xpath_add_dns_ip_address_button} timeout=10sec |
| 157 | Wait Until Page Contains ${dns_server} timeout=40sec |
| 158 | |
| 159 | # Check if newly added DNS server is configured on BMC. |
| 160 | ${cli_name_servers}= CLI Get Nameservers |
| 161 | ${cmd_status}= Run Keyword And Return Status |
| 162 | ... List Should Contain Sub List ${cli_name_servers} ${dns_server} |
| 163 | |
| 164 | |
| 165 | Delete DNS Servers And Verify |
| 166 | [Documentation] Login to GUI Network page,delete static name servers |
| 167 | ... and verify that page doesnot reflects static name servers. |
| 168 | |
| 169 | Page Should Contain Element ${xpath_delete_dns_server} |
| 170 | Wait Until Element Is Enabled ${xpath_delete_dns_server} |
| 171 | Click Button ${xpath_delete_dns_server} |
| 172 | Wait Until Page Contains Element ${xpath_add_dns_ip_address_button} timeout=15 |
| 173 | # Check if all name servers deleted on BMC. |
| 174 | ${nameservers}= CLI Get Nameservers |
| 175 | Should Be Empty ${nameservers} |