Enable hardware CI for Vue GUI
What changes are made:
- Added following basic test cases for Vue GUI testing:
- Verify Header Text
- Verify GUI Logout
- Vue GUI tests are added in new "gui_test" folder
- Added new file WEBUI_CI to run hardware CI for Vue GUI
Change-Id: Id341a5984b3e5c91f38e41017dae24deeee0b738
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/gui/data/resource_variables.py b/gui/data/resource_variables.py
index 64362a5..3e8a942 100644
--- a/gui/data/resource_variables.py
+++ b/gui/data/resource_variables.py
@@ -116,3 +116,7 @@
xpath_individual_event_export = \
"//*[@id='event__actions-bar']/div[2]/div[2]/a"
xpath_select_all_events = "(//*[@class='control__indicator'])[1]"
+
+ # New GUI variables
+ xpath_login_button = "//button[@type='submit']"
+ xpath_logout_button = "//button[@id='app-header-logout']"
diff --git a/gui/gui_test/gui_header/test_gui_header.robot b/gui/gui_test/gui_header/test_gui_header.robot
new file mode 100644
index 0000000..2619973
--- /dev/null
+++ b/gui/gui_test/gui_header/test_gui_header.robot
@@ -0,0 +1,31 @@
+*** Settings ***
+
+Documentation Test OpenBMC GUI header.
+
+Resource ../../lib/resource.robot
+
+Suite Setup Launch Browser And Login GUI
+Suite Teardown Close Browser
+
+
+*** Variables ***
+
+${xpath_header_text} //*[contains(@class, "navbar-text")]
+
+
+*** Test Cases ***
+
+Verify GUI Header Text
+ [Documentation] Verify text in GUI header.
+ [Tags] Verify_GUI_Header_Text
+
+ ${gui_header_text}= Get Text ${xpath_header_text}
+ Should Contain ${gui_header_text} BMC System Management
+
+
+Verify GUI Logout
+ [Documentation] Verify OpenBMC GUI logout.
+ [Tags] Verify_GUI_Logout
+
+ Click Element ${xpath_logout_button}
+ Wait Until Page Contains Element ${xpath_login_button} timeout=15s
diff --git a/gui/lib/resource.robot b/gui/lib/resource.robot
index c3d75e5..1f91409 100644
--- a/gui/lib/resource.robot
+++ b/gui/lib/resource.robot
@@ -292,3 +292,33 @@
Click Button ${xpath_button_user_action}
Click Button ${xpath_button_logout}
Close Browser
+
+
+Launch Browser And Login GUI
+ [Documentation] Launch browser and login to OpenBMC GUI.
+
+ Open Browser With URL ${obmc_gui_url}
+ Login GUI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
+
+
+Login GUI
+ [Documentation] Login to OpenBMC GUI.
+ [Arguments] ${username}=${OPENBMC_USERNAME} ${password}=${OPENBMC_PASSWORD}
+
+ # Description of argument(s):
+ # username The username to be used for login.
+ # password The password to be used for login.
+
+ Go To ${obmc_gui_url}
+ Wait Until Element Is Enabled ${xpath_textbox_username}
+ Input Text ${xpath_textbox_username} ${username}
+ Input Password ${xpath_textbox_password} ${password}
+ Click Element ${xpath_login_button}
+ Wait Until Page Contains Overview timeout=30s
+
+
+Logout GUI
+ [Documentation] Logout of OpenBMC GUI.
+
+ Click Element ${xpath_logout_button}
+ Wait Until Page Contains Element ${xpath_login_button}