blob: bfba9ab11699de0eeaf67dc47e2406b0b500008b [file] [log] [blame]
Sathyajith M Se6956c02017-08-16 01:50:17 -05001*** Settings ***
2Documentation This is a resource file of OpenBMC ASMI It contains the
3... user-defined keywords which are available to all gui modules
4
5Library String
6Library Collections
7Library DateTime
8Library XvfbRobot
9Library OperatingSystem
10Library Selenium2Library 120 120
11Library AngularJSLibrary
12Library SSHLibrary 30 Seconds
13Library Process
14Library supporting_libs.py
15Library ../../../lib/gen_print.py
16Library ../../../lib/gen_robot_print.py
17Library ../../../lib/gen_valid.py
18Library ../../../lib/gen_robot_ssh.py
19Library ../../../lib/bmc_ssh_utils.py
20Resource ../../../lib/resource.txt
21Variables ../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 ***
30Launch 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
39Get 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
50Launch 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
56Launch 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
63OpenBMC 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
69Login 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
82LogOut 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
88OpenBMC 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