blob: 9271c848cc392dd7aed1258b18e542a2c1aaa39c [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
Rahul Maheshwari1e18bb62020-07-07 00:45:50 -050062*** Keywords ***
63
64Test Setup Execution
65 [Documentation] Do test case setup tasks.
66
67 Click Element ${xpath_control_menu}
68 Click Element ${xpath_server_led_sub_menu}
69 Wait Until Keyword Succeeds 30 sec 10 sec Location Should Contain server-led
Sushma M Mfc53fbb2020-08-24 03:48:39 -050070
71
72Verify Server LED using Redfish and GUI
73 [Documentation] Verify LED status using Redfish and GUI.
74 [Arguments] ${expected_led_status}
75
76 # Description of argument(s):
77 # expected_led_status Expected value of Server LED.
78
79 ${gui_led_value} = Get Text ${xpath_led_value}
80 ${redfish_led_value}= Redfish.Get Attribute /redfish/v1/Systems/system IndicatorLED
81
82 ${redfish_led_value}= Set Variable If '${redfish_led_value}' == 'Lit' On
83 Should Be Equal ${gui_led_value} ${expected_led_status}
84 Should Be Equal ${redfish_led_value} ${expected_led_status}