blob: a6fea78025667559dd5300143e35f0e7435c8622 [file] [log] [blame]
*** Settings ***
Documentation Test OpenBMC GUI "Network" sub-menu of "Settings".
Resource ../../lib/gui_resource.robot
Resource ../../../lib/bmc_network_utils.robot
Suite Setup Suite Setup Execution
Suite Teardown Close Browser
*** Variables ***
${xpath_network_heading} //h1[text()="Network"]
${xpath_interface_settings} //h2[text()="Interface settings"]
${xpath_network_settings} //h2[text()="Network settings"]
${xpath_static_ipv4} //h2[text()="IPv4"]
${xpath_static_dns} //h2[text()="Static DNS"]
${xpath_domain_name_toggle} //*[@data-test-id="networkSettings-switch-useDomainName"]
${xpath_dns_servers_toggle} //*[@data-test-id="networkSettings-switch-useDns"]
${xpath_ntp_servers_toggle} //*[@data-test-id="networkSettings-switch-useNtp"]
${xpath_add_static_ipv4_address_button} //button[contains(text(),"Add static IPv4 address")]
${xpath_add_dns_ip_address_button} //button[contains(text(),"Add IP address")]
${xpath_hostname} //*[@title="Edit hostname"]
${xpath_hostname_input} //*[@id="hostname"]
${xpath_input_ip_address} //*[@id="ipAddress"]
${xpath_input_gateway} //*[@id="gateway"]
${xpath_input_subnetmask} //*[@id="subnetMask"]
${xpath_input_static_dns} //*[@id="staticDns"]
${xpath_cancel_button} //button[contains(text(),'Cancel')]
${xpath_add_button} //button[contains(text(),'Add')]
*** Test Cases ***
Verify Navigation To Network Page
[Documentation] Login to GUI and navigate to the settings sub-menu network page.
[Tags] Verify_Navigation_To_Network_Page
Page Should Contain Element ${xpath_network_heading}
Verify Existence Of All Sections In Network Page
[Documentation] Login to GUI and navigate to the settings sub-menu network page
... and confirm the page contains sections that should be accessible.
[Tags] Verify_Existence_Of_All_Sections_In_Network_Page
Wait Until Page Contains Element ${xpath_network_settings} timeout=1min
Page Should Contain Element ${xpath_interface_settings}
Page Should Contain Element ${xpath_static_ipv4}
Page Should Contain Element ${xpath_static_dns}
Verify Existence Of All Buttons In Network Page
[Documentation] Login to GUI and navigate to the settings sub-menu network page
... and confirm the page contains basic features button that should be accessible.
[Tags] Verify_Existence_Of_All_Buttons_In_Network_Page
Page Should Contain Button ${xpath_add_static_ipv4_address_button}
Page Should Contain Button ${xpath_add_dns_ip_address_button}
Page Should Contain Button ${xpath_domain_name_toggle}
Page Should Contain Button ${xpath_dns_servers_toggle}
Page Should Contain Button ${xpath_ntp_servers_toggle}
Verify Existence Of All Fields In Hostname
[Documentation] Login to GUI and navigate to the settings sub-menu network page
... and confirm hostname contains all the fields.
[Tags] Verify_Existence_Of_All_Fields_In_Hostname
[Teardown] Run Keywords Click Button ${xpath_cancel_button} AND
... Wait Until Keyword Succeeds 10 sec 5 sec
... Refresh GUI And Verify Element Value ${xpath_network_heading} Network
Click Element ${xpath_hostname}
Wait Until Page Contains Edit hostname timeout=1min
Page Should Contain Textfield ${xpath_hostname_input}
Page Should Contain Button ${xpath_cancel_button}
Page Should Contain Button ${xpath_add_button}
Verify Existence Of All Fields In Static IP Address
[Documentation] Login to GUI and navigate to the settings sub-menu network page
... and confirm section static IPv4 contains all the fields.
[Tags] Verify_Existence_Of_All_Fields_In_Static_IP_Address
[Teardown] Run Keywords Click Button ${xpath_cancel_button} AND
... Wait Until Keyword Succeeds 10 sec 5 sec
... Refresh GUI And Verify Element Value ${xpath_network_heading} Network
Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_static_ipv4_address_button}
Wait Until Page Contains Add static IPv4 address timeout=15s
Page Should Contain Textfield ${xpath_input_ip_address}
Page Should Contain Textfield ${xpath_input_gateway}
Page Should Contain Textfield ${xpath_input_subnetmask}
Page Should Contain Button ${xpath_cancel_button}
Page Should Contain Button ${xpath_add_button}
Verify Existence Of All Fields In Static DNS
[Documentation] Login to GUI and navigate to the settings sub-menu network page
... and confirm section static DNS contains all the fields.
[Tags] Verify_Existence_Of_All_Fields_In_Static_DNS
[Teardown] Run Keywords Click Button ${xpath_cancel_button} AND
... Wait Until Keyword Succeeds 10 sec 5 sec
... Refresh GUI And Verify Element Value ${xpath_network_heading} Network
Wait Until Keyword Succeeds 30 sec 10 sec Click Element ${xpath_add_dns_ip_address_button}
Wait Until Page Contains Add IP address timeout=11s
Page Should Contain Textfield ${xpath_input_static_dns}
Page Should Contain Button ${xpath_cancel_button}
Page Should Contain Button ${xpath_add_button}
*** Keywords ***
Suite Setup Execution
[Documentation] Do suite setup tasks.
Launch Browser And Login GUI
Click Element ${xpath_settings_menu}
Click Element ${xpath_network_sub_menu}
Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain network