1*** Settings ***
2
3Documentation  Test OpenBMC Firmware Update" sub menu of "Operations".
4
5Resource        ../../lib/gui_resource.robot
6
7Suite Setup     Suite Setup Execution
8Suite Teardown  Close Browser
9
10*** Variables ***
11
12${xpath_firmware_heading}                //h1[text()="Firmware"]
13${xpath_add_file_button}                 //*[@id='image-file']
14${xpath_start_update_button}             //*[@data-test-id="firmware-button-startUpdate"]
15${xpath_switch_to_running}               //*[@data-test-id="firmware-button-switchToRunning"]
16
17*** Test Cases ***
18
19Verify Navigation To Firmware Page
20    [Documentation]  Verify navigation to firmware page.
21    [Tags]  Verify_Navigation_To_Firmware_Page
22
23    Page Should Contain Element  ${xpath_firmware_heading}
24
25
26Verify Existence Of All Sections In Firmware Page
27    [Documentation]  Verify existence of all sections in firmware page.
28    [Tags]  Verify_Existence_Of_All_Sections_In_Firmware_Page
29
30    Page Should Contain  BMC and server
31    Page Should Contain  Update firmware
32    Page Should Contain  Access key expiration
33
34
35Verify Existence Of All Buttons In Firmware Page At Host Power Off
36    [Documentation]  Verify existence of all buttons in firmware page at host power off.
37    [Tags]  Verify_Existence_Of_All_Buttons_In_Firmware_Page_At_Host_Power_Off
38
39    Redfish Power Off  stack_mode=skip
40
41    Page Should Contain Element  ${xpath_add_file_button}
42    Page Should Contain Element  ${xpath_start_update_button}
43
44
45Verify Existence Of All Sub Sections Under BMC And Server Section At Poweroff State
46    [Documentation]  Verify existence of all sub sections under BMC and server section at poweroff state.
47    [Tags]  Verify_Existence_Of_All_Sub_Sections_Under_BMC_And_Server_Section_At_Poweroff_State
48
49    Redfish Power Off  stack_mode=skip  quiet=1
50
51    Page Should Contain  Running image
52    Page Should Contain  Backup image
53    Page Should Contain  Temporary
54    Page Should Contain  Permanent
55    Element Should Be Visible  ${xpath_switch_to_running}
56
57
58Verify Existence Of All Buttons In Firmware Page At Host Power On
59    [Documentation]  Verify existence of all buttons in firmware page at host power on.
60    [Tags]  Verify_Existence_Of_All_Buttons_In_Firmware_Page_At_Host_Power_On
61
62    Redfish Power On  stack_mode=skip
63
64    Element Should Be Disabled  ${xpath_add_file_button}
65    Element Should Be Disabled  ${xpath_start_update_button}
66
67
68*** Keywords ***
69
70Suite Setup Execution
71   [Documentation]  Do test case setup tasks.
72
73    Launch Browser And Login GUI
74    Click Element  ${xpath_operations_menu}
75    Click Element  ${xpath_firmware_update_sub_menu}
76    Wait Until Keyword Succeeds  30 sec  10 sec  Location Should Contain  firmware
77    Wait Until Element Is Not Visible   ${xpath_page_loading_progress_bar}  timeout=30
78