Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | r""" |
| 4 | Contains xpaths and related string constants applicable to all openBMC GUI |
| 5 | menus. |
| 6 | """ |
| 7 | |
| 8 | |
| 9 | class resource_variables(): |
| 10 | |
Rahul Maheshwari | 314cd9f | 2019-04-02 01:13:39 -0500 | [diff] [blame] | 11 | xpath_textbox_hostname = "//input[@id='host']" |
| 12 | xpath_textbox_username = "//input[@id='username']" |
| 13 | xpath_textbox_password = "//input[@id='password']" |
Anves Kumar rayankula | 9233ce1 | 2020-06-17 00:14:41 -0500 | [diff] [blame] | 14 | xpath_input_password = "//input[@id='password']" |
| 15 | xpath_input_confirm_password = "//input[@id='passwordConfirm']" |
| 16 | xpath_submit_button = '//button[@type="submit"]' |
| 17 | xpath_button_profile_settings = '//a[@href="#/profile-settings"]' |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 18 | xpath_button_login = "//*[@id='login__submit']" |
Rahul Maheshwari | 31b3c43 | 2020-06-26 05:24:13 -0500 | [diff] [blame] | 19 | xpath_button_user_action = "//button[@id='user-actions']" |
| 20 | xpath_button_logout = '//button[text()="Log out"]' |
Rahul Maheshwari | 65f6944 | 2018-11-27 04:43:00 -0600 | [diff] [blame] | 21 | xpath_yes_button = "//button[text()='Yes']" |
Rahul Maheshwari | 8b5b5a4 | 2018-11-30 01:41:35 -0600 | [diff] [blame] | 22 | xpath_power_indicator = "//*[@id='power-indicator-bar']" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 23 | xpath_select_button_power_on = "//*[@id='power__power-on']" |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 24 | xpath_cancel_button = "//button[contains(text(),'Cancel')]" |
| 25 | xpath_save_setting_button = "//button[contains(text(),'Save settings')]" |
Anusha Dathatri | bb20cb0 | 2019-11-13 10:32:27 -0600 | [diff] [blame] | 26 | xpath_save_button = "//button[contains(text(),'Save')]" |
Anusha Dathatri | e9650a6 | 2019-11-15 04:02:24 -0600 | [diff] [blame] | 27 | xpath_remove_button = "//button[contains(text(),'Remove')]" |
| 28 | xpath_add_button = "//button[@type='submit']" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 29 | |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 30 | xpath_select_button_warm_reboot = \ |
| 31 | "//*[@id='power__warm-boot']" |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 32 | xpath_operation_warning_message = \ |
| 33 | "//*[@class='inline__confirm active']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 34 | text_warm_reboot_warning_message = "warm reboot?" |
| 35 | xpath_select_button_warm_reboot_yes = \ |
| 36 | "//*[@id='power-operations']" \ |
| 37 | "/div[3]/div[3]/confirm/div/div[2]/button[1]" |
| 38 | |
| 39 | xpath_select_button_cold_reboot = \ |
| 40 | "//*[@id='power__cold-boot']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 41 | text_cold_reboot_warning_message = "cold reboot?" |
| 42 | xpath_select_button_cold_reboot_yes = \ |
| 43 | "//*[@id='power-operations']" \ |
| 44 | "/div[3]/div[4]/confirm/div/div[2]/button[2]" |
| 45 | |
| 46 | xpath_select_button_orderly_shutdown = \ |
| 47 | "//*[@id='power__soft-shutdown']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 48 | xpath_select_button_orderly_shutdown_button_no = \ |
| 49 | "//*[@id='power-operations']/div[3]/div[5]"\ |
| 50 | "/confirm/div/div[2]/button[2]" |
| 51 | text_orderly_shutdown_warning_message = "orderly shutdown?" |
| 52 | xpath_select_button_orderly_shutdown_yes = \ |
| 53 | "//*[@id='power-operations']/div[3]/div[5]" \ |
| 54 | "/confirm/div/div[2]/button[1]" |
| 55 | |
| 56 | xpath_select_button_immediate_shutdown = \ |
| 57 | "//*[@id='power__hard-shutdown']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 58 | text_immediate_shutdown_warning_message = "immediate shutdown?" |
| 59 | xpath_select_button_immediate_shutdown_yes = \ |
| 60 | "//*[@id='power-operations']/div[3]/div[6]" \ |
| 61 | "/confirm/div/div[2]/button[1]" |
| 62 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 63 | obmc_off_state = "Off" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 64 | obmc_standby_state = "Standby" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 65 | obmc_running_state = "Running" |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 66 | |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 67 | # xpath for main menu. |
| 68 | xpath_select_server_control = "//button[contains(@class,'btn-control')]" |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 69 | xpath_select_server_configuration = "//button[contains(@class,'btn-config')]" |
Rahul Maheshwari | 2bc8c08 | 2019-11-01 09:35:01 -0500 | [diff] [blame] | 70 | xpath_select_access_control = "//button[contains(@class,'btn-access-control')]" |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 71 | |
| 72 | # xpath for sub main menu. |
| 73 | xpath_select_server_power_operations = "//a[@href='#/server-control/power-operations']" |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 74 | xpath_select_snmp_settings = "//a[@href='#/configuration/snmp']" |
Rahul Maheshwari | 23decff | 2019-10-29 00:55:53 -0500 | [diff] [blame] | 75 | xpath_select_manage_power_usage = "//a[@href='#/server-control/power-usage']" |
| 76 | xpath_select_virtual_media = "//a[@href='#/server-control/virtual-media']" |
| 77 | xpath_select_sol_console = "//a[@href='#/server-control/remote-console']" |
| 78 | xpath_select_reboot_bmc = "//a[@href='#/server-control/bmc-reboot']" |
| 79 | xpath_select_ldap = "//a[@href='#/access-control/ldap']" |
| 80 | xpath_select_server_health = "//a[@href='#/server-health/event-log']" |
Anusha Dathatri | f0821d4 | 2019-10-29 21:07:00 -0500 | [diff] [blame] | 81 | xpath_select_server_led = "//a[@href='#/server-control/server-led']" |
Anusha Dathatri | c8ca768 | 2019-10-30 01:38:31 -0500 | [diff] [blame] | 82 | xpath_select_date_time_settings = "//a[@href='#/configuration/date-time']" |
Anusha Dathatri | dc74fdc | 2019-11-13 01:19:43 -0600 | [diff] [blame] | 83 | xpath_select_local_users = "//a[@href='#/access-control/local-users']" |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 84 | |
Rahul Maheshwari | dbbf179 | 2018-10-31 05:36:29 -0500 | [diff] [blame] | 85 | # GUI header elements locators. |
| 86 | xpath_select_server_power = "//a[@href='#/server-control/power-operations']" |
| 87 | |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 88 | # Server health elements locators. |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 89 | xpath_select_refresh_button = \ |
Anusha Dathatri | 2513ae5 | 2019-09-18 05:18:46 -0500 | [diff] [blame] | 90 | "//*[contains(text(),'Refresh')]" |
Anusha Dathatri | dadb75e | 2019-10-15 04:20:52 -0500 | [diff] [blame] | 91 | xpath_event_severity_all = "//*[text()='Filter by severity']/following-sibling::button[1]" |
| 92 | xpath_event_severity_high = "//*[text()='Filter by severity']/following-sibling::button[2]" |
| 93 | xpath_event_severity_medium = "//*[text()='Filter by severity']/following-sibling::button[3]" |
| 94 | xpath_event_severity_low = "//*[text()='Filter by severity']/following-sibling::button[4]" |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 95 | xpath_drop_down_timezone_edt = \ |
| 96 | "//*[@id='event-log']/section[1]/div/div/button" |
| 97 | xpath_refresh_circle = "/html/body/main/loader/div[1]/svg/circle" |
| 98 | xpath_drop_down_timezone_utc = \ |
| 99 | "//*[@id='event-log']/section[1]/div/div/ul/li[2]/button" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 100 | xpath_event_filter_all = "//*[text()='All events']" |
| 101 | xpath_event_filter_resolved = "//*[text()='Resolved events']" |
| 102 | xpath_event_filter_unresolved = "//*[text()='Unresolved events']" |
Sivas SRR | 3e1a83b | 2018-03-12 07:52:07 -0500 | [diff] [blame] | 103 | xpath_event_action_bars = \ |
| 104 | "//*[@id='event__actions-bar']/div[1]/label/span" |
| 105 | xpath_event_action_delete = \ |
| 106 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
| 107 | xpath_event_action_export = \ |
| 108 | "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
| 109 | xpath_number_of_events = \ |
| 110 | "//*[@id='event__actions-bar']/div[2]/p[2]/span" |
Sivas SRR | be02691 | 2018-03-14 11:33:02 -0500 | [diff] [blame] | 111 | xpath_mark_as_resolved = \ |
| 112 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
| 113 | xpath_events_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 114 | xpath_individual_event_select = "(//*[@class='control__indicator'])[2]" |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 115 | xpath_individual_event_delete = \ |
| 116 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 117 | xpath_second_event_select = "(//*[@class='control__indicator'])[3]" |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 118 | xpath_individual_event_resolved = \ |
| 119 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
Sivas SRR | 1a94d00 | 2018-04-06 08:48:58 -0500 | [diff] [blame] | 120 | xpath_individual_event_export = \ |
| 121 | "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 122 | xpath_select_all_events = "(//*[@class='control__indicator'])[1]" |
Rahul Maheshwari | f3fa674 | 2020-05-18 06:24:04 -0500 | [diff] [blame] | 123 | |
| 124 | # New GUI variables |
| 125 | xpath_login_button = "//button[@type='submit']" |
Sushma M M | ff03a21 | 2020-08-18 07:32:50 -0500 | [diff] [blame] | 126 | xpath_logout_button = "//*[@data-test-id='appHeader-link-logout']" |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 127 | |
Rahul Maheshwari | b940e19 | 2020-07-07 01:52:24 -0500 | [diff] [blame] | 128 | # xpath for overview menu |
Sushma M M | d690508 | 2020-11-11 21:07:15 -0600 | [diff] [blame] | 129 | xpath_overview_menu = "//*[@data-test-id='nav-item-overview']" |
Sushma M M | 7fe0b42 | 2020-08-19 05:59:24 -0500 | [diff] [blame] | 130 | |
| 131 | # xpath for header |
Sushma M M | 0125f0c | 2020-08-12 21:43:32 -0500 | [diff] [blame] | 132 | xpath_root_button_menu = "//*[@id='app-header-user__BV_toggle_']" |
Sushma M M | cd0ffcd | 2020-11-11 19:22:59 -0600 | [diff] [blame] | 133 | xpath_profile_settings = "//*[@data-test-id='appHeader-link-profile']" |
Sushma M M | 7fe0b42 | 2020-08-19 05:59:24 -0500 | [diff] [blame] | 134 | xpath_server_health_header = "//*[@data-test-id='appHeader-container-health']" |
Rahul Maheshwari | e5bb57b | 2020-08-28 06:43:34 -0500 | [diff] [blame] | 135 | xpath_event_header = "//h1[text()='Event logs']" |
Sushma M M | 0ecc735 | 2020-08-20 01:19:35 -0500 | [diff] [blame] | 136 | xpath_server_power_header = "//*[@data-test-id='appHeader-container-power']" |
manashsarma | 2544cb1 | 2020-08-23 14:25:08 -0500 | [diff] [blame] | 137 | xpath_refresh_button = "//*[@data-test-id='appHeader-button-refresh']" |
manashsarma | 43568c2 | 2020-08-19 12:16:24 -0500 | [diff] [blame] | 138 | xpath_network_page_header = "//h1[contains(text(), 'Network settings')]" |
manashsarma | 73d24f1 | 2020-08-25 07:42:53 -0500 | [diff] [blame] | 139 | xpath_sol_header = "//h1[contains(text(), 'Serial over LAN console')]" |
Rahul Maheshwari | b037426 | 2020-11-02 01:38:31 -0600 | [diff] [blame] | 140 | xpath_sol_console_heading = "//h1[text()='Serial over LAN (SOL) console']" |
Rahul Maheshwari | b940e19 | 2020-07-07 01:52:24 -0500 | [diff] [blame] | 141 | |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 142 | # xpath for health menu |
Anusha Dathatri | c2e11d1 | 2020-10-16 02:11:09 -0500 | [diff] [blame] | 143 | xpath_health_menu = "//*[@data-test-id='nav-button-health']" |
Rahul Maheshwari | e3819ed | 2020-11-13 02:56:49 -0600 | [diff] [blame] | 144 | xpath_event_logs_sub_menu = "//*[@data-test-id='nav-item-event-logs']" |
| 145 | xpath_sensor_sub_menu = "//*[@data-test-id='nav-item-sensors']" |
Anusha Dathatri | bc74d0f | 2020-11-10 03:01:42 -0600 | [diff] [blame] | 146 | xpath_hardware_status_sub_menu = "//*[@data-test-id='nav-item-hardware-status']" |
Rahul Maheshwari | d29cf30 | 2020-07-07 03:13:17 -0500 | [diff] [blame] | 147 | |
Rahul Maheshwari | 1e18bb6 | 2020-07-07 00:45:50 -0500 | [diff] [blame] | 148 | # xpath for control menu |
Anusha Dathatri | c2e11d1 | 2020-10-16 02:11:09 -0500 | [diff] [blame] | 149 | xpath_control_menu = "//*[@data-test-id='nav-button-control']" |
Rahul Maheshwari | e3819ed | 2020-11-13 02:56:49 -0600 | [diff] [blame] | 150 | xpath_manage_power_usage_sub_menu = "//*[@data-test-id='nav-item-manage-power-usage']" |
| 151 | xpath_reboot_bmc_sub_menu = "//*[@data-test-id='nav-item-reboot-bmc']" |
| 152 | xpath_server_led_sub_menu = "//*[@data-test-id='nav-item-server-led']" |
| 153 | xpath_server_power_operations_sub_menu = "//*[@data-test-id='nav-item-server-power-operations']" |
| 154 | xpath_sol_sub_menu = "//*[@data-test-id='nav-item-serial-over-lan']" |
| 155 | xpath_kvm_sub_menu = "//*[@data-test-id='nav-item-kvm']" |
Anusha Dathatri | 21ac59f | 2020-07-14 13:12:58 -0500 | [diff] [blame] | 156 | |
| 157 | # xpath for configuration menu |
Anusha Dathatri | c2e11d1 | 2020-10-16 02:11:09 -0500 | [diff] [blame] | 158 | xpath_server_configuration = "//*[@data-test-id='nav-button-configuration']" |
Rahul Maheshwari | e3819ed | 2020-11-13 02:56:49 -0600 | [diff] [blame] | 159 | xpath_select_network_settings = "//*[@data-test-id='nav-item-network-settings']" |
| 160 | xpath_date_time_settings_sub_menu = "//*[@data-test-id='nav-item-date-time-settings']" |
| 161 | xpath_firmware_update_sub_menu = "//*[@data-test-id='nav-item-firmware']" |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 162 | |
| 163 | # xpath for access control menu |
Anusha Dathatri | c2e11d1 | 2020-10-16 02:11:09 -0500 | [diff] [blame] | 164 | xpath_access_control_menu = "//*[@data-test-id='nav-button-access-control']" |
Rahul Maheshwari | e3819ed | 2020-11-13 02:56:49 -0600 | [diff] [blame] | 165 | xpath_ldap_sub_menu = "//*[@data-test-id='nav-item-ldap']" |
Sushma M M | ef474f4 | 2020-07-29 16:25:39 -0500 | [diff] [blame] | 166 | xpath_save_settings_button = "//button[contains(text(),'Save settings')]" |
Rahul Maheshwari | e3819ed | 2020-11-13 02:56:49 -0600 | [diff] [blame] | 167 | xpath_local_user_management_sub_menu = "//*[@data-test-id='nav-item-local-user-management']" |
| 168 | xpath_ssl_certificates_sub_menu = "//*[@data-test-id='nav-item-ssl-certificates']" |