1#!/usr/bin/env python3
2
3r"""
4Contains xpaths and related string constants applicable for new Vue based OpenBMC GUI.
5"""
6
7
8class gui_variables:
9    # Login page
10    xpath_textbox_hostname = "//input[@id='host']"
11    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']"
14    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
20    xpath_root_button_menu = "//*[@data-test-id='appHeader-container-user']"
21    xpath_profile_settings = "//*[@data-test-id='appHeader-link-profile']"
22    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    )
28    xpath_refresh_button = "//*[@data-test-id='appHeader-button-refresh']"
29
30    # Logs menu
31    xpath_logs_menu = "//*[@data-test-id='nav-button-logs']"
32    xpath_dumps_sub_menu = "//*[@data-test-id='nav-item-dumps']"
33    xpath_dumps_header = "//h1[text()='Dumps']"
34    xpath_event_logs_sub_menu = "//*[@data-test-id='nav-item-event-logs']"
35    xpath_event_logs_heading = "//h1[contains(text(), 'Event logs')]"
36    xpath_progress_logs_sub_menu = (
37        "//*[@data-test-id='nav-item-post-code-logs']"
38    )
39
40    # Hardware status menu
41    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    )
47    xpath_sensor_sub_menu = "//*[@data-test-id='nav-item-sensors']"
48    xpath_inventory_and_leds_heading = (
49        "//h1[contains(text(), 'Inventory and LEDs')]"
50    )
51
52    # Operations menu
53    xpath_operations_menu = "//*[@data-test-id='nav-button-operations']"
54    xpath_factory_reset_sub_menu = (
55        "//*[@data-test-id='nav-item-factory-reset']"
56    )
57    xpath_firmware_update_sub_menu = "//*[@data-test-id='nav-item-firmware']"
58    xpath_reboot_bmc_sub_menu = "//*[@data-test-id='nav-item-reboot-bmc']"
59    xpath_host_console_sub_menu = "//*[@data-test-id='nav-item-host-console']"
60    xpath_server_power_operations_sub_menu = (
61        "//*[@data-test-id='nav-item-server-power-operations']"
62    )
63    xpath_host_console_heading = "//h1[text()='Host console']"
64    xpath_firmware_heading = "//h1[contains(text(), 'Firmware')]"
65
66    # Settings menu
67    xpath_settings_menu = "//*[@data-test-id='nav-button-settings']"
68    xpath_network_heading = "//h1[text()='Network']"
69    xpath_date_time_sub_menu = "//*[@data-test-id='nav-item-date-time']"
70    xpath_network_sub_menu = "//*[@data-test-id='nav-item-network']"
71    xpath_power_restore_policy_sub_menu = (
72        "//*[@data-test-id='nav-item-power-restore-policy']"
73    )
74
75    # Security and access menu
76    xpath_secuity_and_accesss_menu = (
77        "//*[@data-test-id='nav-button-security-and-access']"
78    )
79    xpath_sessions_sub_menu = "//*[@data-test-id='nav-item-sessions']"
80    xpath_ldap_sub_menu = "//*[@data-test-id='nav-item-ldap']"
81    xpath_user_management_sub_menu = (
82        "//*[@data-test-id='nav-item-user-management']"
83    )
84    xpath_policies_sub_menu = "//*[@data-test-id='nav-item-policies']"
85    xpath_certificates_sub_menu = "//*[@data-test-id='nav-item-certificates']"
86
87    # Resource management menu
88    xpath_resource_management_menu = (
89        "//*[@data-test-id='nav-button-resource-management']"
90    )
91    xpath_power_sub_menu = "//*[@data-test-id='nav-item-power']"
92    xpath_power_heading = "//h1[contains(text(), 'Power')]"
93
94    # Profile settings
95    xpath_default_UTC = "//*[@data-test-id='profileSettings-radio-defaultUTC']"
96    xpath_profile_save_button = (
97        "//*[@data-test-id='profileSettings-button-saveSettings']"
98    )
99    xpath_profile_settings_heading = "//h1[text()='Profile settings']"
100    xpath_browser_offset = (
101        "//*[@data-test-id='profileSettings-radio-browserOffset']"
102    )
103    xpath_ist_text = "//*[contains(text(),'IST UTC+5:30')]"
104    xpath_input_password = (
105        "//*[@data-test-id='profileSettings-input-newPassword']"
106    )
107    xpath_input_confirm_password = (
108        "//*[@data-test-id='profileSettings-input-confirmPassword']"
109    )
110
111    # Common variables
112    xpath_save_settings_button = "//button[contains(text(),'Save')]"
113    xpath_confirm_button = "//button[contains(text(),'Confirm')]"
114    xpath_cancel_button = "//button[contains(text(),'Cancel')]"
115    xpath_add_button = "//button[normalize-space(text())='Add']"
116    xpath_page_loading_progress_bar = (
117        "//*[@aria-label='Page loading progress bar']"
118    )
119
120    # Reboot sub menu
121    xpath_reboot_bmc_heading = "//h1[text()='Reboot BMC']"
122    xpath_reboot_bmc_button = "//button[contains(text(),'Reboot BMC')]"
123    xpath_confirm_bmc_reboot = "//*[@class='btn btn-primary']"
124