Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test OpenBMC GUI "Server LED" sub-menu of "Server control". |
| 4 | |
Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 5 | Resource ../../lib/gui_resource.robot |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 6 | |
| 7 | Suite Setup Launch Browser And Login GUI |
| 8 | Suite Teardown Close Browser |
| 9 | Test Setup Test Setup Execution |
| 10 | |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 14 | ${xpath_server_led_heading} //h1[text()="Server LED"] |
Sushma M M | bd9948c | 2020-08-24 05:34:57 -0500 | [diff] [blame] | 15 | ${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 M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 17 | ${xpath_led_toggle} //*[@data-test-id='serverLed-checkbox-switchIndicatorLed'] |
| 18 | |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 19 | |
| 20 | *** Test Cases *** |
| 21 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 22 | Verify 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 Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 29 | Verify 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 M | bd9948c | 2020-08-24 05:34:57 -0500 | [diff] [blame] | 36 | Verify 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 M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 47 | Verify 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 M | 50bb5a1 | 2020-09-12 18:01:49 -0500 | [diff] [blame] | 62 | Verify 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 |
Sushma M M | 5b1a7b0 | 2020-11-17 00:07:46 -0600 | [diff] [blame] | 71 | Wait Until Element Contains ${xpath_led_value} Off timeout=30 |
Sushma M M | 50bb5a1 | 2020-09-12 18:01:49 -0500 | [diff] [blame] | 72 | |
| 73 | # Verify server LED via Redfish and GUI. |
| 74 | Verify Server LED using Redfish and GUI Off |
| 75 | |
| 76 | |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 77 | *** Keywords *** |
| 78 | |
| 79 | Test 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 M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 85 | |
| 86 | |
| 87 | Verify 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} |