blob: e70a3246684b42e2204a8da969368a64d0503ba6 [file] [log] [blame]
George Keishinge7e91712021-09-03 11:28:44 -05001#!/usr/bin/env python3
Sathyajith M S4f26ae72018-01-16 04:45:05 -06002
3r"""
4Contains xpaths and related string constants applicable to all openBMC GUI
5menus.
6"""
7
8
Patrick Williams20f38712022-12-08 06:18:26 -06009class resource_variables:
Rahul Maheshwari314cd9f2019-04-02 01:13:39 -050010 xpath_textbox_hostname = "//input[@id='host']"
11 xpath_textbox_username = "//input[@id='username']"
12 xpath_textbox_password = "//input[@id='password']"
Anves Kumar rayankula9233ce12020-06-17 00:14:41 -050013 xpath_input_password = "//input[@id='password']"
14 xpath_input_confirm_password = "//input[@id='passwordConfirm']"
15 xpath_submit_button = '//button[@type="submit"]'
16 xpath_button_profile_settings = '//a[@href="#/profile-settings"]'
Sathyajith M S4f26ae72018-01-16 04:45:05 -060017 xpath_button_login = "//*[@id='login__submit']"
Rahul Maheshwari31b3c432020-06-26 05:24:13 -050018 xpath_button_user_action = "//button[@id='user-actions']"
19 xpath_button_logout = '//button[text()="Log out"]'
Rahul Maheshwari65f69442018-11-27 04:43:00 -060020 xpath_yes_button = "//button[text()='Yes']"
Rahul Maheshwari8b5b5a42018-11-30 01:41:35 -060021 xpath_power_indicator = "//*[@id='power-indicator-bar']"
Sathyajith M S4f26ae72018-01-16 04:45:05 -060022 xpath_select_button_power_on = "//*[@id='power__power-on']"
Rahul Maheshwaridd3bb602019-10-23 13:31:33 -050023 xpath_cancel_button = "//button[contains(text(),'Cancel')]"
24 xpath_save_setting_button = "//button[contains(text(),'Save settings')]"
Anusha Dathatribb20cb02019-11-13 10:32:27 -060025 xpath_save_button = "//button[contains(text(),'Save')]"
Anusha Dathatrie9650a62019-11-15 04:02:24 -060026 xpath_remove_button = "//button[contains(text(),'Remove')]"
27 xpath_add_button = "//button[@type='submit']"
Sathyajith M S4f26ae72018-01-16 04:45:05 -060028
Patrick Williams20f38712022-12-08 06:18:26 -060029 xpath_select_button_warm_reboot = "//*[@id='power__warm-boot']"
30 xpath_operation_warning_message = "//*[@class='inline__confirm active']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060031 text_warm_reboot_warning_message = "warm reboot?"
Patrick Williams20f38712022-12-08 06:18:26 -060032 xpath_select_button_warm_reboot_yes = (
33 "//*[@id='power-operations']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060034 "/div[3]/div[3]/confirm/div/div[2]/button[1]"
Patrick Williams20f38712022-12-08 06:18:26 -060035 )
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060036
Patrick Williams20f38712022-12-08 06:18:26 -060037 xpath_select_button_cold_reboot = "//*[@id='power__cold-boot']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060038 text_cold_reboot_warning_message = "cold reboot?"
Patrick Williams20f38712022-12-08 06:18:26 -060039 xpath_select_button_cold_reboot_yes = (
40 "//*[@id='power-operations']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060041 "/div[3]/div[4]/confirm/div/div[2]/button[2]"
Patrick Williams20f38712022-12-08 06:18:26 -060042 )
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060043
Patrick Williams20f38712022-12-08 06:18:26 -060044 xpath_select_button_orderly_shutdown = "//*[@id='power__soft-shutdown']"
45 xpath_select_button_orderly_shutdown_button_no = (
46 "//*[@id='power-operations']/div[3]/div[5]"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060047 "/confirm/div/div[2]/button[2]"
Patrick Williams20f38712022-12-08 06:18:26 -060048 )
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060049 text_orderly_shutdown_warning_message = "orderly shutdown?"
Patrick Williams20f38712022-12-08 06:18:26 -060050 xpath_select_button_orderly_shutdown_yes = (
51 "//*[@id='power-operations']/div[3]/div[5]"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060052 "/confirm/div/div[2]/button[1]"
Patrick Williams20f38712022-12-08 06:18:26 -060053 )
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060054
Patrick Williams20f38712022-12-08 06:18:26 -060055 xpath_select_button_immediate_shutdown = "//*[@id='power__hard-shutdown']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060056 text_immediate_shutdown_warning_message = "immediate shutdown?"
Patrick Williams20f38712022-12-08 06:18:26 -060057 xpath_select_button_immediate_shutdown_yes = (
58 "//*[@id='power-operations']/div[3]/div[6]"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060059 "/confirm/div/div[2]/button[1]"
Patrick Williams20f38712022-12-08 06:18:26 -060060 )
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060061
Sathyajith M S4f26ae72018-01-16 04:45:05 -060062 obmc_off_state = "Off"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060063 obmc_standby_state = "Standby"
Sathyajith M S4f26ae72018-01-16 04:45:05 -060064 obmc_running_state = "Running"
Sivas SRRffa42692018-01-17 05:17:35 -060065
Rahul Maheshwari57a41552019-10-22 01:02:23 -050066 # xpath for main menu.
67 xpath_select_server_control = "//button[contains(@class,'btn-control')]"
Patrick Williams20f38712022-12-08 06:18:26 -060068 xpath_select_server_configuration = (
69 "//button[contains(@class,'btn-config')]"
70 )
71 xpath_select_access_control = (
72 "//button[contains(@class,'btn-access-control')]"
73 )
Rahul Maheshwari57a41552019-10-22 01:02:23 -050074
75 # xpath for sub main menu.
Patrick Williams20f38712022-12-08 06:18:26 -060076 xpath_select_server_power_operations = (
77 "//a[@href='#/server-control/power-operations']"
78 )
Rahul Maheshwaridd3bb602019-10-23 13:31:33 -050079 xpath_select_snmp_settings = "//a[@href='#/configuration/snmp']"
Patrick Williams20f38712022-12-08 06:18:26 -060080 xpath_select_manage_power_usage = (
81 "//a[@href='#/server-control/power-usage']"
82 )
Rahul Maheshwari23decff2019-10-29 00:55:53 -050083 xpath_select_virtual_media = "//a[@href='#/server-control/virtual-media']"
84 xpath_select_sol_console = "//a[@href='#/server-control/remote-console']"
85 xpath_select_reboot_bmc = "//a[@href='#/server-control/bmc-reboot']"
86 xpath_select_ldap = "//a[@href='#/access-control/ldap']"
87 xpath_select_server_health = "//a[@href='#/server-health/event-log']"
Anusha Dathatrif0821d42019-10-29 21:07:00 -050088 xpath_select_server_led = "//a[@href='#/server-control/server-led']"
Anusha Dathatric8ca7682019-10-30 01:38:31 -050089 xpath_select_date_time_settings = "//a[@href='#/configuration/date-time']"
Anusha Dathatridc74fdc2019-11-13 01:19:43 -060090 xpath_select_local_users = "//a[@href='#/access-control/local-users']"
Rahul Maheshwari57a41552019-10-22 01:02:23 -050091
Rahul Maheshwaridbbf1792018-10-31 05:36:29 -050092 # GUI header elements locators.
Patrick Williams20f38712022-12-08 06:18:26 -060093 xpath_select_server_power = (
94 "//a[@href='#/server-control/power-operations']"
95 )
Rahul Maheshwaridbbf1792018-10-31 05:36:29 -050096
Sivas SRR008dcc62018-02-27 06:34:56 -060097 # Server health elements locators.
Patrick Williams20f38712022-12-08 06:18:26 -060098 xpath_select_refresh_button = "//*[contains(text(),'Refresh')]"
99 xpath_event_severity_all = (
100 "//*[text()='Filter by severity']/following-sibling::button[1]"
101 )
102 xpath_event_severity_high = (
103 "//*[text()='Filter by severity']/following-sibling::button[2]"
104 )
105 xpath_event_severity_medium = (
106 "//*[text()='Filter by severity']/following-sibling::button[3]"
107 )
108 xpath_event_severity_low = (
109 "//*[text()='Filter by severity']/following-sibling::button[4]"
110 )
111 xpath_drop_down_timezone_edt = (
Sivas SRR008dcc62018-02-27 06:34:56 -0600112 "//*[@id='event-log']/section[1]/div/div/button"
Patrick Williams20f38712022-12-08 06:18:26 -0600113 )
Sivas SRR008dcc62018-02-27 06:34:56 -0600114 xpath_refresh_circle = "/html/body/main/loader/div[1]/svg/circle"
Patrick Williams20f38712022-12-08 06:18:26 -0600115 xpath_drop_down_timezone_utc = (
Sivas SRR008dcc62018-02-27 06:34:56 -0600116 "//*[@id='event-log']/section[1]/div/div/ul/li[2]/button"
Patrick Williams20f38712022-12-08 06:18:26 -0600117 )
Anusha Dathatricae580a2019-10-16 06:17:19 -0500118 xpath_event_filter_all = "//*[text()='All events']"
119 xpath_event_filter_resolved = "//*[text()='Resolved events']"
120 xpath_event_filter_unresolved = "//*[text()='Unresolved events']"
Patrick Williams20f38712022-12-08 06:18:26 -0600121 xpath_event_action_bars = "//*[@id='event__actions-bar']/div[1]/label/span"
122 xpath_event_action_delete = (
Sivas SRR3e1a83b2018-03-12 07:52:07 -0500123 "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]"
Patrick Williams20f38712022-12-08 06:18:26 -0600124 )
125 xpath_event_action_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a"
126 xpath_number_of_events = "//*[@id='event__actions-bar']/div[2]/p[2]/span"
127 xpath_mark_as_resolved = (
Sivas SRRbe026912018-03-14 11:33:02 -0500128 "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]"
Patrick Williams20f38712022-12-08 06:18:26 -0600129 )
Sivas SRRbe026912018-03-14 11:33:02 -0500130 xpath_events_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a"
Anusha Dathatricae580a2019-10-16 06:17:19 -0500131 xpath_individual_event_select = "(//*[@class='control__indicator'])[2]"
Patrick Williams20f38712022-12-08 06:18:26 -0600132 xpath_individual_event_delete = (
Sivas SRR2631b632018-04-04 11:33:21 -0500133 "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]"
Patrick Williams20f38712022-12-08 06:18:26 -0600134 )
Anusha Dathatricae580a2019-10-16 06:17:19 -0500135 xpath_second_event_select = "(//*[@class='control__indicator'])[3]"
Patrick Williams20f38712022-12-08 06:18:26 -0600136 xpath_individual_event_resolved = (
Sivas SRR2631b632018-04-04 11:33:21 -0500137 "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]"
Patrick Williams20f38712022-12-08 06:18:26 -0600138 )
139 xpath_individual_event_export = (
Sivas SRR1a94d002018-04-06 08:48:58 -0500140 "//*[@id='event__actions-bar']/div[2]/div[2]/a"
Patrick Williams20f38712022-12-08 06:18:26 -0600141 )
Anusha Dathatricae580a2019-10-16 06:17:19 -0500142 xpath_select_all_events = "(//*[@class='control__indicator'])[1]"