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 | |
Sushma M M | e3f510f | 2021-01-12 13:33:32 -0600 | [diff] [blame] | 7 | Suite Setup Launch Browser And Login GUI |
| 8 | Suite Teardown Close Browser |
| 9 | Test Setup Test Setup Execution |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 10 | |
| 11 | *** Variables *** |
| 12 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 13 | ${xpath_server_led_heading} //h1[text()="Server LED"] |
Sushma M M | bd9948c | 2020-08-24 05:34:57 -0500 | [diff] [blame] | 14 | ${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 M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 16 | ${xpath_led_toggle} //*[@data-test-id='serverLed-checkbox-switchIndicatorLed'] |
| 17 | |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 18 | |
| 19 | *** Test Cases *** |
| 20 | |
Rahul Maheshwari | 317c710 | 2020-08-30 21:10:22 -0500 | [diff] [blame] | 21 | Verify 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 Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 28 | Verify 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 M | bd9948c | 2020-08-24 05:34:57 -0500 | [diff] [blame] | 35 | Verify 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 M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 46 | Verify 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 M | e3f510f | 2021-01-12 13:33:32 -0600 | [diff] [blame] | 49 | [Setup] Run Keywords Test Setup Execution AND Redfish.Login |
| 50 | [Teardown] Redfish.logout |
Sushma M M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 51 | |
| 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 Chandrappa | 154c213 | 2021-06-28 23:44:21 -0500 | [diff] [blame] | 55 | # Refresh GUI and turn ON the server LED via GUI. |
| 56 | Click Element ${xpath_refresh_button} |
Sushma M M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 57 | 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 M | 50bb5a1 | 2020-09-12 18:01:49 -0500 | [diff] [blame] | 64 | Verify 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 M | e3f510f | 2021-01-12 13:33:32 -0600 | [diff] [blame] | 67 | [Setup] Run Keywords Test Setup Execution AND Redfish.Login |
| 68 | [Teardown] Redfish.logout |
Sushma M M | 50bb5a1 | 2020-09-12 18:01:49 -0500 | [diff] [blame] | 69 | |
| 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 Chandrappa | 154c213 | 2021-06-28 23:44:21 -0500 | [diff] [blame] | 73 | # Refresh GUI and turn OFF the server LED via GUI. |
| 74 | Click Element ${xpath_refresh_button} |
Sushma M M | 50bb5a1 | 2020-09-12 18:01:49 -0500 | [diff] [blame] | 75 | Click Element At Coordinates ${xpath_led_toggle} 0 0 |
Sushma M M | 5b1a7b0 | 2020-11-17 00:07:46 -0600 | [diff] [blame] | 76 | Wait Until Element Contains ${xpath_led_value} Off timeout=30 |
Sushma M M | 50bb5a1 | 2020-09-12 18:01:49 -0500 | [diff] [blame] | 77 | |
| 78 | # Verify server LED via Redfish and GUI. |
| 79 | Verify Server LED using Redfish and GUI Off |
| 80 | |
| 81 | |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 82 | *** Keywords *** |
| 83 | |
| 84 | Test 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 M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 90 | |
| 91 | |
| 92 | Verify 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 M | e3f510f | 2021-01-12 13:33:32 -0600 | [diff] [blame] | 102 | ${redfish_led_value}= Set Variable If |
| 103 | ... '${redfish_led_value}' == 'Lit' On |
| 104 | ... '${redfish_led_value}' == 'Off' Off |
| 105 | |
Sushma M M | fc53fbb | 2020-08-24 03:48:39 -0500 | [diff] [blame] | 106 | Should Be Equal ${gui_led_value} ${expected_led_status} |
| 107 | Should Be Equal ${redfish_led_value} ${expected_led_status} |