| George Keishing | e7e9171 | 2021-09-03 11:28:44 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 2 |  | 
|  | 3 | r""" | 
|  | 4 | Contains xpaths and related string constants applicable for new Vue based OpenBMC GUI. | 
|  | 5 | """ | 
|  | 6 |  | 
|  | 7 |  | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 8 | class gui_variables: | 
| George Keishing | 5f1525a | 2023-02-09 23:23:31 -0600 | [diff] [blame] | 9 | r""" | 
|  | 10 | Base class for GUI related XPATH variables. | 
|  | 11 | """ | 
|  | 12 |  | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 13 | # Login page | 
| rramyasr-in | d1ae7fa | 2023-02-20 11:00:41 -0600 | [diff] [blame] | 14 | xpath_login_hostname_input = "//input[@id='host']" | 
|  | 15 | xpath_login_username_input = "//*[@data-test-id='login-input-username']" | 
|  | 16 | xpath_login_password_input = "//*[@data-test-id='login-input-password']" | 
| Rahul Maheshwari | e5d9c31 | 2021-01-31 23:56:20 -0600 | [diff] [blame] | 17 | xpath_login_button = "//*[@data-test-id='login-button-submit']" | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 18 | xpath_logout_button = "//*[@data-test-id='appHeader-link-logout']" | 
|  | 19 |  | 
|  | 20 | # Overview menu | 
|  | 21 | xpath_overview_menu = "//*[@data-test-id='nav-item-overview']" | 
|  | 22 |  | 
|  | 23 | # GUI header | 
| Rahul Maheshwari | e5d9c31 | 2021-01-31 23:56:20 -0600 | [diff] [blame] | 24 | xpath_root_button_menu = "//*[@data-test-id='appHeader-container-user']" | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 25 | xpath_profile_settings = "//*[@data-test-id='appHeader-link-profile']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 26 | xpath_server_health_header = ( | 
|  | 27 | "//*[@data-test-id='appHeader-container-health']" | 
|  | 28 | ) | 
|  | 29 | xpath_server_power_header = ( | 
|  | 30 | "//*[@data-test-id='appHeader-container-power']" | 
|  | 31 | ) | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 32 | xpath_refresh_button = "//*[@data-test-id='appHeader-button-refresh']" | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 33 |  | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 34 | # Logs menu | 
|  | 35 | xpath_logs_menu = "//*[@data-test-id='nav-button-logs']" | 
| Rahul Maheshwari | bce8f71 | 2021-06-01 06:26:48 -0500 | [diff] [blame] | 36 | xpath_dumps_sub_menu = "//*[@data-test-id='nav-item-dumps']" | 
| rramyasr-in | 305d23a | 2022-01-19 01:32:04 -0600 | [diff] [blame] | 37 | xpath_dumps_header = "//h1[text()='Dumps']" | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 38 | xpath_event_logs_sub_menu = "//*[@data-test-id='nav-item-event-logs']" | 
| rramyasr-in | d3b3fcd | 2022-11-18 10:41:14 -0600 | [diff] [blame] | 39 | xpath_event_logs_heading = "//h1[contains(text(), 'Event logs')]" | 
| dnirmala | 619b76c | 2023-03-17 02:40:55 -0500 | [diff] [blame] | 40 | xpath_event_search = "//input[@placeholder='Search logs']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 41 | xpath_progress_logs_sub_menu = ( | 
|  | 42 | "//*[@data-test-id='nav-item-post-code-logs']" | 
|  | 43 | ) | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 44 |  | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 45 | # Hardware status menu | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 46 | xpath_hardware_status_menu = ( | 
|  | 47 | "//*[@data-test-id='nav-button-hardware-status']" | 
|  | 48 | ) | 
|  | 49 | xpath_inventory_and_leds_sub_menu = ( | 
|  | 50 | "//*[@data-test-id='nav-item-inventory']" | 
|  | 51 | ) | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 52 | xpath_sensor_sub_menu = "//*[@data-test-id='nav-item-sensors']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 53 | xpath_inventory_and_leds_heading = ( | 
|  | 54 | "//h1[contains(text(), 'Inventory and LEDs')]" | 
|  | 55 | ) | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 56 |  | 
|  | 57 | # Operations menu | 
|  | 58 | xpath_operations_menu = "//*[@data-test-id='nav-button-operations']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 59 | xpath_factory_reset_sub_menu = ( | 
|  | 60 | "//*[@data-test-id='nav-item-factory-reset']" | 
|  | 61 | ) | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 62 | xpath_firmware_update_sub_menu = "//*[@data-test-id='nav-item-firmware']" | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 63 | xpath_reboot_bmc_sub_menu = "//*[@data-test-id='nav-item-reboot-bmc']" | 
| rramyasr-in | c748740 | 2022-06-28 12:23:50 -0500 | [diff] [blame] | 64 | xpath_host_console_sub_menu = "//*[@data-test-id='nav-item-host-console']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 65 | xpath_server_power_operations_sub_menu = ( | 
|  | 66 | "//*[@data-test-id='nav-item-server-power-operations']" | 
|  | 67 | ) | 
| rramyasr-in | 7017895 | 2022-06-17 06:17:30 -0500 | [diff] [blame] | 68 | xpath_host_console_heading = "//h1[text()='Host console']" | 
| rramyasr-in | d3b3fcd | 2022-11-18 10:41:14 -0600 | [diff] [blame] | 69 | xpath_firmware_heading = "//h1[contains(text(), 'Firmware')]" | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 70 |  | 
|  | 71 | # Settings menu | 
|  | 72 | xpath_settings_menu = "//*[@data-test-id='nav-button-settings']" | 
| rramyasr-in | d3b3fcd | 2022-11-18 10:41:14 -0600 | [diff] [blame] | 73 | xpath_network_heading = "//h1[text()='Network']" | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 74 | xpath_date_time_sub_menu = "//*[@data-test-id='nav-item-date-time']" | 
|  | 75 | xpath_network_sub_menu = "//*[@data-test-id='nav-item-network']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 76 | xpath_power_restore_policy_sub_menu = ( | 
|  | 77 | "//*[@data-test-id='nav-item-power-restore-policy']" | 
|  | 78 | ) | 
| Megha G N | 2a31e51 | 2023-01-18 04:23:20 -0600 | [diff] [blame] | 79 | xpath_static_dns = "//h2[text()='Static DNS']" | 
|  | 80 | xpath_dns_servers_toggle = ( | 
|  | 81 | "//*[@data-test-id='networkSettings-switch-useDns']" | 
|  | 82 | ) | 
|  | 83 | xpath_add_dns_ip_address_button = ( | 
|  | 84 | "//button[contains(text(),'Add IP address')]" | 
|  | 85 | ) | 
|  | 86 | xpath_input_static_dns = "//*[@id='staticDns']" | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 87 |  | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 88 | # Security and access menu | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 89 | xpath_secuity_and_accesss_menu = ( | 
|  | 90 | "//*[@data-test-id='nav-button-security-and-access']" | 
|  | 91 | ) | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 92 | xpath_sessions_sub_menu = "//*[@data-test-id='nav-item-sessions']" | 
| Rahul Maheshwari | 41747da | 2020-11-17 09:09:52 -0600 | [diff] [blame] | 93 | xpath_ldap_sub_menu = "//*[@data-test-id='nav-item-ldap']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 94 | xpath_user_management_sub_menu = ( | 
|  | 95 | "//*[@data-test-id='nav-item-user-management']" | 
|  | 96 | ) | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 97 | xpath_policies_sub_menu = "//*[@data-test-id='nav-item-policies']" | 
|  | 98 | xpath_certificates_sub_menu = "//*[@data-test-id='nav-item-certificates']" | 
|  | 99 |  | 
|  | 100 | # Resource management menu | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 101 | xpath_resource_management_menu = ( | 
|  | 102 | "//*[@data-test-id='nav-button-resource-management']" | 
|  | 103 | ) | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 104 | xpath_power_sub_menu = "//*[@data-test-id='nav-item-power']" | 
| sarandev3 | 66c4be2 | 2023-03-07 06:56:51 -0600 | [diff] [blame] | 105 | xpath_power_link = "//a[@href='#/resource-management/power']" | 
| rramyasr-in | d3b3fcd | 2022-11-18 10:41:14 -0600 | [diff] [blame] | 106 | xpath_power_heading = "//h1[contains(text(), 'Power')]" | 
| Anusha Dathatri | 54edcbc | 2020-12-10 04:04:08 -0600 | [diff] [blame] | 107 |  | 
|  | 108 | # Profile settings | 
|  | 109 | xpath_default_UTC = "//*[@data-test-id='profileSettings-radio-defaultUTC']" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 110 | xpath_profile_save_button = ( | 
|  | 111 | "//*[@data-test-id='profileSettings-button-saveSettings']" | 
|  | 112 | ) | 
| sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 113 | xpath_profile_settings_link = "//a[contains(text(),'Profile Settings')]" | 
| sarandev3 | ff7f34b | 2023-01-16 05:09:20 -0600 | [diff] [blame] | 114 | xpath_profile_settings_heading = "//h1[text()='Profile settings']" | 
|  | 115 | xpath_browser_offset = ( | 
|  | 116 | "//*[@data-test-id='profileSettings-radio-browserOffset']" | 
|  | 117 | ) | 
| sarandev3 | 4d1a737 | 2023-01-27 02:10:38 -0600 | [diff] [blame] | 118 | xpath_browser_offset_textfield = ( | 
|  | 119 | xpath_browser_offset + "/following-sibling::*" | 
|  | 120 | ) | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 121 | xpath_input_password = ( | 
|  | 122 | "//*[@data-test-id='profileSettings-input-newPassword']" | 
|  | 123 | ) | 
|  | 124 | xpath_input_confirm_password = ( | 
|  | 125 | "//*[@data-test-id='profileSettings-input-confirmPassword']" | 
|  | 126 | ) | 
| Rahul Maheshwari | 142642d | 2021-08-24 00:00:15 -0500 | [diff] [blame] | 127 |  | 
|  | 128 | # Common variables | 
| rramyasr-in | 2da4d6f | 2022-11-07 04:31:24 -0600 | [diff] [blame] | 129 | xpath_save_settings_button = "//button[contains(text(),'Save')]" | 
| Ashwini Chandrappa | 233d965 | 2021-08-04 09:56:30 -0500 | [diff] [blame] | 130 | xpath_confirm_button = "//button[contains(text(),'Confirm')]" | 
| meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 131 | xpath_cancel_button = "//button[contains(text(),'Cancel')]" | 
| meghagn | 97f7eb4 | 2022-03-02 02:59:35 -0600 | [diff] [blame] | 132 | xpath_add_button = "//button[normalize-space(text())='Add']" | 
| rramyasr-in | 069b266 | 2025-09-04 03:36:22 -0500 | [diff] [blame] | 133 | xpath_close_information_message = "//button[contains(text(),'×')]" | 
| Patrick Williams | 20f3871 | 2022-12-08 06:18:26 -0600 | [diff] [blame] | 134 | xpath_page_loading_progress_bar = ( | 
|  | 135 | "//*[@aria-label='Page loading progress bar']" | 
|  | 136 | ) | 
| rramyasr-in | 2da4d6f | 2022-11-07 04:31:24 -0600 | [diff] [blame] | 137 |  | 
| rramyasr-in | f133e8b | 2025-08-18 06:48:13 -0500 | [diff] [blame] | 138 | # Pop up variables | 
|  | 139 | xpath_success_message = "//*[contains(text(),'Success')]" | 
|  | 140 | xpath_error_popup = ( | 
|  | 141 | "//*[contains(text(),'Error')]/following-sibling::button" | 
|  | 142 | ) | 
|  | 143 | xpath_unauthorized_popup = ( | 
|  | 144 | "//*[contains(text(),'Unauthorized')]/following-sibling::button" | 
|  | 145 | ) | 
|  | 146 |  | 
| rramyasr-in | 732cc3f | 2022-11-16 05:30:57 -0600 | [diff] [blame] | 147 | # Reboot sub menu | 
| meghagn | 2052fdd | 2021-12-07 02:42:31 -0600 | [diff] [blame] | 148 | xpath_reboot_bmc_heading = "//h1[text()='Reboot BMC']" | 
|  | 149 | xpath_reboot_bmc_button = "//button[contains(text(),'Reboot BMC')]" | 
|  | 150 | xpath_confirm_bmc_reboot = "//*[@class='btn btn-primary']" |