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']" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 14 | xpath_button_login = "//*[@id='login__submit']" |
Anusha Dathatri | b2181bf | 2019-05-15 02:04:37 -0500 | [diff] [blame] | 15 | xpath_button_logout = '//a[contains(text(), "Log out")]' |
Rahul Maheshwari | 65f6944 | 2018-11-27 04:43:00 -0600 | [diff] [blame] | 16 | xpath_yes_button = "//button[text()='Yes']" |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 17 | xpath_openbmc_url = "http://localhost:8080/#/login" |
| 18 | xpath_openbmc_ip = "//*[@id='login__form']/input[1]" |
Rahul Maheshwari | 8b5b5a4 | 2018-11-30 01:41:35 -0600 | [diff] [blame] | 19 | xpath_power_indicator = "//*[@id='power-indicator-bar']" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 20 | xpath_select_button_power_on = "//*[@id='power__power-on']" |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 21 | xpath_cancel_button = "//button[contains(text(),'Cancel')]" |
| 22 | xpath_save_setting_button = "//button[contains(text(),'Save settings')]" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 23 | |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 24 | xpath_select_button_warm_reboot = \ |
| 25 | "//*[@id='power__warm-boot']" |
Anusha Dathatri | f93a5c4 | 2019-07-24 05:29:44 -0500 | [diff] [blame] | 26 | xpath_operation_warning_message = \ |
| 27 | "//*[@class='inline__confirm active']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 28 | xpath_select_button_warm_reboot_no = \ |
| 29 | "//*[@id='power-operations']/div[3]" \ |
| 30 | "/div[3]/confirm/div/div[2]/button[2]" |
| 31 | text_warm_reboot_warning_message = "warm reboot?" |
| 32 | xpath_select_button_warm_reboot_yes = \ |
| 33 | "//*[@id='power-operations']" \ |
| 34 | "/div[3]/div[3]/confirm/div/div[2]/button[1]" |
| 35 | |
| 36 | xpath_select_button_cold_reboot = \ |
| 37 | "//*[@id='power__cold-boot']" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 38 | xpath_select_button_cold_reboot_no = \ |
| 39 | "//*[@id='power-operations']/div[3]/div[4]" \ |
| 40 | "/confirm/div/div[2]/button[2]" |
| 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 | xpath_select_button_immediate_shutdown_no = \ |
| 59 | "//*[@id='power-operations']/div[3]/div[6]" \ |
| 60 | "/confirm/div/div[2]/button[2]" |
| 61 | text_immediate_shutdown_warning_message = "immediate shutdown?" |
| 62 | xpath_select_button_immediate_shutdown_yes = \ |
| 63 | "//*[@id='power-operations']/div[3]/div[6]" \ |
| 64 | "/confirm/div/div[2]/button[1]" |
| 65 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 66 | obmc_off_state = "Off" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 67 | obmc_standby_state = "Standby" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 68 | obmc_running_state = "Running" |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 69 | |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 70 | # xpath for main menu. |
| 71 | xpath_select_server_control = "//button[contains(@class,'btn-control')]" |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 72 | xpath_select_server_configuration = "//button[contains(@class,'btn-config')]" |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 73 | |
| 74 | # xpath for sub main menu. |
| 75 | xpath_select_server_power_operations = "//a[@href='#/server-control/power-operations']" |
Rahul Maheshwari | dd3bb60 | 2019-10-23 13:31:33 -0500 | [diff] [blame] | 76 | xpath_select_snmp_settings = "//a[@href='#/configuration/snmp']" |
Rahul Maheshwari | 23decff | 2019-10-29 00:55:53 -0500 | [diff] [blame] | 77 | xpath_select_manage_power_usage = "//a[@href='#/server-control/power-usage']" |
| 78 | xpath_select_virtual_media = "//a[@href='#/server-control/virtual-media']" |
| 79 | xpath_select_sol_console = "//a[@href='#/server-control/remote-console']" |
| 80 | xpath_select_reboot_bmc = "//a[@href='#/server-control/bmc-reboot']" |
| 81 | xpath_select_ldap = "//a[@href='#/access-control/ldap']" |
| 82 | xpath_select_server_health = "//a[@href='#/server-health/event-log']" |
Anusha Dathatri | f0821d4 | 2019-10-29 21:07:00 -0500 | [diff] [blame] | 83 | xpath_select_server_led = "//a[@href='#/server-control/server-led']" |
Rahul Maheshwari | 57a4155 | 2019-10-22 01:02:23 -0500 | [diff] [blame] | 84 | |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 85 | # Power operation elements needed for power on. |
| 86 | header_wrapper = "3" |
| 87 | header_wrapper_elt = "3" |
| 88 | |
| 89 | # Power operation elements needed for power operations confirmation. |
| 90 | power_operations = "3" |
| 91 | warm_boot = "3" |
| 92 | cold_boot = "4" |
| 93 | shut_down = "5" |
| 94 | power_off = "6" |
| 95 | confirm_msg = "2" |
| 96 | yes = "1" |
| 97 | No = "2" |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 98 | |
Rahul Maheshwari | dbbf179 | 2018-10-31 05:36:29 -0500 | [diff] [blame] | 99 | # GUI header elements locators. |
| 100 | xpath_select_server_power = "//a[@href='#/server-control/power-operations']" |
| 101 | |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 102 | # Server health elements locators. |
Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 103 | xpath_server_health_text = \ |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 104 | "//*[@id='header__wrapper']/div/div[3]/a[2]/span" |
| 105 | xpath_select_refresh_button = \ |
Anusha Dathatri | 2513ae5 | 2019-09-18 05:18:46 -0500 | [diff] [blame] | 106 | "//*[contains(text(),'Refresh')]" |
Anusha Dathatri | dadb75e | 2019-10-15 04:20:52 -0500 | [diff] [blame] | 107 | xpath_event_severity_all = "//*[text()='Filter by severity']/following-sibling::button[1]" |
| 108 | xpath_event_severity_high = "//*[text()='Filter by severity']/following-sibling::button[2]" |
| 109 | xpath_event_severity_medium = "//*[text()='Filter by severity']/following-sibling::button[3]" |
| 110 | xpath_event_severity_low = "//*[text()='Filter by severity']/following-sibling::button[4]" |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 111 | xpath_drop_down_timezone_edt = \ |
| 112 | "//*[@id='event-log']/section[1]/div/div/button" |
| 113 | xpath_refresh_circle = "/html/body/main/loader/div[1]/svg/circle" |
| 114 | xpath_drop_down_timezone_utc = \ |
| 115 | "//*[@id='event-log']/section[1]/div/div/ul/li[2]/button" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 116 | xpath_event_filter_all = "//*[text()='All events']" |
| 117 | xpath_event_filter_resolved = "//*[text()='Resolved events']" |
| 118 | xpath_event_filter_unresolved = "//*[text()='Unresolved events']" |
Sivas SRR | 3e1a83b | 2018-03-12 07:52:07 -0500 | [diff] [blame] | 119 | xpath_event_action_bars = \ |
| 120 | "//*[@id='event__actions-bar']/div[1]/label/span" |
| 121 | xpath_event_action_delete = \ |
| 122 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
| 123 | xpath_event_action_export = \ |
| 124 | "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
| 125 | xpath_number_of_events = \ |
| 126 | "//*[@id='event__actions-bar']/div[2]/p[2]/span" |
Sivas SRR | be02691 | 2018-03-14 11:33:02 -0500 | [diff] [blame] | 127 | xpath_mark_as_resolved = \ |
| 128 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
| 129 | xpath_events_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
| 130 | xpath_event_delete_no = \ |
| 131 | "//*[@id='event__actions-bar']/div[2]/div[1]/div[2]/button[2]" |
| 132 | xpath_event_delete_yes = \ |
| 133 | "//*[@id='event__actions-bar']/div[2]/div[1]/div[2]/button[1]" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 134 | xpath_individual_event_select = "(//*[@class='control__indicator'])[2]" |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 135 | xpath_individual_event_delete = \ |
| 136 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 137 | xpath_second_event_select = "(//*[@class='control__indicator'])[3]" |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 138 | xpath_individual_event_resolved = \ |
| 139 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
Sivas SRR | 1a94d00 | 2018-04-06 08:48:58 -0500 | [diff] [blame] | 140 | xpath_individual_event_export = \ |
| 141 | "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
Anusha Dathatri | cae580a | 2019-10-16 06:17:19 -0500 | [diff] [blame] | 142 | xpath_select_all_events = "(//*[@class='control__indicator'])[1]" |