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 10 # Login page 11 xpath_textbox_hostname = "//input[@id='host']" 12 xpath_textbox_username = "//*[@data-test-id='login-input-username']" 13 xpath_textbox_password = "//*[@data-test-id='login-input-password']" 14 xpath_login_button = "//*[@data-test-id='login-button-submit']" 15 xpath_logout_button = "//*[@data-test-id='appHeader-link-logout']" 16 17 # Overview menu 18 xpath_overview_menu = "//*[@data-test-id='nav-item-overview']" 19 20 # GUI header 21 xpath_root_button_menu = "//*[@data-test-id='appHeader-container-user']" 22 xpath_profile_settings = "//*[@data-test-id='appHeader-link-profile']" 23 xpath_server_health_header = "//*[@data-test-id='appHeader-container-health']" 24 xpath_server_power_header = "//*[@data-test-id='appHeader-container-power']" 25 xpath_refresh_button = "//*[@data-test-id='appHeader-button-refresh']" 26 27 # Logs menu 28 xpath_logs_menu = "//*[@data-test-id='nav-button-logs']" 29 xpath_dumps_sub_menu = "//*[@data-test-id='nav-item-dumps']" 30 xpath_dumps_header = "//h1[text()='Dumps']" 31 xpath_event_logs_sub_menu = "//*[@data-test-id='nav-item-event-logs']" 32 xpath_event_logs_heading = "//h1[contains(text(), 'Event logs')]" 33 xpath_progress_logs_sub_menu = "//*[@data-test-id='nav-item-post-code-logs']" 34 35 # Hardware status menu 36 xpath_hardware_status_menu = "//*[@data-test-id='nav-button-hardware-status']" 37 xpath_inventory_and_leds_sub_menu = "//*[@data-test-id='nav-item-inventory']" 38 xpath_sensor_sub_menu = "//*[@data-test-id='nav-item-sensors']" 39 xpath_inventory_and_leds_heading = "//h1[contains(text(), 'Inventory and LEDs')]" 40 41 # Operations menu 42 xpath_operations_menu = "//*[@data-test-id='nav-button-operations']" 43 xpath_factory_reset_sub_menu = "//*[@data-test-id='nav-item-factory-reset']" 44 xpath_firmware_update_sub_menu = "//*[@data-test-id='nav-item-firmware']" 45 xpath_reboot_bmc_sub_menu = "//*[@data-test-id='nav-item-reboot-bmc']" 46 xpath_host_console_sub_menu = "//*[@data-test-id='nav-item-host-console']" 47 xpath_server_power_operations_sub_menu = "//*[@data-test-id='nav-item-server-power-operations']" 48 xpath_host_console_heading = "//h1[text()='Host console']" 49 xpath_firmware_heading = "//h1[contains(text(), 'Firmware')]" 50 51 # Settings menu 52 xpath_settings_menu = "//*[@data-test-id='nav-button-settings']" 53 xpath_network_heading = "//h1[text()='Network']" 54 xpath_date_time_sub_menu = "//*[@data-test-id='nav-item-date-time']" 55 xpath_network_sub_menu = "//*[@data-test-id='nav-item-network']" 56 xpath_power_restore_policy_sub_menu = "//*[@data-test-id='nav-item-power-restore-policy']" 57 58 # Security and access menu 59 xpath_secuity_and_accesss_menu = "//*[@data-test-id='nav-button-security-and-access']" 60 xpath_sessions_sub_menu = "//*[@data-test-id='nav-item-sessions']" 61 xpath_ldap_sub_menu = "//*[@data-test-id='nav-item-ldap']" 62 xpath_user_management_sub_menu = "//*[@data-test-id='nav-item-user-management']" 63 xpath_policies_sub_menu = "//*[@data-test-id='nav-item-policies']" 64 xpath_certificates_sub_menu = "//*[@data-test-id='nav-item-certificates']" 65 66 # Resource management menu 67 xpath_resource_management_menu = "//*[@data-test-id='nav-button-resource-management']" 68 xpath_power_sub_menu = "//*[@data-test-id='nav-item-power']" 69 xpath_power_heading = "//h1[contains(text(), 'Power')]" 70 71 # Profile settings 72 xpath_default_UTC = "//*[@data-test-id='profileSettings-radio-defaultUTC']" 73 xpath_profile_save_button = "//*[@data-test-id='profileSettings-button-saveSettings']" 74 xpath_input_password = "//*[@data-test-id='profileSettings-input-newPassword']" 75 xpath_input_confirm_password = "//*[@data-test-id='profileSettings-input-confirmPassword']" 76 77 # Common variables 78 xpath_save_settings_button = "//button[contains(text(),'Save')]" 79 xpath_confirm_button = "//button[contains(text(),'Confirm')]" 80 xpath_cancel_button = "//button[contains(text(),'Cancel')]" 81 xpath_add_button = "//button[normalize-space(text())='Add']" 82 xpath_page_loading_progress_bar = "//*[@aria-label='Page loading progress bar']" 83 84 # Reboot sub menu 85 xpath_reboot_bmc_heading = "//h1[text()='Reboot BMC']" 86 xpath_reboot_bmc_button = "//button[contains(text(),'Reboot BMC')]" 87 xpath_confirm_bmc_reboot = "//*[@class='btn btn-primary']" 88