xref: /openbmc/openbmc-test-automation/gui/test/server_overview/test_obmc_gui_server_overview.robot (revision b2a2d948d555cb6e5169b9f21d489a3b089b4387)
1*** Settings ***
2Documentation  This test suite will validate the "OpenBMC ASMI Menu ->
3...            Server Overview" module.
4
5Resource         ../../lib/resource.robot
6Resource         ../lib/bmc_network_utils.robot
7Test Setup       Test Setup Execution  ${OBMC_PowerOff_state}
8Test Teardown    Test Teardown Execution
9
10Test Tags        OBMC_GUI_Server_Overview
11
12*** Variables ***
13${xpath_select_overview_1}         //*[@href="#/overview/server"]
14${string_content}                  witherspoon
15${string_server_info}              Server information
16${string_high_priority_events}     High priority events
17${string_BMC_info}                 BMC information
18${string_power_info}               Power Consumption
19${xpath_high_priority_events}      //a[@href='#/server-health/event-log']
20${string_event_log}                Event log
21${xpath_launch_serial_over_lan}    //a[@class='no-icon quick-links__item']
22${string_launch_serial_over_lan}   Serial over LAN console
23
24*** Test Cases ***
25# OpenBMC @ Power Off state test cases.
26
27Verify Serial Over LAN Button
28    [Documentation]  Verify console page on clicking serial over lan console button
29    [Tags]  Verify_Serial_Over_LAN_Button
30
31    Select Server Overview Menu
32    Click Element  ${xpath_launch_serial_over_lan}
33    Verify Display Content  Access the Serial over LAN console
34
35Verify Title Text Content At OBMC Power Off State
36    [Documentation]  Verify display of title text from "Server Overview"
37    ...  module of OpenBMC GUI.
38    [Tags]  Verify_Title_Text_Content_At_OBMC_Power_Off_State
39    ...  OBMC_PowerOff_state
40
41    Select Server Overview Menu
42    Verify Display Content  ${string_content}
43
44Verify Display Text Server Information At OBMC Power Off State
45    [Documentation]  Verify existence of text "Server information".
46    [Tags]  Verify_Display_Text_Server_Information_At_OBMC_Power_Off_State
47    ...  OBMC_PowerOff_state
48
49    Select Server Overview Menu
50    Verify Display Content  ${string_server_info}
51
52Verify BMC Information Should Display At OBMC Power Off State
53    [Documentation]  Verify existence of text "BMC information".
54    [Tags]  Verify_BMC_Information_Should_Display_At_OBMC_Power_Off_State
55    ...  OBMC_PowerOff_State
56
57    Select Server Overview Menu
58    Verify Display Content  ${string_BMC_info}
59
60Verify Power Consumption Should Display At OBMC Power Off State
61    [Documentation]  Verify existence of text "Power Consumption".
62    [Tags]  Verify_Power_Consumption_Should_Display_At_OBMC_Power_Off_State
63    ...  OBMC_PowerOff_State
64
65    Select Server Overview Menu
66    Verify Display Content  ${string_power_info}
67
68Verify High Priority Events Should Display At OBMC Power Off State
69    [Documentation]  Verify the text display.
70    [Tags]  Verify_High_Priority_Events_Should_Display_At_OBMC_Power_Off_State
71    ...  OBMC_PowerOff_State
72
73    Select Server Overview Menu
74    Verify Display Content  ${string_high_priority_events}
75
76Verify High Priority Events Can Be Operated At OBMC Power Off State
77    [Documentation]  Will open the "High Priority Events".
78    ...  menu to view and operate.
79    [Tags]  Verify_High_Priority_Events_Can_Be_Operated_At_OBMC_Power_Off_State
80    ...   OBMC_PowerOff_state
81
82    Select Server Overview Menu
83    Click Link  ${xpath_high_priority_events}
84    Verify Display Content  ${string_event_log}
85
86Verify Launching Of Serial Over LAN Console At OBMC Power Off State
87    [Documentation]  Will open the serial over the lan command prompt window.
88    [Tags]  Verify_Launching_Of_Serial_Over_LAN_Console_At_OBMC_Power_Off_State
89    ...  OBMC_PowerOff_State
90
91    Select Server Overview Menu
92    Click Element  ${xpath_launch_serial_over_lan}
93    Verify Display Content  ${string_launch_serial_over_lan}
94
95
96# OpenBMC @ Power Running state test cases.
97
98Verify BMC Information
99    [Documentation]  Get BMC hostname, version, IP, and MAC address via GUI and verify using REST
100    [Tags]  Verify_BMC_Information
101
102    Select Server Overview Menu
103
104    ${hostname}=  Get BMC Hostname
105    ${hostname}=  Remove String  ${hostname}  '
106    ${hostname}=  Fetch From Right  ${hostname}  :
107    Verify Display Content  ${hostname}
108
109    ${version}=  Get BMC Version
110    ${version}=  Remove String  ${version}  "
111    Verify Display Content  ${version}
112
113    ${iplist}=  Get BMC IP Info
114    FOR  ${ip}  IN  @{iplist}
115      ${ip}=  Fetch From Left  ${ip}  /
116      Verify Display Content  ${ip}
117    END
118
119    ${mac}=  Get BMC MAC Address
120    Verify Display Content  ${mac}
121
122Verify High Priority Events Can Be Operated At OBMC Power Running State
123    [Documentation]  Will open the "High Priority Events"
124    ...  menu to view and operate.
125    [Tags]  Verify_High_Priority_Events_Can_Be_Operated_At_OBMC_Power_Running_State
126    ...  OBMC_PowerRunning_state
127    [Setup]  Test Setup Execution  ${OBMC_PowerRunning_state}
128
129    Select Server Overview Menu
130    Click Link  ${xpath_high_priority_events}
131    Verify Display Content  ${string_event_log}
132
133Verify Launching Of Serial Over LAN Console At OBMC Power Running State
134    [Documentation]  Will open the serial over the lan command prompt window.
135    [Tags]  Verify_Launching_Of_Serial_Over_LAN_Console_At_OBMC_Power_Running_State
136    ...  OBMC_PowerRunning_State
137    [Setup]  Test Setup Execution  ${OBMC_PowerRunning_state}
138
139    Select Server Overview Menu
140    Click Element  ${xpath_launch_serial_over_lan}
141    Verify Display Content  ${string_launch_serial_over_lan}
142
143*** Keywords ***
144Select Server Overview Menu
145    [Documentation]  Selecting of OpenBMC "Server overview" menu.
146
147    Click Element  ${xpath_select_overview_1}
148    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
149    Page Should Contain  Server information
150
151Verify Display Content
152    [Documentation]  Verify text content display.
153    [Arguments]  ${display_text}
154    # Description of argument(s):
155    # display_text   The display text on web page.
156
157    Page Should Contain  ${display_text}
158