Sivas SRR | 5137ea5 | 2018-02-06 08:23:26 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test Open BMC GUI BMC host information under GUI Header. |
| 4 | |
Sivas SRR | 1999b62 | 2018-02-22 19:35:08 -0600 | [diff] [blame] | 5 | Library DateTime |
| 6 | |
Sivas SRR | 5137ea5 | 2018-02-06 08:23:26 -0600 | [diff] [blame] | 7 | Resource ../../lib/resource.robot |
| 8 | |
Sivas SRR | 2f6fac7 | 2018-03-06 23:19:11 -0600 | [diff] [blame] | 9 | Suite Setup Launch Browser And Login OpenBMC GUI |
Rahul Maheshwari | 43333ff | 2018-11-26 23:18:36 -0600 | [diff] [blame] | 10 | Suite Teardown Close Browser |
| 11 | |
Sivas SRR | 5137ea5 | 2018-02-06 08:23:26 -0600 | [diff] [blame] | 12 | |
| 13 | *** Variables *** |
Anusha Dathatri | f7a407c | 2019-07-22 00:59:38 -0500 | [diff] [blame] | 14 | ${xpath_bmc_ip} //*[contains(@class, "header__server-ip")] |
| 15 | ${xpath_select_refresh_button} //*[contains(@class, "header__page-refresh")] |
| 16 | ${xpath_select_date_text} //p[@class="header__refresh"] |
| 17 | ${xpath_header_scroll} //*[@class="header__info"] |
Sivas SRR | 5137ea5 | 2018-02-06 08:23:26 -0600 | [diff] [blame] | 18 | |
| 19 | *** Test Cases *** |
| 20 | |
Arpana Durgaprasad | 272c5b7 | 2019-03-04 00:18:44 -0600 | [diff] [blame] | 21 | Verify Server Power Button |
| 22 | [Documentation] Verify server power page on clicking server power button. |
| 23 | [Tags] Verify_Server_Power_Button |
| 24 | |
Anusha Dathatri | f7a407c | 2019-07-22 00:59:38 -0500 | [diff] [blame] | 25 | Wait Until Element Is Visible ${xpath_select_server_power} |
| 26 | Click Element ${xpath_select_server_power} |
Arpana Durgaprasad | 272c5b7 | 2019-03-04 00:18:44 -0600 | [diff] [blame] | 27 | Wait Until Page Contains Select a power operation |
| 28 | |
| 29 | Verify Server Health Button |
| 30 | [Documentation] Verify server health page on clicking server health button. |
| 31 | [Tags] Verify_Server_Health_Button |
| 32 | |
Anusha Dathatri | f7a407c | 2019-07-22 00:59:38 -0500 | [diff] [blame] | 33 | Wait Until Element Is Visible ${xpath_select_server_health} |
| 34 | Click Element ${xpath_select_server_health} |
Arpana Durgaprasad | 272c5b7 | 2019-03-04 00:18:44 -0600 | [diff] [blame] | 35 | Wait Until Page Contains All events from the BMC |
| 36 | |
Sivas SRR | 5137ea5 | 2018-02-06 08:23:26 -0600 | [diff] [blame] | 37 | Verify IP address |
| 38 | [Documentation] Verify BMC IP address displayed in GUI header. |
| 39 | [Tags] Verify_IP_address |
| 40 | |
| 41 | # NOTE: gui_displayed_ip can be either a host name or an IP address. |
| 42 | # (e.g. "machinex" or "xx.xx.xx.xx"). |
Anusha Dathatri | f7a407c | 2019-07-22 00:59:38 -0500 | [diff] [blame] | 43 | ${gui_displayed_ip}= Get Text ${xpath_bmc_ip} |
Sivas SRR | 5137ea5 | 2018-02-06 08:23:26 -0600 | [diff] [blame] | 44 | Should Contain ${gui_displayed_ip} ${OPENBMC_HOST} |
| 45 | |
Sivas SRR | 2f6fac7 | 2018-03-06 23:19:11 -0600 | [diff] [blame] | 46 | |
Sivas SRR | ca534e6 | 2018-02-20 02:22:02 -0600 | [diff] [blame] | 47 | Verify Refresh Button |
| 48 | [Documentation] Verify Refresh Button in GUI header. |
| 49 | [Tags] Verify_Refresh_Button |
| 50 | |
| 51 | # Verify power is on after refresh button. |
| 52 | |
| 53 | Expected Initial Test State Off |
| 54 | Click Element ${xpath_select_refresh_button} |
| 55 | GUI Power On |
| 56 | Click Element ${xpath_select_refresh_button} |
| 57 | Wait Until Page Contains Running |
| 58 | |
Sivas SRR | 1999b62 | 2018-02-22 19:35:08 -0600 | [diff] [blame] | 59 | Verify Date Last Refreshed |
| 60 | [Documentation] Verify Date Last Refreshed text in GUI header. |
| 61 | [Tags] Verify_Date_Last_Refreshed |
| 62 | |
| 63 | ${date_info_1st_read}= Get Text ${xpath_select_date_text} |
| 64 | ${current_date}= Get Time |
| 65 | ${date_conversion}= Convert Date ${current_date} result_format=%b %d %Y |
Prashanth Katti | f7dbae4 | 2018-09-28 03:34:27 -0500 | [diff] [blame] | 66 | |
| 67 | ${mmmdd} ${yyyy}= Split String From Right ${date_conversion} ${SPACE} 1 |
| 68 | Should Contain ${date_info_1st_read} ${mmmdd} msg=Month and day mismatch. |
| 69 | Should Contain ${date_info_1st_read} ${yyyy} msg=Year mismatch. |
Sivas SRR | 1999b62 | 2018-02-22 19:35:08 -0600 | [diff] [blame] | 70 | |
| 71 | # Refresh button pressed. |
| 72 | Click Element ${xpath_select_refresh_button} |
Sivas SRR | 2f6fac7 | 2018-03-06 23:19:11 -0600 | [diff] [blame] | 73 | Sleep 2s |
Sivas SRR | 1999b62 | 2018-02-22 19:35:08 -0600 | [diff] [blame] | 74 | |
| 75 | ${date_info_2nd_read}= Get Text ${xpath_select_date_text} |
| 76 | ${current_date}= Get Time |
| 77 | ${date_conversion}= Convert Date ${current_date} result_format=%b %d %Y |
Prashanth Katti | f7dbae4 | 2018-09-28 03:34:27 -0500 | [diff] [blame] | 78 | |
| 79 | ${mmmdd} ${yyyy}= Split String From Right ${date_conversion} ${SPACE} 1 |
| 80 | Should Contain ${date_info_1st_read} ${mmmdd} msg=Month and day mismatch. |
| 81 | Should Contain ${date_info_1st_read} ${yyyy} msg=Year mismatch. |
Sivas SRR | 1999b62 | 2018-02-22 19:35:08 -0600 | [diff] [blame] | 82 | |
| 83 | # Comparison between 1st and 2nd read. |
| 84 | Should Not Be Equal As Strings ${date_info_1st_read} |
| 85 | ... ${date_info_2nd_read} |
| 86 | |
Sivas SRR | 2f6fac7 | 2018-03-06 23:19:11 -0600 | [diff] [blame] | 87 | Verify GUI Header Scrolls |
| 88 | [Documentation] Verify GUI header scrolls on click "Server Info" element. |
| 89 | [Tags] Verify_GUI_Header_Scrolls |
Sivas SRR | 5137ea5 | 2018-02-06 08:23:26 -0600 | [diff] [blame] | 90 | |
Sivas SRR | 2f6fac7 | 2018-03-06 23:19:11 -0600 | [diff] [blame] | 91 | ${current_browser_width} ${current_browser_height}= Get Window Size |
| 92 | Maximize Browser Window |
| 93 | ${max_browser_width} ${max_browser_height}= Get Window Size |
| 94 | # Shrink the browser to half from max size. |
| 95 | ${shrink_browser_width}= Evaluate ${max_browser_width} / 2 |
| 96 | ${shrink_browser_height}= Evaluate ${max_browser_height} / 2 |
| 97 | # Reduce the browser size which enables scroll element. |
| 98 | Set Window Size ${shrink_browser_width} ${shrink_browser_height} |
Anusha Dathatri | f7a407c | 2019-07-22 00:59:38 -0500 | [diff] [blame] | 99 | Click Element ${xpath_header_scroll} |
Sivas SRR | 2f6fac7 | 2018-03-06 23:19:11 -0600 | [diff] [blame] | 100 | # Below element is to scroll back. |
| 101 | Wait Until Page Does Not Contain Element ${xpath_refresh_circle} |
Anusha Dathatri | f7a407c | 2019-07-22 00:59:38 -0500 | [diff] [blame] | 102 | Click Element ${xpath_header_scroll} |
Sivas SRR | 2f6fac7 | 2018-03-06 23:19:11 -0600 | [diff] [blame] | 103 | # Restore to original browser size. |
| 104 | Set Window Size ${current_browser_width} ${current_browser_height} |