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