1*** Settings ***
2
3Documentation  Test OpenBMC GUI "Reboot BMC" sub-menu of "Operation" menu.
4
5Resource        ../../lib/gui_resource.robot
6Resource        ../../../lib/common_utils.robot
7
8Suite Setup     Launch Browser And Login GUI
9Suite Teardown  Close Browser
10Test Setup      Test Setup Execution
11
12Test Tags      Reboot_BMC_Sub_Menu
13
14*** Variables ***
15
16${xpath_reboot_bmc_heading}      //h1[text()="Reboot BMC"]
17${xpath_reboot_bmc_button}       //button[contains(text(),'Reboot BMC')]
18${xpath_reboot_cancel_button}    //button[contains(text(),'Cancel')]
19
20
21*** Test Cases ***
22
23Verify Navigation To Reboot BMC Page
24    [Documentation]  Verify navigation to reboot BMC page.
25    [Tags]  Verify_Navigation_To_Reboot_BMC_Page
26
27    Page Should Contain Element  ${xpath_reboot_bmc_heading}
28
29
30Verify Existence Of All Buttons In Reboot BMC Page
31    [Documentation]  Verify existence of all buttons in reboot BMC page.
32    [Tags]  Verify_Existence_Of_All_Buttons_In_Reboot_BMC_Page
33
34    Page Should Contain Element  ${xpath_reboot_bmc_button}
35
36
37Verify Existence Of All Sections In Reboot BMC Page
38    [Documentation]  Verify Existence Of All Sections In Reboot BMC Page.
39    [Tags]  Verify_Existence_Of_All_Sections_In_Reboot_BMC_Page
40
41    Page Should Contain  Last BMC reboot
42
43
44Verify Canceling Operation On BMC Reboot Operation
45    [Documentation]  Verify Canceling Operation On BMC Reboot operation
46    [Tags]  Verify_Canceling_Operation_On_BMC_Reboot_Operation
47
48    Click Element  ${xpath_reboot_bmc_button}
49
50    # Delay added for cancel button to appear.
51    Sleep  5s
52
53    Click Element At Coordinates  ${xpath_reboot_cancel_button}  0  0
54    Wait Until Element Is Not Visible  ${xpath_reboot_cancel_button}  timeout=15
55
56
57Verify BMC Reboot Operation
58    [Documentation]  Verify BMC Reboot operation
59    [Tags]  Verify_BMC_Reboot_Operation
60
61    Click Element  ${xpath_reboot_bmc_button}
62
63    # Delay added for confirm button to appear.
64    Sleep  5s
65    Click Element At Coordinates  ${xpath_confirm_button}  0  0
66
67    # Checks BMC gets into Unpingable state and later becomes Pingable.
68    Wait Until Keyword Succeeds  1 min  5 sec  Is BMC Unpingable
69    Wait For Host To Ping  ${OPENBMC_HOST}  1 min
70
71    Wait Until Keyword Succeeds  3 min  10 sec  Is BMC Operational
72
73    Click Element  ${xpath_refresh_button}
74    Wait Until Element Is Visible  ${xpath_reboot_bmc_button}  timeout=10
75
76
77*** Keywords ***
78
79Test Setup Execution
80    [Documentation]  Do test case setup tasks.
81
82    Click Element  ${xpath_operations_menu}
83    Click Element  ${xpath_reboot_bmc_sub_menu}
84    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  reboot-bmc
85    Wait Until Element Is Not Visible   ${xpath_page_loading_progress_bar}  timeout=30
86