1*** Settings ***
2
3Documentation   Test suite for OpenBMC GUI "Factory reset" sub-menu of "Settings" menu.
4
5Resource        ../../lib/gui_resource.robot
6
7Suite Setup     Suite Setup Execution
8Suite Teardown  Close Browser
9
10Test Tags      Factory_Reset_Sub_Menu
11
12*** Variables ***
13
14${xpath_factory_reset_heading}          //h1[text()="Factory reset"]
15${xpath_reset_button}                   //button[contains(text(),'Reset')]
16${xpath_reset_server_radio_button}      //*[@data-test-id='factoryReset-radio-resetBios']
17${xpath_reset_bmc_server_radio_button}  //*[@data-test-id='factoryReset-radio-resetToDefaults']
18
19
20*** Test Cases ***
21
22Verify Navigation To Factory Reset Page
23    [Documentation]  Verify navigation to factory reset page.
24    [Tags]  Verify_Navigation_To_Factory_Reset_Page
25
26    Page Should Contain Element  ${xpath_factory_reset_heading}
27
28
29Verify Existence Of All Sections In Factory Reset Page
30    [Documentation]  Verify existence of all sections in factory reset page.
31    [Tags]  Verify_Existence_Of_All_Sections_In_Factory_Reset_Page
32
33    Page Should Contain  Reset options
34
35
36Verify Existence Of All Buttons In Factory Reset Page
37    [Documentation]  Verify existence of all buttons in factory reset page.
38    [Tags]  Verify_Existence_Of_All_Buttons_In_Factory_Reset_Page
39
40    Page Should Contain Element  ${xpath_reset_button}
41
42
43Verify Existence Of All Radio Buttons In Factory Reset Page
44     [Documentation]  Verify existence of all radio buttons in factory reset page.
45     [Tags]  Verify_Existence_Of_All_Radio_Buttons_In_Factory_Reset_Page
46
47     Page Should Contain Element  ${xpath_reset_server_radio_button}
48     Page Should Contain Element  ${xpath_reset_bmc_server_radio_button}
49
50
51*** Keywords ***
52
53Suite Setup Execution
54    [Documentation]  Do test suite setup tasks.
55
56    Launch Browser And Login GUI
57    Click Element  ${xpath_settings_menu}
58    Click Element  ${xpath_factory_reset_sub_menu}
59    Wait Until Keyword Succeeds  30 sec  5 sec  Location Should Contain  factory-reset
60    Wait Until Element Is Not Visible   ${xpath_page_loading_progress_bar}  timeout=30
61