blob: 3e71b190d969699bddf326ea3f47f7d4090209c3 [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
5Resource ../../lib/resource.robot
6
7Suite Setup Launch Browser And Login GUI
8Suite Teardown Close Browser
9Test Setup Test Setup Execution
10
11
12*** Variables ***
13
Rahul Maheshwari317c7102020-08-30 21:10:22 -050014${xpath_server_led_heading} //h1[text()="Server LED"]
Sushma M Mbd9948c2020-08-24 05:34:57 -050015${xpath_led_value} //*[@data-test-id='serverLed-checkbox-switchIndicatorLed']/following-sibling::label/span
16${xpath_overview_led_value} //*[@data-test-id='overviewQuickLinks-checkbox-serverLed']/following-sibling::label/span
Sushma M Mfc53fbb2020-08-24 03:48:39 -050017${xpath_led_toggle} //*[@data-test-id='serverLed-checkbox-switchIndicatorLed']
18
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050019
20*** Test Cases ***
21
Rahul Maheshwari317c7102020-08-30 21:10:22 -050022Verify Navigation To Server LED Page
23 [Documentation] Verify navigation to server LED page.
24 [Tags] Verify_Navigation_To_Server_LED_Page
25
26 Page Should Contain Element ${xpath_server_led_heading}
27
28
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050029Verify Existence Of All Sections In Server LED Page
30 [Documentation] Verify existence of all sections in Server LED page.
31 [Tags] Verify_Existence_Of_All_Sections_In_Server_LED_Page
32
33 Page Should Contain LED light control
34
35
Sushma M Mbd9948c2020-08-24 05:34:57 -050036Verify Server Led Sync With Overview Page LED Status
37 [Documentation] Verify server LED sync with overview page LED status.
38 [Tags] Verify_Server_Led_Sync_With_Overview_Page_LED_Status
39
40 ${gui_led_value} = Get Text ${xpath_led_value}
41 Click Element ${xpath_overview_menu}
42 ${overview_led_value} = Get Text ${xpath_overview_led_value}
43
44 Should Be Equal ${gui_led_value} ${overview_led_value}
45
46
Sushma M Mfc53fbb2020-08-24 03:48:39 -050047Verify Server LED ON
48 [Documentation] Turn ON the server LED button using GUI and verify it via Redfish.
49 [Tags] Verify_Server_LED_ON
50
51 # Turn Off the server LED via Redfish.
52 Redfish.Patch /redfish/v1/Systems/system body={"IndicatorLED":"Off"} valid_status_codes=[200, 204]
53
54 # Turn ON the server LED via GUI.
55 Click Element At Coordinates ${xpath_led_toggle} 0 0
56 Wait Until Element Contains ${xpath_led_value} On timeout=15
57
58 # Verify server LED via Redfish and GUI.
59 Verify Server LED using Redfish and GUI On
60
61
Sushma M M50bb5a12020-09-12 18:01:49 -050062Verify Server LED OFF
63 [Documentation] Turn OFF the server LED button using GUI and verify it via Redfish.
64 [Tags] Verify_Server_LED_OFF
65
66 # Turn ON the server LED via Redfish.
67 Redfish.Patch /redfish/v1/Systems/system body={"IndicatorLED":"Lit"} valid_status_codes=[200, 204]
68
69 # Turn Off the server LED via GUI.
70 Click Element At Coordinates ${xpath_led_toggle} 0 0
71 Wait Until Element Contains ${xpath_led_value} Off timeout=15
72
73 # Verify server LED via Redfish and GUI.
74 Verify Server LED using Redfish and GUI Off
75
76
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050077*** Keywords ***
78
79Test Setup Execution
80 [Documentation] Do test case setup tasks.
81
82 Click Element ${xpath_control_menu}
83 Click Element ${xpath_server_led_sub_menu}
84 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-led
Sushma M Mfc53fbb2020-08-24 03:48:39 -050085
86
87Verify Server LED using Redfish and GUI
88 [Documentation] Verify LED status using Redfish and GUI.
89 [Arguments] ${expected_led_status}
90
91 # Description of argument(s):
92 # expected_led_status Expected value of Server LED.
93
94 ${gui_led_value} = Get Text ${xpath_led_value}
95 ${redfish_led_value}= Redfish.Get Attribute /redfish/v1/Systems/system IndicatorLED
96
97 ${redfish_led_value}= Set Variable If '${redfish_led_value}' == 'Lit' On
98 Should Be Equal ${gui_led_value} ${expected_led_status}
99 Should Be Equal ${redfish_led_value} ${expected_led_status}