blob: 79ff6dac02927f5375a80f53351f3ece623be388 [file] [log] [blame]
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05001*** Settings ***
2
Rahul Maheshwari142642d2021-08-24 00:00:15 -05003Documentation Test OpenBMC GUI "Network" sub-menu of "Settings".
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05004
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
Anves Kumar rayankula65e5ed22020-09-17 04:44:44 -05006Resource ../../../lib/bmc_network_utils.robot
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05007
8Suite Setup Suite Setup Execution
9Suite Teardown Close Browser
10
meghagn1bd39282021-12-19 23:56:42 -060011
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050012*** Variables ***
13
meghagn1bd39282021-12-19 23:56:42 -060014${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")]
meghagncca733c2021-12-20 04:34:55 -060024${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')]
meghagn2007beb2022-01-11 08:23:13 -060032${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 rayankula4c884472020-11-24 05:03:45 -060036
Anves Kumar rayankulaef4d34f2021-02-12 03:26:42 -060037
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050038*** Test Cases ***
39
Rahul Maheshwari142642d2021-08-24 00:00:15 -050040Verify Navigation To Network Page
meghagn1bd39282021-12-19 23:56:42 -060041 [Documentation] Login to GUI and navigate to the settings sub-menu network page.
Rahul Maheshwari142642d2021-08-24 00:00:15 -050042 [Tags] Verify_Navigation_To_Network_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050043
Rahul Maheshwari142642d2021-08-24 00:00:15 -050044 Page Should Contain Element ${xpath_network_heading}
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050045
46
Rahul Maheshwari142642d2021-08-24 00:00:15 -050047Verify Existence Of All Sections In Network Page
meghagn1bd39282021-12-19 23:56:42 -060048 [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 Maheshwari142642d2021-08-24 00:00:15 -050050 [Tags] Verify_Existence_Of_All_Sections_In_Network_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050051
meghagn1bd39282021-12-19 23:56:42 -060052 Wait Until Page Contains Element ${xpath_network_settings} timeout=1min
53 Page Should Contain Element ${xpath_interface_settings}
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050054 Page Should Contain Element ${xpath_static_ipv4}
55 Page Should Contain Element ${xpath_static_dns}
56
57
Rahul Maheshwari142642d2021-08-24 00:00:15 -050058Verify Existence Of All Buttons In Network Page
meghagn1bd39282021-12-19 23:56:42 -060059 [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 Maheshwari142642d2021-08-24 00:00:15 -050061 [Tags] Verify_Existence_Of_All_Buttons_In_Network_Page
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050062
meghagn1bd39282021-12-19 23:56:42 -060063 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 rayankulac3a37e42021-06-17 06:56:51 -050068
69
meghagncca733c2021-12-20 04:34:55 -060070Verify 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
85Verify 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
102Verify 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
meghagn2007beb2022-01-11 08:23:13 -0600117Configure 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 Dathatri21ac59f2020-07-14 13:12:58 -0500126*** Keywords ***
127
128Suite Setup Execution
meghagn1bd39282021-12-19 23:56:42 -0600129 [Documentation] Do suite setup tasks.
Anusha Dathatri21ac59f2020-07-14 13:12:58 -0500130
131 Launch Browser And Login GUI
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500132 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
meghagn2007beb2022-01-11 08:23:13 -0600135
136
137Add 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
165Delete 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}