xref: /openbmc/openbmc-test-automation/gui/gui_test/overview_menu/test_overview_menu.robot (revision 6d584dea6322b204bd445d6b54d55e29a790cf94)
1*** Settings ***
2
3Documentation  Test OpenBMC GUI "Overview" menu.
4
5Resource        ../../lib/resource.robot
6Resource        ../../../lib/logging_utils.robot
7Resource        ../../../lib/list_utils.robot
8Resource        ../../../lib/bmc_network_utils.robot
9
10Library         String
11
12Suite Setup     Launch Browser And Login GUI
13Suite Teardown  Close Browser
14Test Setup      Test Setup Execution
15
16
17*** Variables ***
18
19${xpath_overview_page_header}          //h1[contains(text(), "Overview")]
20${xpath_edit_network_settings_button}  //*[@data-test-id='overviewQuickLinks-button-networkSettings']
21${view_all_event_logs}                 //*[@data-test-id='overviewEvents-button-eventLogs']
22
23*** Test Cases ***
24
25Verify Existence Of All Sections In Overview Page
26    [Documentation]  Verify existence of all sections in Overview page.
27    [Tags]  Verify_Existence_Of_All_Sections_In_Overview_Page
28
29    Page Should Contain  BMC information
30    Page Should Contain  Server information
31    Page Should Contain  Network information
32    Page Should Contain  Power consumption
33    Page Should Contain  High priority events
34
35
36Verify Message In High Priority Events Section For No Events
37    [Documentation]  Verify message under high priority events section in case of no events.
38    [Tags]  Verify_Message_In_High_Priority_Events_Section_For_No_Events
39
40    Redfish Purge Event Log
41    Click Element  ${xpath_refresh_button}
42    Wait Until Page Contains  no high priority events to display  timeout=10
43
44
45Verify Network Information In Overview Page
46    [Documentation]  Verify values under network information section.
47    [Tags]  Verify_Network_Information_In_Overview Page
48
49    ${hostname}=  Get BMC Hostname
50    Page Should Contain  ${hostname}
51
52    # Get all IP addresses and prefix lengths on system.
53
54    ${ip_addr_list}=  Get BMC IP Info
55    FOR  ${ip_address}  IN  @{ip_addr_list}
56      ${ip}=  Fetch From Left  ${ip_address}  \/
57      Page Should Contain  ${ip}
58    END
59
60    ${macaddr}=  Get BMC MAC Address
61    Page Should Contain  ${macaddr}
62
63
64Verify Message In High Priority Events Section For No Events
65    [Documentation]  Verify message under high priority events section in case of no events.
66    [Tags]  Verify_Message_In_High_Priority_Events_Section_For_No_Events
67
68    Redfish Purge Event Log
69    Click Element  ${xpath_refresh_button}
70    Wait Until Page Contains  no high priority events to display  timeout=10
71
72
73Verify Server Information Section
74    [Documentation]  Verify values under server information section in overview page.
75    [Tags]  Verify_Server_Information_Section
76
77    ${redfish_machine_model}=  Redfish.Get Attribute  /redfish/v1/Systems/system/  Model
78    Page Should Contain  ${redfish_machine_model}
79
80    ${redfish_serial_number}=  Redfish.Get Attribute  /redfish/v1/Systems/system/  SerialNumber
81    Page Should Contain  ${redfish_serial_number}
82
83    ${redfish_motherboard_manufacturer}=  Redfish.Get Attribute
84    ...  ${REDFISH_CHASSIS_URI}motherboard  Manufacturer
85
86    Page Should Contain  ${redfish_motherboard_manufacturer}
87
88
89Verify BMC Information Section
90    [Documentation]  Verify BMC information section in overview page.
91    [Tags]  Verify_BMC_Information_Section
92
93    ${firmware_version}=  Redfish Get BMC Version
94    Page Should Contain  ${firmware_version}
95
96
97Verify Edit Network Setting Button
98    [Documentation]  Verify navigation to network setting page after clicking the button in overview page.
99    [Tags]  Verify_Edit_Network_Setting_Button
100
101    Click Element  ${xpath_edit_network_settings_button}
102    Wait Until Page Contains Element  ${xpath_network_page_header}
103
104
105Verify Event Under High Priority Events Section
106    [Documentation]  Verify event under high priority events section in case of any event.
107    [Tags]  Verify_Event_Under_High_Priority_Events_Section
108
109    Redfish Purge Event Log
110    Click Element  ${xpath_refresh_button}
111    Generate Test Error Log
112    Wait Until Page Contains  xyz.openbmc_project.Common.Error.InternalFailure  timeout=30s
113
114
115Verify View All Event Logs Button
116    [Documentation]  Verify view all event log button in overview page.
117    [Tags]  Verify_View_All_Event_Logs_Button
118
119    Generate Test Error Log
120    Page Should Contain Element  ${view_all_event_logs}  timeout=30
121    Click Element  ${view_all_event_logs}
122    Wait Until Page Contains Element  ${xpath_event_header}  timeout=30
123
124
125*** Keywords ***
126
127Test Setup Execution
128    [Documentation]  Do test case setup tasks.
129
130    Click Element  ${xpath_overview_menu}
131    Wait Until Page Contains Element  ${xpath_overview_page_header}
132
133