blob: e3ee534d218518a57db7f882563c57271d94f085 [file] [log] [blame]
Sivas SRR5137ea52018-02-06 08:23:26 -06001*** Settings ***
2
3Documentation Test Open BMC GUI BMC host information under GUI Header.
4
Sivas SRR1999b622018-02-22 19:35:08 -06005Library DateTime
6
Sivas SRR5137ea52018-02-06 08:23:26 -06007Resource ../../lib/resource.robot
8
Sivas SRR2f6fac72018-03-06 23:19:11 -06009Suite Setup Launch Browser And Login OpenBMC GUI
10Suite Teardown Logout And Close Browser
Sivas SRR5137ea52018-02-06 08:23:26 -060011
12*** Variables ***
13${xpath_select_server_control} //*[@id="header__wrapper"]/div/div[2]/p[2]
Sivas SRRca534e62018-02-20 02:22:02 -060014${xpath_select_refresh_button} //*[@id="header__wrapper"]/div/div[3]/button
Sivas SRR1999b622018-02-22 19:35:08 -060015${xpath_select_date_text} //*[@id="header__wrapper"]/div/div[3]/p/span
Sivas SRR2f6fac72018-03-06 23:19:11 -060016${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 SRR5137ea52018-02-06 08:23:26 -060018
19*** Test Cases ***
20
21Verify 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 SRR2f6fac72018-03-06 23:19:11 -060030
Sivas SRRca534e62018-02-20 02:22:02 -060031Verify 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 SRR1999b622018-02-22 19:35:08 -060043Verify 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 Kattif7dbae42018-09-28 03:34:27 -050050
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 SRR1999b622018-02-22 19:35:08 -060054
55 # Refresh button pressed.
56 Click Element ${xpath_select_refresh_button}
Sivas SRR2f6fac72018-03-06 23:19:11 -060057 Sleep 2s
Sivas SRR1999b622018-02-22 19:35:08 -060058
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 Kattif7dbae42018-09-28 03:34:27 -050062
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 SRR1999b622018-02-22 19:35:08 -060066
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 SRR2f6fac72018-03-06 23:19:11 -060071Verify GUI Header Scrolls
72 [Documentation] Verify GUI header scrolls on click "Server Info" element.
73 [Tags] Verify_GUI_Header_Scrolls
Sivas SRR5137ea52018-02-06 08:23:26 -060074
Sivas SRR2f6fac72018-03-06 23:19:11 -060075 ${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}