blob: 9abd5041e42fa081f382a02920a32e85e1f95ee3 [file] [log] [blame]
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -05001*** Settings ***
2
3Documentation Test OpenBMC GUI "Server LED" sub-menu of "Server control".
4
Rahul Maheshwari41747da2020-11-17 09:09:52 -06005Resource ../../lib/gui_resource.robot
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -05006
Sushma M Me3f510f2021-01-12 13:33:32 -06007Suite Setup Launch Browser And Login GUI
8Suite Teardown Close Browser
9Test Setup Test Setup Execution
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050010
11*** Variables ***
12
Rahul Maheshwari317c7102020-08-30 21:10:22 -050013${xpath_server_led_heading} //h1[text()="Server LED"]
Sushma M Mbd9948c2020-08-24 05:34:57 -050014${xpath_led_value} //*[@data-test-id='serverLed-checkbox-switchIndicatorLed']/following-sibling::label/span
15${xpath_overview_led_value} //*[@data-test-id='overviewQuickLinks-checkbox-serverLed']/following-sibling::label/span
Sushma M Mfc53fbb2020-08-24 03:48:39 -050016${xpath_led_toggle} //*[@data-test-id='serverLed-checkbox-switchIndicatorLed']
17
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050018
19*** Test Cases ***
20
Rahul Maheshwari317c7102020-08-30 21:10:22 -050021Verify Navigation To Server LED Page
22 [Documentation] Verify navigation to server LED page.
23 [Tags] Verify_Navigation_To_Server_LED_Page
24
25 Page Should Contain Element ${xpath_server_led_heading}
26
27
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050028Verify Existence Of All Sections In Server LED Page
29 [Documentation] Verify existence of all sections in Server LED page.
30 [Tags] Verify_Existence_Of_All_Sections_In_Server_LED_Page
31
32 Page Should Contain LED light control
33
34
Sushma M Mbd9948c2020-08-24 05:34:57 -050035Verify Server Led Sync With Overview Page LED Status
36 [Documentation] Verify server LED sync with overview page LED status.
37 [Tags] Verify_Server_Led_Sync_With_Overview_Page_LED_Status
38
39 ${gui_led_value} = Get Text ${xpath_led_value}
40 Click Element ${xpath_overview_menu}
41 ${overview_led_value} = Get Text ${xpath_overview_led_value}
42
43 Should Be Equal ${gui_led_value} ${overview_led_value}
44
45
Sushma M Mfc53fbb2020-08-24 03:48:39 -050046Verify Server LED ON
47 [Documentation] Turn ON the server LED button using GUI and verify it via Redfish.
48 [Tags] Verify_Server_LED_ON
Sushma M Me3f510f2021-01-12 13:33:32 -060049 [Setup] Run Keywords Test Setup Execution AND Redfish.Login
50 [Teardown] Redfish.logout
Sushma M Mfc53fbb2020-08-24 03:48:39 -050051
52 # Turn Off the server LED via Redfish.
53 Redfish.Patch /redfish/v1/Systems/system body={"IndicatorLED":"Off"} valid_status_codes=[200, 204]
54
Ashwini Chandrappa154c2132021-06-28 23:44:21 -050055 # Refresh GUI and turn ON the server LED via GUI.
56 Click Element ${xpath_refresh_button}
Sushma M Mfc53fbb2020-08-24 03:48:39 -050057 Click Element At Coordinates ${xpath_led_toggle} 0 0
58 Wait Until Element Contains ${xpath_led_value} On timeout=15
59
60 # Verify server LED via Redfish and GUI.
61 Verify Server LED using Redfish and GUI On
62
63
Sushma M M50bb5a12020-09-12 18:01:49 -050064Verify Server LED OFF
65 [Documentation] Turn OFF the server LED button using GUI and verify it via Redfish.
66 [Tags] Verify_Server_LED_OFF
Sushma M Me3f510f2021-01-12 13:33:32 -060067 [Setup] Run Keywords Test Setup Execution AND Redfish.Login
68 [Teardown] Redfish.logout
Sushma M M50bb5a12020-09-12 18:01:49 -050069
70 # Turn ON the server LED via Redfish.
71 Redfish.Patch /redfish/v1/Systems/system body={"IndicatorLED":"Lit"} valid_status_codes=[200, 204]
72
Ashwini Chandrappa154c2132021-06-28 23:44:21 -050073 # Refresh GUI and turn OFF the server LED via GUI.
74 Click Element ${xpath_refresh_button}
Sushma M M50bb5a12020-09-12 18:01:49 -050075 Click Element At Coordinates ${xpath_led_toggle} 0 0
Sushma M M5b1a7b02020-11-17 00:07:46 -060076 Wait Until Element Contains ${xpath_led_value} Off timeout=30
Sushma M M50bb5a12020-09-12 18:01:49 -050077
78 # Verify server LED via Redfish and GUI.
79 Verify Server LED using Redfish and GUI Off
80
81
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050082*** Keywords ***
83
84Test Setup Execution
85 [Documentation] Do test case setup tasks.
86
87 Click Element ${xpath_control_menu}
88 Click Element ${xpath_server_led_sub_menu}
89 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-led
Sushma M Mfc53fbb2020-08-24 03:48:39 -050090
91
92Verify Server LED using Redfish and GUI
93 [Documentation] Verify LED status using Redfish and GUI.
94 [Arguments] ${expected_led_status}
95
96 # Description of argument(s):
97 # expected_led_status Expected value of Server LED.
98
99 ${gui_led_value} = Get Text ${xpath_led_value}
100 ${redfish_led_value}= Redfish.Get Attribute /redfish/v1/Systems/system IndicatorLED
101
Sushma M Me3f510f2021-01-12 13:33:32 -0600102 ${redfish_led_value}= Set Variable If
103 ... '${redfish_led_value}' == 'Lit' On
104 ... '${redfish_led_value}' == 'Off' Off
105
Sushma M Mfc53fbb2020-08-24 03:48:39 -0500106 Should Be Equal ${gui_led_value} ${expected_led_status}
107 Should Be Equal ${redfish_led_value} ${expected_led_status}