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
21*** Test Cases ***
22
23Verify Navigation To Power Restore Policy Page
24    [Documentation]  Verify navigation to Power Restore Policy page.
25    [Tags]  Verify_Navigation_To_Power_Restore_Policy_Page
26
27    Page Should Contain Element  ${xpath_power_restore_policy_heading}
28
29
30Verify Existence Of All Sections In Power Restore Policy Page
31    [Documentation]  Verify existence of all sections in Power Restore Policy page.
32    [Tags]  Verify_Existence_Of_All_Sections_In_Power_Restore_Policy_Page
33
34    Page Should Contain  Power restore policies
35
36
37Verify Existence Of All Buttons In Power Restore Policy Page
38    [Documentation]  Verify existence of All Buttons.
39    [Tags]  Verify_Existence_Of_All_Buttons_In_Power_Restore_Policy_Page
40
41    Page Should Contain Element  ${xpath_AlwaysOn_radio}
42    Page Should Contain Element  ${xpath_AlwaysOff_radio}
43    Page Should Contain Element  ${xpath_LastState_radio}
44    Page Should Contain Element  ${xpath_save_settings_button}
45
46
47*** Keywords ***
48
49Test Setup Execution
50    [Documentation]  Do test case setup tasks.
51
52    Click Element  ${xpath_settings_menu}
53    Click Element  ${xpath_power_restore_policy_sub_menu}
54    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  power-restore-policy
55