George Keishing | e7e9171 | 2021-09-03 11:28:44 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 2 | |
| 3 | r""" |
| 4 | Contains xpaths and related string constants applicable to all openBMC GUI |
| 5 | menus. |
| 6 | """ |
| 7 | |
| 8 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 9 | class resource_variables: |
George Keishing | fdd2dcf | 2023-02-10 00:46:47 -0600 | [diff] [blame] | 10 | r""" |
| 11 | Base class for GUI resource related XPATH variables. |
| 12 | """ |
George Keishing | 9c22309 | 2024-01-29 21:18:25 +0530 | [diff] [blame] | 13 | |
Rahul Maheshwari | 314cd9f | 2019-04-02 01:13:39 -0500 | [diff] [blame] | 14 | xpath_textbox_hostname = "//input[@id='host']" |
| 15 | xpath_textbox_username = "//input[@id='username']" |
| 16 | xpath_textbox_password = "//input[@id='password']" |
Anves Kumar rayankula | 9233ce1 | 2020-06-17 00:14:41 -0500 | [diff] [blame] | 17 | xpath_input_password = "//input[@id='password']" |
| 18 | xpath_input_confirm_password = "//input[@id='passwordConfirm']" |
| 19 | xpath_submit_button = '//button[@type="submit"]' |
| 20 | xpath_button_profile_settings = '//a[@href="#/profile-settings"]' |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 21 | xpath_button_login = "//*[@id='login__submit']" |
Rahul Maheshwari | 31b3c43 | 2020-06-26 05:24:13 -0500 | [diff] [blame] | 22 | xpath_button_user_action = "//button[@id='user-actions']" |
| 23 | xpath_button_logout = '//button[text()="Log out"]' |
Rahul Maheshwari | 65f6944 | 2018-11-27 04:43:00 -0600 | [diff] [blame] | 24 | xpath_yes_button = "//button[text()='Yes']" |
Rahul Maheshwari | 8b5b5a4 | 2018-11-30 01:41:35 -0600 | [diff] [blame] | 25 | xpath_power_indicator = "//*[@id='power-indicator-bar']" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 26 | xpath_select_button_power_on = "//*[@id='power__power-on']" |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 27 | xpath_cancel_button = "//button[contains(text(),'Cancel')]" |
| 28 | xpath_save_setting_button = "//button[contains(text(),'Save settings')]" |
Anusha Dathatri | bb20cb0 | 2019-11-13 10:32:27 -0600 | [diff] [blame] | 29 | xpath_save_button = "//button[contains(text(),'Save')]" |
Anusha Dathatri | e9650a6 | 2019-11-15 04:02:24 -0600 | [diff] [blame] | 30 | xpath_remove_button = "//button[contains(text(),'Remove')]" |
| 31 | xpath_add_button = "//button[@type='submit']" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 32 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 33 | xpath_select_button_warm_reboot = "//*[@id='power__warm-boot']" |
| 34 | xpath_operation_warning_message = "//*[@class='inline__confirm active']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 35 | text_warm_reboot_warning_message = "warm reboot?" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 36 | xpath_select_button_warm_reboot_yes = ( |
| 37 | "//*[@id='power-operations']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 38 | "/div[3]/div[3]/confirm/div/div[2]/button[1]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 39 | ) |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 40 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 41 | xpath_select_button_cold_reboot = "//*[@id='power__cold-boot']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 42 | text_cold_reboot_warning_message = "cold reboot?" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 43 | xpath_select_button_cold_reboot_yes = ( |
| 44 | "//*[@id='power-operations']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 45 | "/div[3]/div[4]/confirm/div/div[2]/button[2]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 46 | ) |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 47 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 48 | xpath_select_button_orderly_shutdown = "//*[@id='power__soft-shutdown']" |
| 49 | xpath_select_button_orderly_shutdown_button_no = ( |
| 50 | "//*[@id='power-operations']/div[3]/div[5]" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 51 | "/confirm/div/div[2]/button[2]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 52 | ) |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 53 | text_orderly_shutdown_warning_message = "orderly shutdown?" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 54 | xpath_select_button_orderly_shutdown_yes = ( |
| 55 | "//*[@id='power-operations']/div[3]/div[5]" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 56 | "/confirm/div/div[2]/button[1]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 57 | ) |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 58 | |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 59 | xpath_select_button_immediate_shutdown = "//*[@id='power__hard-shutdown']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 60 | text_immediate_shutdown_warning_message = "immediate shutdown?" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 61 | xpath_select_button_immediate_shutdown_yes = ( |
| 62 | "//*[@id='power-operations']/div[3]/div[6]" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 63 | "/confirm/div/div[2]/button[1]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 64 | ) |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 65 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 66 | obmc_off_state = "Off" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 67 | obmc_standby_state = "Standby" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 68 | obmc_running_state = "Running" |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 69 | |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 70 | # xpath for main menu. |
| 71 | xpath_select_server_control = "//button[contains(@class,'btn-control')]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 72 | xpath_select_server_configuration = ( |
| 73 | "//button[contains(@class,'btn-config')]" |
| 74 | ) |
| 75 | xpath_select_access_control = ( |
| 76 | "//button[contains(@class,'btn-access-control')]" |
| 77 | ) |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 78 | |
| 79 | # xpath for sub main menu. |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 80 | xpath_select_server_power_operations = ( |
| 81 | "//a[@href='#/server-control/power-operations']" |
| 82 | ) |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 83 | xpath_select_snmp_settings = "//a[@href='#/configuration/snmp']" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 84 | xpath_select_manage_power_usage = ( |
| 85 | "//a[@href='#/server-control/power-usage']" |
| 86 | ) |
Rahul Maheshwari | 23decff | 2019-10-29 00:55:53 -0500 | [diff] [blame] | 87 | xpath_select_virtual_media = "//a[@href='#/server-control/virtual-media']" |
| 88 | xpath_select_sol_console = "//a[@href='#/server-control/remote-console']" |
| 89 | xpath_select_reboot_bmc = "//a[@href='#/server-control/bmc-reboot']" |
| 90 | xpath_select_ldap = "//a[@href='#/access-control/ldap']" |
| 91 | xpath_select_server_health = "//a[@href='#/server-health/event-log']" |
Anusha Dathatri | f0821d4 | 2019-10-29 21:07:00 -0500 | [diff] [blame] | 92 | xpath_select_server_led = "//a[@href='#/server-control/server-led']" |
Anusha Dathatri | c8ca768 | 2019-10-30 01:38:31 -0500 | [diff] [blame] | 93 | xpath_select_date_time_settings = "//a[@href='#/configuration/date-time']" |
Anusha Dathatri | dc74fdc | 2019-11-13 01:19:43 -0600 | [diff] [blame] | 94 | xpath_select_local_users = "//a[@href='#/access-control/local-users']" |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 95 | |
Rahul Maheshwari | dbbf179 | 2018-10-31 05:36:29 -0500 | [diff] [blame] | 96 | # GUI header elements locators. |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 97 | xpath_select_server_power = ( |
| 98 | "//a[@href='#/server-control/power-operations']" |
| 99 | ) |
Rahul Maheshwari | dbbf179 | 2018-10-31 05:36:29 -0500 | [diff] [blame] | 100 | |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 101 | # Server health elements locators. |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 102 | xpath_select_refresh_button = "//*[contains(text(),'Refresh')]" |
| 103 | xpath_event_severity_all = ( |
| 104 | "//*[text()='Filter by severity']/following-sibling::button[1]" |
| 105 | ) |
| 106 | xpath_event_severity_high = ( |
| 107 | "//*[text()='Filter by severity']/following-sibling::button[2]" |
| 108 | ) |
| 109 | xpath_event_severity_medium = ( |
| 110 | "//*[text()='Filter by severity']/following-sibling::button[3]" |
| 111 | ) |
| 112 | xpath_event_severity_low = ( |
| 113 | "//*[text()='Filter by severity']/following-sibling::button[4]" |
| 114 | ) |
| 115 | xpath_drop_down_timezone_edt = ( |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 116 | "//*[@id='event-log']/section[1]/div/div/button" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 117 | ) |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 118 | xpath_refresh_circle = "/html/body/main/loader/div[1]/svg/circle" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 119 | xpath_drop_down_timezone_utc = ( |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 120 | "//*[@id='event-log']/section[1]/div/div/ul/li[2]/button" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 121 | ) |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 122 | xpath_event_filter_all = "//*[text()='All events']" |
| 123 | xpath_event_filter_resolved = "//*[text()='Resolved events']" |
| 124 | xpath_event_filter_unresolved = "//*[text()='Unresolved events']" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 125 | xpath_event_action_bars = "//*[@id='event__actions-bar']/div[1]/label/span" |
| 126 | xpath_event_action_delete = ( |
Sivas SRR | 3e1a83b | 2018-03-12 07:52:07 -0500 | [diff] [blame] | 127 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 128 | ) |
| 129 | xpath_event_action_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
| 130 | xpath_number_of_events = "//*[@id='event__actions-bar']/div[2]/p[2]/span" |
| 131 | xpath_mark_as_resolved = ( |
Sivas SRR | be02691 | 2018-03-14 11:33:02 -0500 | [diff] [blame] | 132 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 133 | ) |
Sivas SRR | be02691 | 2018-03-14 11:33:02 -0500 | [diff] [blame] | 134 | xpath_events_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 135 | xpath_individual_event_select = "(//*[@class='control__indicator'])[2]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 136 | xpath_individual_event_delete = ( |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 137 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 138 | ) |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 139 | xpath_second_event_select = "(//*[@class='control__indicator'])[3]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 140 | xpath_individual_event_resolved = ( |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 141 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 142 | ) |
| 143 | xpath_individual_event_export = ( |
Sivas SRR | 1a94d00 | 2018-04-06 08:48:58 -0500 | [diff] [blame] | 144 | "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 145 | ) |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 146 | xpath_select_all_events = "(//*[@class='control__indicator'])[1]" |