1*** Settings ***
2
3Documentation  Test OpenBMC GUI "Hardware status" sub-menu  of "Server health".
4
5Resource        ../../lib/resource.robot
6
7Suite Setup     Launch Browser And Login OpenBMC GUI
8Suite Teardown  Close Browser
9Test Setup      Test Setup Execution
10
11*** Variables ***
12
13${xpath_select_server_health}  //*[@id="nav__top-level"]/li[2]/button
14${xpath_select_hardware_status}  //a[@href='#/server-health/inventory-overview']
15${xpath_inventory_export}  //a[contains(text(), "Export")]
16${xpath_inventory_search}  //*[@id="content__search-input"]
17${xpath_inventory_search_button}  //*[@id="content__search-submit"]
18${xpath_inventory_search_text_clear}  //button[@class='clear-input']
19${xpath_bmc_expand}  //*[text()="bmc"]//following::button[1]
20${xpath_system_expand}  //*[text()="system"]//following::button[1]
21${xpath_motherboard_expand}  //*[text()="motherboard"]//following::button[1]
22${xpath_chassis_expand}  //*[text()="chassis"]//following::button[1]
23
24*** Test Cases ***
25
26Verify Select Health Status From Server Health
27    [Documentation]  Verify ability to select "Hardware status" sub-menu option
28    ...  of "Server health".
29    [Tags]  Verify_Select_Health_Status_From_Server_Health
30
31    Wait Until Page Contains  Hardware status
32    Page should contain  All hardware in the system
33
34
35Verify Inventory Export From Server Health Clickable
36    [Documentation]  Verify ability to export inventory from "Hardware status"
37    ...  sub-menu.
38    [Tags]  Verify_Inventory_Export_From_Server_Health_Clickable
39
40    Page Should Contain Element  ${xpath_inventory_export}
41    Click Element  ${xpath_inventory_export}
42
43
44Verify Search Text Enterable
45    [Documentation]  Verify search text input allowed from "Hardware status"
46    ...  sub-menu.
47    [Tags]  Verify_Search_Text_Enterable
48
49    Page Should Contain Element  ${xpath_inventory_search}
50    Input Text  ${xpath_inventory_search}  fan
51    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
52    Page Should Contain Element  ${xpath_inventory_search_button}
53    Click Element  ${xpath_inventory_search_button}
54
55
56Verify Search Text Clearable
57    [Documentation]  Verify search text allowed to clear from "Hardware status"
58    ...  sub-menu.
59    [Tags]  Verify_Search_Text_Clearable
60
61    Page Should Contain Element  ${xpath_inventory_search}
62    Input Text  ${xpath_inventory_search}  fan
63    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
64    Page Should Contain Element  ${xpath_inventory_search_text_clear}
65    Click Element  ${xpath_inventory_search_text_clear}
66
67
68Verify System Inventory Expand
69    [Documentation]  Verify system inventory icon expandable from
70    ...  "Hardware status" sub-menu.
71    [Tags]  Verify_System_Inventory_Expand
72    [Template]  Verify Hardware Inventory Expand
73
74    # xpath_hardware_item
75    ${xpath_system_expand}
76    ${xpath_chassis_expand}
77    ${xpath_motherboard_expand}
78    ${xpath_bmc_expand}
79
80*** Keywords ***
81
82Test Setup Execution
83   [Documentation]  Do test case setup tasks.
84
85    Click Element  ${xpath_select_server_health}
86    Wait Until Page Does Not Contain Element  ${xpath_refresh_circle}
87    Click Element  ${xpath_select_hardware_status}
88
89
90Verify Hardware Inventory Expand
91   [Documentation]  Verify expand individual hardware inventory item.
92   [Arguments]  ${xpath_hardware_item}
93
94   # Description of argument(s):
95   # xpath_hardware_item    Hardware inventory item to be expand. e.g. fan.
96
97   Page Should Contain Element  ${xpath_hardware_item}
98   Click Button  ${xpath_hardware_item}
99