GUI robot test code with latest directives

Changes:
     - Run Keyword If is deprecated since Robot
       Framework version 5.*, use 'IF' instead
     - Remove the keyword from teardown and add
       check in the keyword to re-run GUI if
       test failed.

Tested:
     - Tested with dry-run option changes

Change-Id: Ie1b0957470ac4a33c846aa153a0c776fdba34db5
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/gui/lib/gui_resource.robot b/gui/lib/gui_resource.robot
index 5c13da7..96b9f13 100644
--- a/gui/lib/gui_resource.robot
+++ b/gui/lib/gui_resource.robot
@@ -198,8 +198,9 @@
     Click Button  ${xpath_add_dns_ip_address_button}
     Input Text  ${xpath_input_static_dns}  ${dns_server}
     Click Button  ${xpath_add_button}
-    Run keyword if  '${expected_status}' != 'Valid format'
-    ...  Run keywords  Page Should Contain  ${expected_status}  AND  Return From Keyword
+    IF  '${expected_status}' != 'Valid format'
+        Page Should Contain  ${expected_status}  AND  Return From Keyword
+    END
 
     Wait Until Page Contains Element  ${xpath_add_dns_ip_address_button}  timeout=10sec
     Wait Until Page Contains  ${dns_server}  timeout=40sec
diff --git a/gui/test/server_config/test_obmc_gui_firmware_update.robot b/gui/test/server_config/test_obmc_gui_firmware_update.robot
index 27f0efc..fc65bf2 100644
--- a/gui/test/server_config/test_obmc_gui_firmware_update.robot
+++ b/gui/test/server_config/test_obmc_gui_firmware_update.robot
@@ -8,7 +8,7 @@
 Suite Setup     Launch Browser And Login OpenBMC GUI
 Suite Teardown  Close Browser
 Test Setup      Test Setup Execution
-Test Teardown   Run Keyword If Test Failed  Re-Launch GUI on Failure
+Test Teardown   Re-Launch GUI on Failure
 
 *** Variables ***
 ${xpath_select_server_config}   //*[@id="nav__top-level"]/li[4]/button
@@ -100,5 +100,7 @@
 Re-Launch GUI on Failure
     [Documentation]  On failure of test case, close and re-launch GUI.
 
+    Return From Keyword If  '${TEST_STATUS}' != 'FAIL'
+
     Logout And Close Browser
     Launch Browser And Login OpenBMC GUI