Server health from GUI header - Phase 6.
Resolves openbmc/openbmc-test-automation#1328
Change-Id: I76a16cc64d88c5d4219047e5a1a36aafbea62ee7
Signed-off-by: Sivas SRR <sivas.srr@in.ibm.com>
diff --git a/gui/obmc_gui/data/resource_variables.py b/gui/obmc_gui/data/resource_variables.py
index 83d1b6f..2cd2a4a 100644
--- a/gui/obmc_gui/data/resource_variables.py
+++ b/gui/obmc_gui/data/resource_variables.py
@@ -133,6 +133,8 @@
"//*[@id='event__actions-bar']/div[2]/div[1]/div[2]/button[1]"
xpath_second_event_select = \
"//*[@id='event-log__events']/log-event[2]/div/div[1]/div[2]/label/" +\
- span"
+ "span"
xpath_individual_event_resolved = \
"//*[@id='event__actions-bar']/div[2]/div[2]/button[2]"
+ xpath_individual_event_export = \
+ "//*[@id='event__actions-bar']/div[2]/div[2]/a"
diff --git a/gui/obmc_gui/test/gui_header/test_obmc_gui_server_health.robot b/gui/obmc_gui/test/gui_header/test_obmc_gui_server_health.robot
index 3cca295..b8c2d75 100644
--- a/gui/obmc_gui/test/gui_header/test_obmc_gui_server_health.robot
+++ b/gui/obmc_gui/test/gui_header/test_obmc_gui_server_health.robot
@@ -200,7 +200,8 @@
Page Should Contain Element ${xpath_number_of_events}
${number_of_events}= Get Text ${xpath_number_of_events}
Run Keyword If ${number_of_events} > 0
- ... Double Event Log Click Element
+ ... Double Event Log Click Element ${xpath_individual_event_delete}
+ ... ${xpath_individual_event_delete_yes}
${number_of_events}= Get Text ${xpath_number_of_events}
Should Be Equal ${number_of_events} 0
... msg=Failed to delete multiple error log entries.
@@ -211,7 +212,7 @@
[Tags] Select_Single_Error_Log_And_Mark_As_Resolved
Create Test Error Log
- # Refresh the GUI to get the latest update
+ # Refresh the GUI to get the latest update.
Click Element ${xpath_select_refresh_button}
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Page Should Contain Element ${xpath_number_of_events}
@@ -222,6 +223,59 @@
Should Be Equal ${number_of_events} 1
... msg=Failed to mark single error log entry as resolved.
+
+Select Multiple Error Logs And Mark As Resolved
+ [Documentation] Select multiple error logs and mark as resolved.
+ [Tags] Select_Multiple_Error_Logs_And_Mark_As_Resolved
+
+ Create Test Error Log
+ Create Test Error Log
+ # Refresh the GUI to get the latest update.
+ Click Element ${xpath_select_refresh_button}
+ Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
+ Page Should Contain Element ${xpath_number_of_events}
+ ${number_of_events}= Get Text ${xpath_number_of_events}
+ Run Keyword If ${number_of_events} > 0
+ ... Double Event Log Click Element ${xpath_individual_event_resolved} 0
+ ${number_of_events}= Get Text ${xpath_number_of_events}
+ Should Be Equal ${number_of_events} 2
+ ... msg=Failed to mark multiple error log entries as resolved.
+
+
+Select Single Error Log And Export
+ [Documentation] Select single error log and export.
+ [Tags] Select_Single_Error_Log_And_Export
+
+ Create Test Error Log
+ # Refresh the GUI to get the latest update.
+ Click Element ${xpath_select_refresh_button}
+ Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
+ Page Should Contain Element ${xpath_number_of_events}
+ ${number_of_events}= Get Text ${xpath_number_of_events}
+ Run Keyword If ${number_of_events} > 0
+ ... Common Event Log Click Element ${xpath_individual_event_export} 0
+ ${number_of_events}= Get Text ${xpath_number_of_events}
+ Should Be Equal ${number_of_events} 1
+ ... msg=Failed to export single error log entry.
+
+
+Select Multiple Error Log And Export
+ [Documentation] Select multiple error log and export.
+ [Tags] Select_Multiple_Error_Log_And_Export
+
+ Create Test Error Log
+ Create Test Error Log
+ # Refresh the GUI to get the latest update.
+ Click Element ${xpath_select_refresh_button}
+ Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
+ Page Should Contain Element ${xpath_number_of_events}
+ ${number_of_events}= Get Text ${xpath_number_of_events}
+ Run Keyword If ${number_of_events} > 0
+ ... Double Event Log Click Element ${xpath_individual_event_export} 0
+ ${number_of_events}= Get Text ${xpath_number_of_events}
+ Should Be Equal ${number_of_events} 2
+ ... msg=Failed to export multiple error log entries.
+
*** Keywords ***
Common Event Log Click Element
@@ -229,13 +283,13 @@
[Arguments] ${action_element} ${action_click_confirmation}
# Description of argument(s):
- # action_element xpath value of the element to be actioned.
- # (e.g. "Delete" or "Resolved" or "Export")
- # action_click_confirmation Confirmation of action by pressing yes.
- # (e.g. "Yes" or "No")
+ # action_element xpath value of the element to be actioned
+ # (e.g. "Delete" or "Resolved" or "Export").
+ # action_click_confirmation Confirmation of action by pressing yes
+ # (e.g. "Yes" or "No").
Click Element ${xpath_individual_event_select}
- Page Should Contain Button ${action_element}
+ Page Should Contain Element ${action_element}
Click Element ${action_element}
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Run Keyword If ${action_click_confirmation} <> 0
@@ -244,11 +298,18 @@
Run Key Sleep \ 50s
Double Event Log Click Element
- [Documentation] Keep double click elements associated with event logs.
+ [Documentation] Keep double click elements associated with event logs.
+ [Arguments] ${action_element} ${action_click_confirmation}
+
+ # Description of argument(s):
+ # action_element xpath value of the element to be actioned
+ # (e.g. "Delete" or "Resolved" or "Export").
+ # action_click_confirmation Confirmation of action by pressing yes
+ # (e.g. "Yes" or "No").
Click Element ${xpath_second_event_select}
- Common Event Log Click Element ${xpath_individual_event_delete}
- ... ${xpath_individual_event_delete_yes}
+ Common Event Log Click Element ${action_element}
+ ... ${action_click_confirmation}
Test Setup Execution
[Documentation] Do test case setup tasks.