Adding IPv6 GUI Test Cases

    Changes:
        Add IPv6 GUI test cases.

    Tested:
       Ran and tested on BMC Environment.

Change-Id: Iaedfde7aa68ad160af7935c8594b5e693839cdbd
Signed-off-by: Sweta Potthuri <spotthur@in.ibm.com>
diff --git a/gui/gui_test/settings_menu/test_network_sub_menu.robot b/gui/gui_test/settings_menu/test_network_sub_menu.robot
index 37fe57e..1f1d2ac 100644
--- a/gui/gui_test/settings_menu/test_network_sub_menu.robot
+++ b/gui/gui_test/settings_menu/test_network_sub_menu.robot
@@ -22,6 +22,7 @@
 ${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_static_ipv6_address_button}  //button[contains(text(),"Add static IPv6 address")]
+${xpath_add_static_def_gateway_button}   //button[contains(text(),"Add IPv6 static default gateway address")]
 ${xpath_hostname}                        //*[@title="Edit hostname"]
 ${xpath_hostname_input}                  //*[@id="hostname"]
 ${xpath_input_ip_address}                //*[@id="ipAddress"]
@@ -50,6 +51,8 @@
 ${test_ipv4_addr}                        10.7.7.7
 ${test_ipv4_addr_1}                      10.7.7.8
 ${test_ipv6_addr}                        2001:db8:3333:4444:5555:6666:7777:8888
+${test_ipv6_addr_1}                      2001:db8:3333:4444:5555:6666:7777:8889
+${ipv4_hexword_addr}                     10.5.5.6:1A:1B:1C:1D:1E:1F
 ${test_prefix_length}                    64
 ${out_of_range_ip}                       10.7.7.256
 ${string_ip}                             aa.bb.cc.dd
@@ -144,6 +147,21 @@
     Page Should Contain Button  ${xpath_add_button}
 
 
+Verify Existence Of All Fields In IPv6 Static Default Gateway
+    [Documentation]  Login to GUI and navigate to the settings sub-menu network page
+    ...  and confirm section IPv6 static default gateway contains all the fields.
+    [Tags]  Verify_Existence_Of_All_Fields_In_IPv6_Static_Default_Gateway
+    [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_def_gateway_button}
+    Wait Until Page Contains  Add IPv6 static default gateway address  timeout=11s
+    Page Should Contain Textfield  ${xpath_input_ip_address}
+    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.
@@ -210,11 +228,31 @@
     ${spl_char_ip}       ${test_subnet_mask}  ${default_gateway}  Invalid format
 
 
-Configure And Verify Static IPv6 Address
-    [Documentation]  Configure and verify static IPv6 address.
-    [Tags]  Configure_And_Verify_Static_IPv6_Address
+Configure And Verify Multiple Static IPv6 Address
+    [Documentation]  Login to GUI Network page, configure multiple static IPv6 address and verify.
+    [Tags]  Configure_And_Verify_Multiple_Static_IPv6_Address
 
-    Add Static IPv6 Address And Verify  ${test_ipv6_addr}  ${test_prefix_length}  Success
+    Add Static IPv6 Address And Verify  ${test_ipv6_addr}    ${test_prefix_length}  Success
+    Add Static IPv6 Address And Verify  ${test_ipv6_addr_1}  ${test_prefix_length}  Success
+
+
+Configure And Verify Static IPv6 Address
+    [Documentation]  Login to GUI Network page, configure static IPv6 address and verify.
+    [Tags]  Configure_And_Verify_Static_IPv6_Address
+    [Template]  Add Static IPv6 Address And Verify
+
+    # ipv6                  prefix_length          status
+    ${test_ipv6_addr}       ${test_prefix_length}  Success
+    ${ipv4_hexword_addr}    ${test_prefix_length}  Invalid format
+
+
+Configure And Verify Static Default Gateway
+    [Documentation]  Login to GUI Network page, configure invalid static IPv6 default gateway and verify.
+    [Tags]  Configure_And_Verify_Static_Default_Gateway
+    [Template]  Add IPv6 Static Default Gateway And Verify
+
+    # ipv6 static default gateway  status
+    ${test_ipv6_addr}              Success
 
 
 Modify DHCP Properties By Toggling And Verify
@@ -361,7 +399,7 @@
     # Description of argument(s):
     # ipv6_address        IPv6 address to be added.
     # prefix_length       Prefix length of the IPv6 to be added.
-    # expected_status     Expected status while adding static IPv6 address
+    # expected_status     Expected status while adding static IPv6 address.
 
     Wait Until Element Is Enabled  ${xpath_add_static_ipv6_address_button}  timeout=60sec
     Click Element  ${xpath_add_static_ipv6_address_button}
@@ -379,6 +417,41 @@
     END
 
 
+Add IPv6 Static Default Gateway And Verify
+    [Documentation]  Add IPv6 static default gateway and verify.
+    [Arguments]  ${ipv6_static_def_gw}  ${expected_status}=error
+
+    # Description of argument(s):
+    # ipv6_static_def_gw  IPv6 static default gatway.
+    # expected_status     Expected status (Success or Fail).
+
+    Wait Until Element Is Enabled  ${xpath_add_static_def_gateway_button}  timeout=60sec
+    Click Element  ${xpath_add_static_def_gateway_button}
+
+    Input Text  ${xpath_input_ip_address}  ${ipv6_static_def_gw}
+
+    Click Element  ${xpath_add_button}
+    IF  '${expected_status}' == 'Success'
+        Wait Until Page Contains  ${ipv6_static_def_gw}  timeout=40sec
+        Validate Network Config On BMC
+    ELSE
+        Page Should Contain  Invalid format
+        Cancel And Verify Network Heading
+    END
+    ${redfish_ipv6_staticdef_gw}=  Get Static Default Gateway Property Via Redfish
+    Should Be Equal  ${ipv6_static_def_gw}  ${redfish_ipv6_staticdef_gw}
+
+
+Get Static Default Gateway Property Via Redfish
+     [Documentation]  Get Static Default Gateway property value via redfish.
+
+     ${active_channel_config}=  Get Active Channel Config
+     ${ethernet_interface}=  Set Variable  ${active_channel_config['${CHANNEL_NUMBER}']['name']}
+     ${resp}=  Redfish.Get  ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
+     ${ipv6_static_def_gw}=  Get From Dictionary  ${resp.dict}  IPv6StaticDefaultGateways
+     RETURN  ${resp.dict["IPv6StaticDefaultGateways"][0]["Address"]}
+
+
 Configure And Verify Network Settings Via GUI
     [Documentation]  Configure and verify network settings via GUI.
     [Arguments]  ${xpath_nw_settings}  ${xpath_nw_settings_input_field}  ${input_value}