blob: 8d15e39509e94cd6a9841ac4d0d113582bbd25ca [file] [log] [blame]
George Keishinge7e91712021-09-03 11:28:44 -05001#!/usr/bin/env python3
Rahul Maheshwari41747da2020-11-17 09:09:52 -06002
3r"""
4Contains xpaths and related string constants applicable for new Vue based OpenBMC GUI.
5"""
6
7
Patrick Williams20f38712022-12-08 06:18:26 -06008class gui_variables:
Rahul Maheshwari41747da2020-11-17 09:09:52 -06009 # Login page
10 xpath_textbox_hostname = "//input[@id='host']"
Rahul Maheshwarie5d9c312021-01-31 23:56:20 -060011 xpath_textbox_username = "//*[@data-test-id='login-input-username']"
12 xpath_textbox_password = "//*[@data-test-id='login-input-password']"
13 xpath_login_button = "//*[@data-test-id='login-button-submit']"
Rahul Maheshwari41747da2020-11-17 09:09:52 -060014 xpath_logout_button = "//*[@data-test-id='appHeader-link-logout']"
15
16 # Overview menu
17 xpath_overview_menu = "//*[@data-test-id='nav-item-overview']"
18
19 # GUI header
Rahul Maheshwarie5d9c312021-01-31 23:56:20 -060020 xpath_root_button_menu = "//*[@data-test-id='appHeader-container-user']"
Rahul Maheshwari41747da2020-11-17 09:09:52 -060021 xpath_profile_settings = "//*[@data-test-id='appHeader-link-profile']"
Patrick Williams20f38712022-12-08 06:18:26 -060022 xpath_server_health_header = (
23 "//*[@data-test-id='appHeader-container-health']"
24 )
25 xpath_server_power_header = (
26 "//*[@data-test-id='appHeader-container-power']"
27 )
Rahul Maheshwari41747da2020-11-17 09:09:52 -060028 xpath_refresh_button = "//*[@data-test-id='appHeader-button-refresh']"
Rahul Maheshwari41747da2020-11-17 09:09:52 -060029
Rahul Maheshwari142642d2021-08-24 00:00:15 -050030 # Logs menu
31 xpath_logs_menu = "//*[@data-test-id='nav-button-logs']"
Rahul Maheshwaribce8f712021-06-01 06:26:48 -050032 xpath_dumps_sub_menu = "//*[@data-test-id='nav-item-dumps']"
rramyasr-in305d23a2022-01-19 01:32:04 -060033 xpath_dumps_header = "//h1[text()='Dumps']"
Rahul Maheshwari41747da2020-11-17 09:09:52 -060034 xpath_event_logs_sub_menu = "//*[@data-test-id='nav-item-event-logs']"
rramyasr-ind3b3fcd2022-11-18 10:41:14 -060035 xpath_event_logs_heading = "//h1[contains(text(), 'Event logs')]"
Patrick Williams20f38712022-12-08 06:18:26 -060036 xpath_progress_logs_sub_menu = (
37 "//*[@data-test-id='nav-item-post-code-logs']"
38 )
Rahul Maheshwari41747da2020-11-17 09:09:52 -060039
Rahul Maheshwari142642d2021-08-24 00:00:15 -050040 # Hardware status menu
Patrick Williams20f38712022-12-08 06:18:26 -060041 xpath_hardware_status_menu = (
42 "//*[@data-test-id='nav-button-hardware-status']"
43 )
44 xpath_inventory_and_leds_sub_menu = (
45 "//*[@data-test-id='nav-item-inventory']"
46 )
Rahul Maheshwari142642d2021-08-24 00:00:15 -050047 xpath_sensor_sub_menu = "//*[@data-test-id='nav-item-sensors']"
Patrick Williams20f38712022-12-08 06:18:26 -060048 xpath_inventory_and_leds_heading = (
49 "//h1[contains(text(), 'Inventory and LEDs')]"
50 )
Rahul Maheshwari142642d2021-08-24 00:00:15 -050051
52 # Operations menu
53 xpath_operations_menu = "//*[@data-test-id='nav-button-operations']"
Patrick Williams20f38712022-12-08 06:18:26 -060054 xpath_factory_reset_sub_menu = (
55 "//*[@data-test-id='nav-item-factory-reset']"
56 )
Rahul Maheshwari142642d2021-08-24 00:00:15 -050057 xpath_firmware_update_sub_menu = "//*[@data-test-id='nav-item-firmware']"
Rahul Maheshwari41747da2020-11-17 09:09:52 -060058 xpath_reboot_bmc_sub_menu = "//*[@data-test-id='nav-item-reboot-bmc']"
rramyasr-inc7487402022-06-28 12:23:50 -050059 xpath_host_console_sub_menu = "//*[@data-test-id='nav-item-host-console']"
Patrick Williams20f38712022-12-08 06:18:26 -060060 xpath_server_power_operations_sub_menu = (
61 "//*[@data-test-id='nav-item-server-power-operations']"
62 )
rramyasr-in70178952022-06-17 06:17:30 -050063 xpath_host_console_heading = "//h1[text()='Host console']"
rramyasr-ind3b3fcd2022-11-18 10:41:14 -060064 xpath_firmware_heading = "//h1[contains(text(), 'Firmware')]"
Rahul Maheshwari142642d2021-08-24 00:00:15 -050065
66 # Settings menu
67 xpath_settings_menu = "//*[@data-test-id='nav-button-settings']"
rramyasr-ind3b3fcd2022-11-18 10:41:14 -060068 xpath_network_heading = "//h1[text()='Network']"
Rahul Maheshwari142642d2021-08-24 00:00:15 -050069 xpath_date_time_sub_menu = "//*[@data-test-id='nav-item-date-time']"
70 xpath_network_sub_menu = "//*[@data-test-id='nav-item-network']"
Patrick Williams20f38712022-12-08 06:18:26 -060071 xpath_power_restore_policy_sub_menu = (
72 "//*[@data-test-id='nav-item-power-restore-policy']"
73 )
Megha G N2a31e512023-01-18 04:23:20 -060074 xpath_static_dns = "//h2[text()='Static DNS']"
75 xpath_dns_servers_toggle = (
76 "//*[@data-test-id='networkSettings-switch-useDns']"
77 )
78 xpath_add_dns_ip_address_button = (
79 "//button[contains(text(),'Add IP address')]"
80 )
81 xpath_input_static_dns = "//*[@id='staticDns']"
Rahul Maheshwari41747da2020-11-17 09:09:52 -060082
Rahul Maheshwari142642d2021-08-24 00:00:15 -050083 # Security and access menu
Patrick Williams20f38712022-12-08 06:18:26 -060084 xpath_secuity_and_accesss_menu = (
85 "//*[@data-test-id='nav-button-security-and-access']"
86 )
Rahul Maheshwari142642d2021-08-24 00:00:15 -050087 xpath_sessions_sub_menu = "//*[@data-test-id='nav-item-sessions']"
Rahul Maheshwari41747da2020-11-17 09:09:52 -060088 xpath_ldap_sub_menu = "//*[@data-test-id='nav-item-ldap']"
Patrick Williams20f38712022-12-08 06:18:26 -060089 xpath_user_management_sub_menu = (
90 "//*[@data-test-id='nav-item-user-management']"
91 )
Rahul Maheshwari142642d2021-08-24 00:00:15 -050092 xpath_policies_sub_menu = "//*[@data-test-id='nav-item-policies']"
93 xpath_certificates_sub_menu = "//*[@data-test-id='nav-item-certificates']"
94
95 # Resource management menu
Patrick Williams20f38712022-12-08 06:18:26 -060096 xpath_resource_management_menu = (
97 "//*[@data-test-id='nav-button-resource-management']"
98 )
Rahul Maheshwari142642d2021-08-24 00:00:15 -050099 xpath_power_sub_menu = "//*[@data-test-id='nav-item-power']"
rramyasr-ind3b3fcd2022-11-18 10:41:14 -0600100 xpath_power_heading = "//h1[contains(text(), 'Power')]"
Anusha Dathatri54edcbc2020-12-10 04:04:08 -0600101
102 # Profile settings
103 xpath_default_UTC = "//*[@data-test-id='profileSettings-radio-defaultUTC']"
Patrick Williams20f38712022-12-08 06:18:26 -0600104 xpath_profile_save_button = (
105 "//*[@data-test-id='profileSettings-button-saveSettings']"
106 )
sarandev34d1a7372023-01-27 02:10:38 -0600107 xpath_profile_settings_link = "//a[contains(text(),'Profile Settings')]"
sarandev3ff7f34b2023-01-16 05:09:20 -0600108 xpath_profile_settings_heading = "//h1[text()='Profile settings']"
109 xpath_browser_offset = (
110 "//*[@data-test-id='profileSettings-radio-browserOffset']"
111 )
sarandev34d1a7372023-01-27 02:10:38 -0600112 xpath_browser_offset_textfield = (
113 xpath_browser_offset + "/following-sibling::*"
114 )
Patrick Williams20f38712022-12-08 06:18:26 -0600115 xpath_input_password = (
116 "//*[@data-test-id='profileSettings-input-newPassword']"
117 )
118 xpath_input_confirm_password = (
119 "//*[@data-test-id='profileSettings-input-confirmPassword']"
120 )
Rahul Maheshwari142642d2021-08-24 00:00:15 -0500121
122 # Common variables
rramyasr-in2da4d6f2022-11-07 04:31:24 -0600123 xpath_save_settings_button = "//button[contains(text(),'Save')]"
Ashwini Chandrappa233d9652021-08-04 09:56:30 -0500124 xpath_confirm_button = "//button[contains(text(),'Confirm')]"
meghagn2052fdd2021-12-07 02:42:31 -0600125 xpath_cancel_button = "//button[contains(text(),'Cancel')]"
meghagn97f7eb42022-03-02 02:59:35 -0600126 xpath_add_button = "//button[normalize-space(text())='Add']"
Patrick Williams20f38712022-12-08 06:18:26 -0600127 xpath_page_loading_progress_bar = (
128 "//*[@aria-label='Page loading progress bar']"
129 )
rramyasr-in2da4d6f2022-11-07 04:31:24 -0600130
rramyasr-in732cc3f2022-11-16 05:30:57 -0600131 # Reboot sub menu
meghagn2052fdd2021-12-07 02:42:31 -0600132 xpath_reboot_bmc_heading = "//h1[text()='Reboot BMC']"
133 xpath_reboot_bmc_button = "//button[contains(text(),'Reboot BMC')]"
134 xpath_confirm_bmc_reboot = "//*[@class='btn btn-primary']"