blob: 770ea84abba2ab90ba814d3046cea8590722472c [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
Rahul Maheshwari43333ff2018-11-26 23:18:36 -060010Suite Teardown Close Browser
11
Sivas SRR5137ea52018-02-06 08:23:26 -060012
13*** Variables ***
Anusha Dathatrif7a407c2019-07-22 00:59:38 -050014${xpath_bmc_ip} //*[contains(@class, "header__server-ip")]
Anusha Dathatri7ea44c12019-09-04 09:28:38 -050015${xpath_select_refresh_button} //*[text()[contains(.,"Refresh")]]
16${xpath_select_date_text} //*[@class="header__refresh"]
17${xpath_header_scroll} //*[contains(@class,"header__action")]
Sivas SRR5137ea52018-02-06 08:23:26 -060018
19*** Test Cases ***
20
Arpana Durgaprasad272c5b72019-03-04 00:18:44 -060021Verify Server Power Button
22 [Documentation] Verify server power page on clicking server power button.
23 [Tags] Verify_Server_Power_Button
24
Anusha Dathatrif7a407c2019-07-22 00:59:38 -050025 Wait Until Element Is Visible ${xpath_select_server_power}
26 Click Element ${xpath_select_server_power}
Anusha Dathatri7ea44c12019-09-04 09:28:38 -050027 Wait Until Page Contains Server power operations
Arpana Durgaprasad272c5b72019-03-04 00:18:44 -060028
29Verify Server Health Button
30 [Documentation] Verify server health page on clicking server health button.
31 [Tags] Verify_Server_Health_Button
32
Anusha Dathatrif7a407c2019-07-22 00:59:38 -050033 Wait Until Element Is Visible ${xpath_select_server_health}
34 Click Element ${xpath_select_server_health}
Arpana Durgaprasad272c5b72019-03-04 00:18:44 -060035 Wait Until Page Contains All events from the BMC
36
Sivas SRR5137ea52018-02-06 08:23:26 -060037Verify 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 Dathatrif7a407c2019-07-22 00:59:38 -050043 ${gui_displayed_ip}= Get Text ${xpath_bmc_ip}
Sivas SRR5137ea52018-02-06 08:23:26 -060044 Should Contain ${gui_displayed_ip} ${OPENBMC_HOST}
45
Sivas SRRca534e62018-02-20 02:22:02 -060046Verify 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
Anusha Dathatri0a9ec762019-07-29 23:29:56 -050053 Wait Until Element Is Visible ${xpath_select_refresh_button}
Sivas SRRca534e62018-02-20 02:22:02 -060054 Click Element ${xpath_select_refresh_button}
55 GUI Power On
Anusha Dathatri0a9ec762019-07-29 23:29:56 -050056 Wait Until Element Is Visible ${xpath_select_refresh_button}
Sivas SRRca534e62018-02-20 02:22:02 -060057 Click Element ${xpath_select_refresh_button}
58 Wait Until Page Contains Running
59
Sivas SRR1999b622018-02-22 19:35:08 -060060Verify Date Last Refreshed
61 [Documentation] Verify Date Last Refreshed text in GUI header.
62 [Tags] Verify_Date_Last_Refreshed
63
Anusha Dathatri0a9ec762019-07-29 23:29:56 -050064 Wait Until Element Is Visible ${xpath_select_date_text}
Sivas SRR1999b622018-02-22 19:35:08 -060065 ${date_info_1st_read}= Get Text ${xpath_select_date_text}
Anusha Dathatri0a9ec762019-07-29 23:29:56 -050066 Should Not Be Empty ${date_info_1st_read}
Sivas SRR1999b622018-02-22 19:35:08 -060067 ${current_date}= Get Time
Anusha Dathatri7ea44c12019-09-04 09:28:38 -050068 ${date_conversion}= Convert Date ${current_date} result_format=%b %-d %Y
Prashanth Kattif7dbae42018-09-28 03:34:27 -050069
70 ${mmmdd} ${yyyy}= Split String From Right ${date_conversion} ${SPACE} 1
71 Should Contain ${date_info_1st_read} ${mmmdd} msg=Month and day mismatch.
72 Should Contain ${date_info_1st_read} ${yyyy} msg=Year mismatch.
Sivas SRR1999b622018-02-22 19:35:08 -060073
74 # Refresh button pressed.
75 Click Element ${xpath_select_refresh_button}
Sivas SRR2f6fac72018-03-06 23:19:11 -060076 Sleep 2s
Sivas SRR1999b622018-02-22 19:35:08 -060077
78 ${date_info_2nd_read}= Get Text ${xpath_select_date_text}
79 ${current_date}= Get Time
Anusha Dathatri7ea44c12019-09-04 09:28:38 -050080 ${date_conversion}= Convert Date ${current_date} result_format=%b %-d %Y
Prashanth Kattif7dbae42018-09-28 03:34:27 -050081
82 ${mmmdd} ${yyyy}= Split String From Right ${date_conversion} ${SPACE} 1
83 Should Contain ${date_info_1st_read} ${mmmdd} msg=Month and day mismatch.
84 Should Contain ${date_info_1st_read} ${yyyy} msg=Year mismatch.
Sivas SRR1999b622018-02-22 19:35:08 -060085
86 # Comparison between 1st and 2nd read.
87 Should Not Be Equal As Strings ${date_info_1st_read}
88 ... ${date_info_2nd_read}
89
Sivas SRR2f6fac72018-03-06 23:19:11 -060090Verify GUI Header Scrolls
91 [Documentation] Verify GUI header scrolls on click "Server Info" element.
92 [Tags] Verify_GUI_Header_Scrolls
Sivas SRR5137ea52018-02-06 08:23:26 -060093
Sivas SRR2f6fac72018-03-06 23:19:11 -060094 ${current_browser_width} ${current_browser_height}= Get Window Size
95 Maximize Browser Window
96 ${max_browser_width} ${max_browser_height}= Get Window Size
97 # Shrink the browser to half from max size.
98 ${shrink_browser_width}= Evaluate ${max_browser_width} / 2
99 ${shrink_browser_height}= Evaluate ${max_browser_height} / 2
100 # Reduce the browser size which enables scroll element.
101 Set Window Size ${shrink_browser_width} ${shrink_browser_height}
Anusha Dathatrif7a407c2019-07-22 00:59:38 -0500102 Click Element ${xpath_header_scroll}
Sivas SRR2f6fac72018-03-06 23:19:11 -0600103 # Below element is to scroll back.
104 Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Anusha Dathatrif7a407c2019-07-22 00:59:38 -0500105 Click Element ${xpath_header_scroll}
Sivas SRR2f6fac72018-03-06 23:19:11 -0600106 # Restore to original browser size.
107 Set Window Size ${current_browser_width} ${current_browser_height}
Rahul Maheshwari3daa28e2019-10-18 02:58:28 -0500108
109
110OpenBMC GUI Logoff
111 [Documentation] Log out from openBMC GUI.
112 [Tags] OpenBMC_GUI_Logoff
113
Rahul Maheshwari31b3c432020-06-26 05:24:13 -0500114
115 Click Button ${xpath_button_user_action}
116 Click Button ${xpath_button_logout}
Rahul Maheshwari3daa28e2019-10-18 02:58:28 -0500117 Wait Until Page Contains Element ${xpath_button_login}