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