blob: 5d7b608da1c496111f868dc6fdb333bdb00ed2b6 [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 SRR2f6fac72018-03-06 23:19:11 -060043
Sivas SRR1999b622018-02-22 19:35:08 -060044Verify Date Last Refreshed
45 [Documentation] Verify Date Last Refreshed text in GUI header.
46 [Tags] Verify_Date_Last_Refreshed
47
48 ${date_info_1st_read}= Get Text ${xpath_select_date_text}
49 ${current_date}= Get Time
50 ${date_conversion}= Convert Date ${current_date} result_format=%b %d %Y
51 Should Contain ${date_info_1st_read} ${date_conversion}
52
53 # Refresh button pressed.
54 Click Element ${xpath_select_refresh_button}
Sivas SRR2f6fac72018-03-06 23:19:11 -060055 Sleep 2s
Sivas SRR1999b622018-02-22 19:35:08 -060056
57 ${date_info_2nd_read}= Get Text ${xpath_select_date_text}
58 ${current_date}= Get Time
59 ${date_conversion}= Convert Date ${current_date} result_format=%b %d %Y
60 Should Contain ${date_info_2nd_read} ${date_conversion}
61
62 # Comparison between 1st and 2nd read.
63 Should Not Be Equal As Strings ${date_info_1st_read}
64 ... ${date_info_2nd_read}
65
Sivas SRR5137ea52018-02-06 08:23:26 -060066
Sivas SRR2f6fac72018-03-06 23:19:11 -060067Verify GUI Header Scrolls
68 [Documentation] Verify GUI header scrolls on click "Server Info" element.
69 [Tags] Verify_GUI_Header_Scrolls
Sivas SRR5137ea52018-02-06 08:23:26 -060070
Sivas SRR2f6fac72018-03-06 23:19:11 -060071 ${current_browser_width} ${current_browser_height}= Get Window Size
72 Maximize Browser Window
73 ${max_browser_width} ${max_browser_height}= Get Window Size
74 # Shrink the browser to half from max size.
75 ${shrink_browser_width}= Evaluate ${max_browser_width} / 2
76 ${shrink_browser_height}= Evaluate ${max_browser_height} / 2
77 # Reduce the browser size which enables scroll element.
78 Set Window Size ${shrink_browser_width} ${shrink_browser_height}
79 Click Element ${xpath_header_scroll_front}
80 # Below element is to scroll back.
81 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
82 Click Element ${xpath_header_scroll_back}
83 # Restore to original browser size.
84 Set Window Size ${current_browser_width} ${current_browser_height}