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