141747da7SRahul Maheshwari*** Settings *** 241747da7SRahul MaheshwariDocumentation This is a resource file containing user-defined keywords for new Vue based OpenBMC GUI. 341747da7SRahul Maheshwari 441747da7SRahul MaheshwariLibrary XvfbRobot 541747da7SRahul MaheshwariLibrary SeleniumLibrary 641747da7SRahul MaheshwariLibrary SSHLibrary 30 Seconds 741747da7SRahul MaheshwariResource ../../lib/state_manager.robot 841747da7SRahul MaheshwariVariables ../data/gui_variables.py 941747da7SRahul Maheshwari 1041747da7SRahul Maheshwari 1141747da7SRahul Maheshwari*** Variables *** 1241747da7SRahul Maheshwari${obmc_gui_url} https://${OPENBMC_HOST} 1341747da7SRahul Maheshwari 144d4ef99fSGeorge Keishing# Default GUI browser and mode is set to "Firefox" and "headless" 1541747da7SRahul Maheshwari# respectively here. 1641747da7SRahul Maheshwari${GUI_BROWSER} ff 1741747da7SRahul Maheshwari${GUI_MODE} headless 1841747da7SRahul Maheshwari 1941747da7SRahul Maheshwari${CMD_INTERNAL_FAILURE} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging 2041747da7SRahul Maheshwari... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.InternalFailure 2141747da7SRahul Maheshwari... xyz.openbmc_project.Logging.Entry.Level.Error 0 2241747da7SRahul Maheshwari 2341747da7SRahul Maheshwari 2441747da7SRahul Maheshwari*** Keywords *** 2541747da7SRahul Maheshwari 2641747da7SRahul MaheshwariOpen Browser With URL 2741747da7SRahul Maheshwari [Documentation] Open browser with specified URL and returns browser id. 2841747da7SRahul Maheshwari [Arguments] ${URL} ${browser}=ff ${mode}=${GUI_MODE} 2941747da7SRahul Maheshwari 3041747da7SRahul Maheshwari # Description of argument(s): 3141747da7SRahul Maheshwari # URL Openbmc GUI URL to be open 3241747da7SRahul Maheshwari # (e.g. https://openbmc-test.mybluemix.net/#/login). 3341747da7SRahul Maheshwari # browser Browser used to open above URL 3441747da7SRahul Maheshwari # (e.g. gc for google chrome, ff for firefox). 3541747da7SRahul Maheshwari # mode Browser opening mode(e.g. headless, header). 3641747da7SRahul Maheshwari 3741747da7SRahul Maheshwari ${browser_ID}= Run Keyword If '${mode}' == 'headless' 3841747da7SRahul Maheshwari ... Launch Headless Browser ${URL} ${browser} 3941747da7SRahul Maheshwari ... ELSE Open Browser ${URL} ${browser} 4041747da7SRahul Maheshwari 4141747da7SRahul Maheshwari [Return] ${browser_ID} 4241747da7SRahul Maheshwari 4341747da7SRahul Maheshwari 4441747da7SRahul MaheshwariLaunch Header Browser 4541747da7SRahul Maheshwari [Documentation] Open the browser with the URL and 4641747da7SRahul Maheshwari ... login on windows platform. 4741747da7SRahul Maheshwari [Arguments] ${browser_type}=${GUI_BROWSER} 4841747da7SRahul Maheshwari 4941747da7SRahul Maheshwari # Description of argument(s): 5041747da7SRahul Maheshwari # browser_type Type of browser (e.g. "firefox", "chrome", etc.). 5141747da7SRahul Maheshwari 5241747da7SRahul Maheshwari ${BROWSER_ID}= Open Browser ${obmc_gui_url} ${browser_type} 5341747da7SRahul Maheshwari Maximize Browser Window 5441747da7SRahul Maheshwari Set Global Variable ${BROWSER_ID} 5541747da7SRahul Maheshwari 5641747da7SRahul Maheshwari 5741747da7SRahul MaheshwariLaunch Headless Browser 5841747da7SRahul Maheshwari [Documentation] Launch headless browser. 5941747da7SRahul Maheshwari [Arguments] ${URL}=${obmc_gui_url} ${browser}=${GUI_BROWSER} 6041747da7SRahul Maheshwari 6141747da7SRahul Maheshwari # Description of argument(s): 6241747da7SRahul Maheshwari # URL Openbmc GUI URL to be open 6341747da7SRahul Maheshwari # (e.g. https://openbmc-test.mybluemix.net/#/login). 6441747da7SRahul Maheshwari # browser Browser to open given URL in headless way 6541747da7SRahul Maheshwari # (e.g. gc for google chrome, ff for firefox). 6641747da7SRahul Maheshwari 6741747da7SRahul Maheshwari Start Virtual Display 6841747da7SRahul Maheshwari ${browser_ID}= Open Browser ${URL} 6941747da7SRahul Maheshwari Set Window Size 1920 1080 7041747da7SRahul Maheshwari 7141747da7SRahul Maheshwari [Return] ${browser_ID} 7241747da7SRahul Maheshwari 7341747da7SRahul Maheshwari 7441747da7SRahul MaheshwariLaunch Browser And Login GUI 7541747da7SRahul Maheshwari [Documentation] Launch browser and login to OpenBMC GUI. 7641747da7SRahul Maheshwari 7741747da7SRahul Maheshwari Open Browser With URL ${obmc_gui_url} 7841747da7SRahul Maheshwari Login GUI ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} 7941747da7SRahul Maheshwari 8041747da7SRahul Maheshwari 8141747da7SRahul MaheshwariLogin GUI 8241747da7SRahul Maheshwari [Documentation] Login to OpenBMC GUI. 8341747da7SRahul Maheshwari [Arguments] ${username}=${OPENBMC_USERNAME} ${password}=${OPENBMC_PASSWORD} 8441747da7SRahul Maheshwari 8541747da7SRahul Maheshwari # Description of argument(s): 8641747da7SRahul Maheshwari # username The username to be used for login. 8741747da7SRahul Maheshwari # password The password to be used for login. 8841747da7SRahul Maheshwari 8941747da7SRahul Maheshwari Go To ${obmc_gui_url} 9041747da7SRahul Maheshwari Wait Until Element Is Enabled ${xpath_textbox_username} 9141747da7SRahul Maheshwari Input Text ${xpath_textbox_username} ${username} 9241747da7SRahul Maheshwari Input Password ${xpath_textbox_password} ${password} 9341747da7SRahul Maheshwari Click Element ${xpath_login_button} 94*7ae30a48SRahul Maheshwari Wait Until Page Contains Overview timeout=60s 9541747da7SRahul Maheshwari 9641747da7SRahul Maheshwari 9741747da7SRahul MaheshwariLogout GUI 9841747da7SRahul Maheshwari [Documentation] Logout of OpenBMC GUI. 9941747da7SRahul Maheshwari 10041747da7SRahul Maheshwari Click Element ${xpath_logout_button} 10141747da7SRahul Maheshwari Wait Until Page Contains Element ${xpath_login_button} 10241747da7SRahul Maheshwari 10341747da7SRahul Maheshwari 10441747da7SRahul MaheshwariGenerate Test Error Log 10541747da7SRahul Maheshwari [Documentation] Generate test error log. 10641747da7SRahul Maheshwari 10741747da7SRahul Maheshwari BMC Execute Command ${CMD_INTERNAL_FAILURE} 10854edcbcfSAnusha Dathatri 10954edcbcfSAnusha Dathatri 11054edcbcfSAnusha DathatriSet Timezone In Profile Settings Page 11154edcbcfSAnusha Dathatri [Documentation] Set the given timezone in profile settings page. 11254edcbcfSAnusha Dathatri [Arguments] ${timezone}=Default 11354edcbcfSAnusha Dathatri 11454edcbcfSAnusha Dathatri # Description of argument(s): 11554edcbcfSAnusha Dathatri # timezone Timezone to select (eg. Default or Browser_offset). 11654edcbcfSAnusha Dathatri 11754edcbcfSAnusha Dathatri Wait Until Page Contains Element ${xpath_root_button_menu} 11854edcbcfSAnusha Dathatri Click Element ${xpath_root_button_menu} 11954edcbcfSAnusha Dathatri Click Element ${xpath_profile_settings} 12054edcbcfSAnusha Dathatri Click Element At Coordinates ${xpath_default_UTC} 0 0 12154edcbcfSAnusha Dathatri Click Element ${xpath_profile_save_button} 122