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