1*** Settings ***
2
3Documentation  Test OpenBMC GUI "Power restore policy" sub-menu of "Settings" menu.
4
5Resource        ../../lib/gui_resource.robot
6
7Suite Setup      Launch Browser And Login GUI
8Suite Teardown   Close Browser
9Test Setup       Test Setup Execution
10
11
12*** Variables ***
13
14${xpath_power_restore_policy_heading}  //h1[text()="Power restore policy"]
15${xpath_AlwaysOn_radio}                //input[@value='AlwaysOn']
16${xpath_AlwaysOff_radio}               //input[@value='AlwaysOff']
17${xpath_LastState_radio}               //input[@value='LastState']
18${xpath_save_settings_button}          //button[contains(text(),'Save settings')]
19
20*** Test Cases ***
21
22Verify Navigation To Power Restore Policy Page
23    [Documentation]  Verify navigation to Power Restore Policy page.
24    [Tags]  Verify_Navigation_To_Power_Restore_Policy_Page
25
26    Page Should Contain Element  ${xpath_power_restore_policy_heading}
27
28
29Verify Existence Of All Sections In Power Restore Policy Page
30    [Documentation]  Verify existence of all sections in Power Restore Policy page.
31    [Tags]  Verify_Existence_Of_All_Sections_In_Power_Restore_Policy_Page
32
33    Page Should Contain  Power restore policies
34
35
36Verify Existence Of All Buttons In Power Restore Policy Page
37    [Documentation]  Verify existence of All Buttons.
38    [Tags]  Verify_Existence_Of_All_Buttons_In_Power_Restore_Policy_Page
39
40    Page Should Contain Element  ${xpath_AlwaysOn_radio}
41    Page Should Contain Element  ${xpath_AlwaysOff_radio}
42    Page Should Contain Element  ${xpath_LastState_radio}
43    Page Should Contain Element  ${xpath_save_settings_button}
44
45
46*** Keywords ***
47
48Test Setup Execution
49    [Documentation]  Do test case setup tasks.
50
51    Click Element  ${xpath_settings_menu}
52    Click Element  ${xpath_power_restore_policy_sub_menu}
53    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  power-restore-policy
54    Wait Until Element Is Not Visible   ${xpath_page_loading_progress_bar}  timeout=30
55