blob: 1b9f9a21337a95880e6299db88d2ef6c36105e2b [file] [log] [blame]
Anusha Dathatri21ac59f2020-07-14 13:12:58 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "Network settings" sub-menu of
4... "Server configuration".
5
6Resource ../../lib/resource.robot
7
8Suite Setup Suite Setup Execution
9Suite Teardown Close Browser
10
11*** Variables ***
12
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050013${xpath_network_setting_heading} //h1[text()="Network settings"]
14${xpath_interface} //h2[text()="Interface"]
15${xpath_system} //h2[text()="System"]
16${xpath_static_ipv4} //h2[text()="Static IPv4"]
17${xpath_static_dns} //h2[text()="Static DNS"]
18${xpath_hostname_input} //*[@data-test-id="networkSettings-input-hostname"]
19${xpath_network_save_settings} //button[@data-test-id="networkSettings-button-saveNetworkSettings"]
20${xpath_default_gateway_input} //*[@data-test-id="networkSettings-input-gateway"]
21${xpath_mac_address_input} //*[@data-test-id="networkSettings-input-macAddress"]
22${xpath_static_input_ip0} //*[@data-test-id="networkSettings-input-staticIpv4-0"]
23${xpath_add_static_ip} //button[contains(text(),"Add static IP")]
24${xpath_setting_success} //*[contains(text(),"Successfully saved network settings.")]
25${xpath_add_dns_server} //button[contains(text(),"Add DNS server")]
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050026
27*** Test Cases ***
28
Anusha Dathatrie11a54d2020-08-31 08:35:47 -050029Verify Navigation To Network Settings Page
30 [Documentation] Verify navigation to network settings page.
31 [Tags] Verify_Navigation_To_Network_Settings_Page
32
33 Page Should Contain Element ${xpath_network_setting_heading}
34
35
36Verify Existence Of All Sections In Network Settings Page
37 [Documentation] Verify existence of all sections in network settings page.
38 [Tags] Verify_Existence_Of_All_Sections_In_Network_Settings_Page
39
40 Page Should Contain Element ${xpath_interface}
41 Page Should Contain Element ${xpath_system}
42 Page Should Contain Element ${xpath_static_ipv4}
43 Page Should Contain Element ${xpath_static_dns}
44
45
46Verify Existence Of All Buttons In Network Settings Page
47 [Documentation] Verify existence of all buttons in network settings page.
48 [Tags] Verify_Existence_Of_All_Buttons_In_Network_Settings_Page
49
50 Page Should Contain Element ${xpath_add_static_ip}
51 Page Should Contain Element ${xpath_add_dns_server}
52
53
Anusha Dathatri21ac59f2020-07-14 13:12:58 -050054Verify Network Settings From Server Configuration
55 [Documentation] Verify ability to select "Network Settings" sub-menu option
56 ... of "Server Configuration".
57 [Tags] Verify_Network_Settings_From_Server_Configuration
58
59 Page Should Contain IP address
60
61
62Verify Hostname Text Configuration
63 [Documentation] Verify hostname text is configurable from "network settings"
64 ... sub-menu.
65 [Tags] Verify_Hostname_Text_Configuration
66
67 Input Text ${xpath_hostname_input} witherspoon1
68 Click Button ${xpath_network_save_settings}
69 Wait Until Page Contains Element ${xpath_setting_success} timeout=10
70 Element Should Be Disabled ${xpath_network_save_settings}
71 Click Element ${xpath_select_refresh_button}
72 Wait Until Keyword Succeeds 15 sec 5 sec Textfield Should Contain ${xpath_hostname_input}
73 ... witherspoon1
74
75
76Verify Default Gateway Editable
77 [Documentation] Verify default gateway text input allowed from "network
78 ... settings".
79 [Tags] Verify_Default_Gateway_Editable
80
81 Wait Until Page Contains Element ${xpath_default_gateway_input}
82 Input Text ${xpath_default_gateway_input} 10.6.6.7
83
84
85Verify MAC Address Editable
86 [Documentation] Verify MAC address text input allowed from "network
87 ... settings".
88 [Tags] Verify_MAC_Address_Editable
89
90 Wait Until Page Contains Element ${xpath_mac_address_input}
91 Input Text ${xpath_mac_address_input} AA:E2:84:14:28:79
92
93
94Verify Static IP Address Editable
95 [Documentation] Verify static IP address is editable.
96 [Tags] Verify_Static_IP_Address_Editable
97
98 ${exists}= Run Keyword And Return Status Wait Until Page Contains Element ${xpath_static_input_ip0}
99 Run Keyword If '${exists}' == '${False}'
100 ... Click Element ${xpath_add_static_ip}
101
102 Input Text ${xpath_static_input_ip0} ${OPENBMC_HOST}
103
104
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500105Verify System Section In Network Setting page
106 [Documentation] Verify hostname, MAC address and default gateway
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500107 ... under system section of network setting page.
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500108 [Tags] Verify_System_Section
109
Anves Kumar rayankulab172fbe2020-09-09 00:27:21 -0500110 ${host_name}= Redfish_Utils.Get Attribute ${REDFISH_NW_PROTOCOL_URI} HostName
111 Textfield Value Should Be ${xpath_hostname_input} ${hos_name}
Anves Kumar rayankula475811b2020-08-31 06:22:11 -0500112
113 ${mac_address}= Get BMC MAC Address
114 Textfield Value Should Be ${xpath_mac_address_input} ${mac_address}
115
116 ${default_gateway}= Get BMC Default Gateway
117 Textfield Value Should Be ${xpath_default_gateway_input} ${default_gateway}
118
119
Anusha Dathatri21ac59f2020-07-14 13:12:58 -0500120*** Keywords ***
121
122Suite Setup Execution
123 [Documentation] Do test case setup tasks.
124
125 Launch Browser And Login GUI
126 Click Element ${xpath_server_configuration}
127 Click Element ${xpath_select_network_settings}
128 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network-settings
129