Sathyajith M S | e6956c0 | 2017-08-16 01:50:17 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This is a resource file of OpenBMC ASMI It contains the |
| 3 | ... user-defined keywords which are available to all gui modules |
| 4 | |
| 5 | Library String |
| 6 | Library Collections |
| 7 | Library DateTime |
| 8 | Library XvfbRobot |
| 9 | Library OperatingSystem |
| 10 | Library Selenium2Library 120 120 |
| 11 | Library AngularJSLibrary |
| 12 | Library SSHLibrary 30 Seconds |
| 13 | Library Process |
| 14 | Library supporting_libs.py |
| 15 | Library ../../../lib/gen_print.py |
| 16 | Library ../../../lib/gen_robot_print.py |
| 17 | Library ../../../lib/gen_valid.py |
| 18 | Library ../../../lib/gen_robot_ssh.py |
| 19 | Library ../../../lib/bmc_ssh_utils.py |
| 20 | Resource ../../../lib/resource.txt |
| 21 | Variables ../data/resource_variables.py |
| 22 | |
| 23 | *** Variables *** |
| 24 | # TO Do: Change the variable once the code finally switches to the OpenBMC. |
| 25 | ${obmc_gui_url} https://openbmc-test.mybluemix.net/#/login |
| 26 | # Default Browser. |
| 27 | ${default_browser} chrome |
| 28 | |
| 29 | *** Keywords *** |
| 30 | Launch OpenBMC GUI Browser |
| 31 | [Documentation] Launch the OpenBMC GUI URL on a browser. |
| 32 | # By default uses headless mode, otherwise, the GUI browser. |
| 33 | ${op_system}= Get Operating System |
| 34 | Run Keyword If '${op_system}' == 'windows' |
| 35 | ... Launch Browser in Windows Platform |
| 36 | ... ELSE |
| 37 | ... Launch Headless Browser |
| 38 | |
| 39 | Get Operating System |
| 40 | [Documentation] Identify platform/OS. |
| 41 | ${curdir_lower_case}= Convert To Lowercase ${CURDIR} |
| 42 | ${windows_platform}= Run Keyword And Return Status |
| 43 | ... Should Contain ${curdir_lower_case} c:\ |
| 44 | ${op_system}= Run Keyword If '${windows_platform}' == 'True' |
| 45 | ... Set Variable windows |
| 46 | ... ELSE |
| 47 | ... Set Variable linux |
| 48 | [Return] ${op_system} |
| 49 | |
| 50 | Launch Browser in Windows Platform |
| 51 | [Documentation] Open the browse with the URL and login on windows platform. |
| 52 | ${BROWSER_ID}= Open Browser ${obmc_gui_url} ${default_browser} |
| 53 | Maximize Browser Window |
| 54 | Set Global Variable ${BROWSER_ID} |
| 55 | |
| 56 | Launch Headless Browser |
| 57 | [Documentation] Launch headless browser. |
| 58 | Start Virtual Display 1920 1080 |
| 59 | ${BROWSER_ID}= Open Browser ${obmc_gui_url} |
| 60 | Set Global Variable ${BROWSER_ID} |
| 61 | Set Window Size 1920 1080 |
| 62 | |
| 63 | OpenBMC Test Setup |
| 64 | [Documentation] Verify all the preconditions to be tested. |
| 65 | Rprint Timen ${TEST NAME}:${TESTDOCUMENTATION} ==> [STARTED] |
| 66 | Print Dashes 0 100 1 = |
| 67 | Login OpenBMC GUI |
| 68 | |
| 69 | Login OpenBMC GUI |
| 70 | [Documentation] Perform login to open BMC GUI. |
| 71 | [Arguments] ${username}=${OPENBMC_USERNAME} |
| 72 | ... ${password}=${OPENBMC_PASSWORD} |
| 73 | # Description of argument(s): |
| 74 | # username The username. |
| 75 | # password The password. |
| 76 | Go To ${obmc_gui_url} |
| 77 | Input Text ${xpath_textbox_username} ${username} |
| 78 | Input Password ${xpath_textbox_password} ${password} |
| 79 | Click Button ${xpath_button_login} |
| 80 | Wait Until Element Is Enabled ${xpath_button_logout} |
| 81 | |
| 82 | LogOut OpenBMC GUI |
| 83 | [Documentation] Log out of OpenBMC GUI. |
| 84 | SSHLibrary.Close All Connections |
| 85 | click button ${xpath_button_logout} |
| 86 | Wait Until Page Contains Element ${xpath_button_login} |
| 87 | |
| 88 | OpenBMC Test Closure |
| 89 | [Documentation] Do final closure activities of test case execution. |
| 90 | Rprint Pgm Footer |
| 91 | Print Dashes 0 100 1 = |
| 92 | LogOut OpenBMC GUI |
| 93 | |