blob: e35e9b54b0d9e93480cea1d67ae62cb29c3d3be8 [file] [log] [blame]
Sathyajith M S4f26ae72018-01-16 04:45:05 -06001#!/usr/bin/python
2
3r"""
4Contains xpaths and related string constants applicable to all openBMC GUI
5menus.
6"""
7
8
9class resource_variables():
10
Rahul Maheshwari314cd9f2019-04-02 01:13:39 -050011 xpath_textbox_hostname = "//input[@id='host']"
12 xpath_textbox_username = "//input[@id='username']"
13 xpath_textbox_password = "//input[@id='password']"
Sathyajith M S4f26ae72018-01-16 04:45:05 -060014 xpath_button_login = "//*[@id='login__submit']"
Anusha Dathatrib2181bf2019-05-15 02:04:37 -050015 xpath_button_logout = '//a[contains(text(), "Log out")]'
Rahul Maheshwari65f69442018-11-27 04:43:00 -060016 xpath_yes_button = "//button[text()='Yes']"
Rahul Maheshwari8b5b5a42018-11-30 01:41:35 -060017 xpath_power_indicator = "//*[@id='power-indicator-bar']"
Sathyajith M S4f26ae72018-01-16 04:45:05 -060018 xpath_select_button_power_on = "//*[@id='power__power-on']"
Rahul Maheshwaridd3bb602019-10-23 13:31:33 -050019 xpath_cancel_button = "//button[contains(text(),'Cancel')]"
20 xpath_save_setting_button = "//button[contains(text(),'Save settings')]"
Sathyajith M S4f26ae72018-01-16 04:45:05 -060021
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060022 xpath_select_button_warm_reboot = \
23 "//*[@id='power__warm-boot']"
Anusha Dathatrif93a5c42019-07-24 05:29:44 -050024 xpath_operation_warning_message = \
25 "//*[@class='inline__confirm active']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060026 text_warm_reboot_warning_message = "warm reboot?"
27 xpath_select_button_warm_reboot_yes = \
28 "//*[@id='power-operations']" \
29 "/div[3]/div[3]/confirm/div/div[2]/button[1]"
30
31 xpath_select_button_cold_reboot = \
32 "//*[@id='power__cold-boot']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060033 text_cold_reboot_warning_message = "cold reboot?"
34 xpath_select_button_cold_reboot_yes = \
35 "//*[@id='power-operations']" \
36 "/div[3]/div[4]/confirm/div/div[2]/button[2]"
37
38 xpath_select_button_orderly_shutdown = \
39 "//*[@id='power__soft-shutdown']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060040 xpath_select_button_orderly_shutdown_button_no = \
41 "//*[@id='power-operations']/div[3]/div[5]"\
42 "/confirm/div/div[2]/button[2]"
43 text_orderly_shutdown_warning_message = "orderly shutdown?"
44 xpath_select_button_orderly_shutdown_yes = \
45 "//*[@id='power-operations']/div[3]/div[5]" \
46 "/confirm/div/div[2]/button[1]"
47
48 xpath_select_button_immediate_shutdown = \
49 "//*[@id='power__hard-shutdown']"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060050 text_immediate_shutdown_warning_message = "immediate shutdown?"
51 xpath_select_button_immediate_shutdown_yes = \
52 "//*[@id='power-operations']/div[3]/div[6]" \
53 "/confirm/div/div[2]/button[1]"
54
Sathyajith M S4f26ae72018-01-16 04:45:05 -060055 obmc_off_state = "Off"
Sathyajith M Sf52d6fc2018-01-24 10:11:18 -060056 obmc_standby_state = "Standby"
Sathyajith M S4f26ae72018-01-16 04:45:05 -060057 obmc_running_state = "Running"
Sivas SRRffa42692018-01-17 05:17:35 -060058
Rahul Maheshwari57a41552019-10-22 01:02:23 -050059 # xpath for main menu.
60 xpath_select_server_control = "//button[contains(@class,'btn-control')]"
Rahul Maheshwaridd3bb602019-10-23 13:31:33 -050061 xpath_select_server_configuration = "//button[contains(@class,'btn-config')]"
Rahul Maheshwari57a41552019-10-22 01:02:23 -050062
63 # xpath for sub main menu.
64 xpath_select_server_power_operations = "//a[@href='#/server-control/power-operations']"
Rahul Maheshwaridd3bb602019-10-23 13:31:33 -050065 xpath_select_snmp_settings = "//a[@href='#/configuration/snmp']"
Rahul Maheshwari23decff2019-10-29 00:55:53 -050066 xpath_select_manage_power_usage = "//a[@href='#/server-control/power-usage']"
67 xpath_select_virtual_media = "//a[@href='#/server-control/virtual-media']"
68 xpath_select_sol_console = "//a[@href='#/server-control/remote-console']"
69 xpath_select_reboot_bmc = "//a[@href='#/server-control/bmc-reboot']"
70 xpath_select_ldap = "//a[@href='#/access-control/ldap']"
71 xpath_select_server_health = "//a[@href='#/server-health/event-log']"
Anusha Dathatrif0821d42019-10-29 21:07:00 -050072 xpath_select_server_led = "//a[@href='#/server-control/server-led']"
Anusha Dathatric8ca7682019-10-30 01:38:31 -050073 xpath_select_date_time_settings = "//a[@href='#/configuration/date-time']"
Rahul Maheshwari57a41552019-10-22 01:02:23 -050074
Rahul Maheshwaridbbf1792018-10-31 05:36:29 -050075 # GUI header elements locators.
76 xpath_select_server_power = "//a[@href='#/server-control/power-operations']"
77
Sivas SRR008dcc62018-02-27 06:34:56 -060078 # Server health elements locators.
Sivas SRR008dcc62018-02-27 06:34:56 -060079 xpath_select_refresh_button = \
Anusha Dathatri2513ae52019-09-18 05:18:46 -050080 "//*[contains(text(),'Refresh')]"
Anusha Dathatridadb75e2019-10-15 04:20:52 -050081 xpath_event_severity_all = "//*[text()='Filter by severity']/following-sibling::button[1]"
82 xpath_event_severity_high = "//*[text()='Filter by severity']/following-sibling::button[2]"
83 xpath_event_severity_medium = "//*[text()='Filter by severity']/following-sibling::button[3]"
84 xpath_event_severity_low = "//*[text()='Filter by severity']/following-sibling::button[4]"
Sivas SRR008dcc62018-02-27 06:34:56 -060085 xpath_drop_down_timezone_edt = \
86 "//*[@id='event-log']/section[1]/div/div/button"
87 xpath_refresh_circle = "/html/body/main/loader/div[1]/svg/circle"
88 xpath_drop_down_timezone_utc = \
89 "//*[@id='event-log']/section[1]/div/div/ul/li[2]/button"
Anusha Dathatricae580a2019-10-16 06:17:19 -050090 xpath_event_filter_all = "//*[text()='All events']"
91 xpath_event_filter_resolved = "//*[text()='Resolved events']"
92 xpath_event_filter_unresolved = "//*[text()='Unresolved events']"
Sivas SRR3e1a83b2018-03-12 07:52:07 -050093 xpath_event_action_bars = \
94 "//*[@id='event__actions-bar']/div[1]/label/span"
95 xpath_event_action_delete = \
96 "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]"
97 xpath_event_action_export = \
98 "//*[@id='event__actions-bar']/div[2]/div[2]/a"
99 xpath_number_of_events = \
100 "//*[@id='event__actions-bar']/div[2]/p[2]/span"
Sivas SRRbe026912018-03-14 11:33:02 -0500101 xpath_mark_as_resolved = \
102 "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]"
103 xpath_events_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a"
Anusha Dathatricae580a2019-10-16 06:17:19 -0500104 xpath_individual_event_select = "(//*[@class='control__indicator'])[2]"
Sivas SRR2631b632018-04-04 11:33:21 -0500105 xpath_individual_event_delete = \
106 "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]"
Anusha Dathatricae580a2019-10-16 06:17:19 -0500107 xpath_second_event_select = "(//*[@class='control__indicator'])[3]"
Sivas SRR2631b632018-04-04 11:33:21 -0500108 xpath_individual_event_resolved = \
109 "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]"
Sivas SRR1a94d002018-04-06 08:48:58 -0500110 xpath_individual_event_export = \
111 "//*[@id='event__actions-bar']/div[2]/div[2]/a"
Anusha Dathatricae580a2019-10-16 06:17:19 -0500112 xpath_select_all_events = "(//*[@class='control__indicator'])[1]"