1*** Settings ***
2
3Documentation   Test OpenBMC GUI "Network settings" sub-menu of
4...             "Server configuration".
5
6Resource        ../../lib/resource.robot
7
8Suite Setup     Launch Browser And Login OpenBMC GUI
9Suite Teardown  Close Browser
10Test Setup      Test Setup Execution
11
12*** Variables ***
13
14${xpath_select_server_configuration}  //*[@id="nav__top-level"]/li[4]/button
15${xpath_select_network_settings}  //a[@href='#/configuration/network']
16${xpath_hostname_input}  //*[@id="net-config__mac"]
17${xpath_network_save_settings}  //*[text()="Save settings"]
18${xpath_continue}  //*[@id=""]/main/section/div/div[4]/button[2]
19${xpath_network_config_ipv4_address}  //*[@id="ipv4-address-1"]
20${xpath_default_gateway_input}  //*[@id="net-config__domain"]
21${xpath_mac_address_input}  //*[@id="net-config__host"]
22${xpath_ipv4-address-input}  //*[@id="ipv4-address-1"]
23${xpath_network_DHCP_button}  //*[contains(text(),"Obtain an IP address automatically")]
24${xpath_network_static_button}  //*[contains(text(),"Assign a static IP address")]
25
26*** Test Cases ***
27
28Verify Network Settings From Server Configuration
29    [Documentation]  Verify ability to select "Network Settings" sub-menu option
30    ...  of "Server Configuration".
31    [Tags]  Verify_Network_Settings_From_Server_Configuration
32
33    Wait Until Page Contains  BMC network settings
34    Page Should Contain  IPV4 settings  Common settings
35
36
37Verify Hostname Text Configuration
38    [Documentation]  Verify hostname text is configurable from "network settings"
39    ...  sub-menu.
40    [Tags]  Verify_Hostname_Text_Configuration
41
42    Input Text  ${xpath_hostname_input}  witherspoon1
43    Click Element  ${xpath_network_save_settings}
44    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
45    Click Element  ${xpath_continue}
46    Click Element  ${xpath_select_refresh_button}
47    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
48    Page Should Contain  witherspoon1
49
50
51Verify Default Gateway Editable
52    [Documentation]  Verify default gateway text input allowed from "network
53    ...  settings".
54    [Tags]  Verify_Default_Gateway_Editable
55
56    Page Should Contain Element  ${xpath_default_gateway_input}
57    Input Text  ${xpath_default_gateway_input}  10.6.6.7
58
59
60Verify MAC Address Editable
61    [Documentation]  Verify MAC address text input allowed from "network
62    ...  settings".
63    [Tags]  Verify_MAC_Address_Editable
64
65    Page Should Contain Element  ${xpath_mac_address_input}
66    Input Text  ${xpath_mac_address_input}  70:e2:84:14:16:6c
67
68
69Verify IP Address Editable With Static IP Selection
70    [Documentation]  Verify IP address editable with static IP selection.
71    [Tags]  Verify_IP_Address_Editable_With_Static_IP_Selection
72
73    Page Should Contain Element  ${xpath_network_static_button}
74    Click Element  ${xpath_network_static_button}
75    ${status}=  Run Keyword And Return Status  Input Text
76    ...  ${xpath_ipv4-address-input}  ${OPENBMC_HOST}
77    Should Be True  '${status}' == '${True}'
78
79
80Verify IP Address Noneditable With DHCP IP Selection
81    [Documentation]  Verify IP address noneditable with DHCP IP selection.
82    [Tags]  Verify_IP_Address_Noneditable_With_DHCP_IP_Selection
83
84    Page Should Contain Element  ${xpath_network_DHCP_button}
85    Click Element  ${xpath_network_DHCP_button}
86    Element Should Be Disabled  ${xpath_ipv4-address-input}
87
88
89*** Keywords ***
90
91Test Setup Execution
92   [Documentation]  Do test case setup tasks.
93
94    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
95    Click Element  ${xpath_select_server_configuration}
96    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
97    Click Element  ${xpath_select_network_settings}
98    Wait Until Page Contains Element  ${xpath_network_config_ipv4_address}
99
100