blob: aedec877e4e63979e2cb0063b0f1f1aaad739010 [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
55 # Turn ON the server LED via GUI.
56 Click Element At Coordinates ${xpath_led_toggle} 0 0
57 Wait Until Element Contains ${xpath_led_value} On timeout=15
58
59 # Verify server LED via Redfish and GUI.
60 Verify Server LED using Redfish and GUI On
61
62
Sushma M M50bb5a12020-09-12 18:01:49 -050063Verify Server LED OFF
64 [Documentation] Turn OFF the server LED button using GUI and verify it via Redfish.
65 [Tags] Verify_Server_LED_OFF
Sushma M Me3f510f2021-01-12 13:33:32 -060066 [Setup] Run Keywords Test Setup Execution AND Redfish.Login
67 [Teardown] Redfish.logout
Sushma M M50bb5a12020-09-12 18:01:49 -050068
69 # Turn ON the server LED via Redfish.
70 Redfish.Patch /redfish/v1/Systems/system body={"IndicatorLED":"Lit"} valid_status_codes=[200, 204]
71
72 # Turn Off the server LED via GUI.
73 Click Element At Coordinates ${xpath_led_toggle} 0 0
Sushma M M5b1a7b02020-11-17 00:07:46 -060074 Wait Until Element Contains ${xpath_led_value} Off timeout=30
Sushma M M50bb5a12020-09-12 18:01:49 -050075
76 # Verify server LED via Redfish and GUI.
77 Verify Server LED using Redfish and GUI Off
78
79
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050080*** Keywords ***
81
82Test Setup Execution
83 [Documentation] Do test case setup tasks.
84
85 Click Element ${xpath_control_menu}
86 Click Element ${xpath_server_led_sub_menu}
87 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-led
Sushma M Mfc53fbb2020-08-24 03:48:39 -050088
89
90Verify Server LED using Redfish and GUI
91 [Documentation] Verify LED status using Redfish and GUI.
92 [Arguments] ${expected_led_status}
93
94 # Description of argument(s):
95 # expected_led_status Expected value of Server LED.
96
97 ${gui_led_value} = Get Text ${xpath_led_value}
98 ${redfish_led_value}= Redfish.Get Attribute /redfish/v1/Systems/system IndicatorLED
99
Sushma M Me3f510f2021-01-12 13:33:32 -0600100 ${redfish_led_value}= Set Variable If
101 ... '${redfish_led_value}' == 'Lit' On
102 ... '${redfish_led_value}' == 'Off' Off
103
Sushma M Mfc53fbb2020-08-24 03:48:39 -0500104 Should Be Equal ${gui_led_value} ${expected_led_status}
105 Should Be Equal ${redfish_led_value} ${expected_led_status}