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']" |
| 15 | xpath_button_logout = "//*[@id='header']/a" |
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_display_server_power_status = \ |
| 21 | "//*[@id='header__wrapper']/div/div[3]/a[3]/span" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 22 | xpath_select_button_power_on = "//*[@id='power__power-on']" |
| 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']" |
| 26 | xpath_warm_reboot_warning_message = \ |
| 27 | "//*[@id='power-operations']" \ |
| 28 | "/div[3]/div[3]/confirm/div/div[1]/p[1]/strong" |
| 29 | xpath_select_button_warm_reboot_no = \ |
| 30 | "//*[@id='power-operations']/div[3]" \ |
| 31 | "/div[3]/confirm/div/div[2]/button[2]" |
| 32 | text_warm_reboot_warning_message = "warm reboot?" |
| 33 | xpath_select_button_warm_reboot_yes = \ |
| 34 | "//*[@id='power-operations']" \ |
| 35 | "/div[3]/div[3]/confirm/div/div[2]/button[1]" |
| 36 | |
| 37 | xpath_select_button_cold_reboot = \ |
| 38 | "//*[@id='power__cold-boot']" |
| 39 | xpath_cold_reboot_warning_message = \ |
| 40 | "//*[@id='power-operations']/div[3]/div[4]" \ |
| 41 | "/confirm/div/div[1]/p[1]/strong" |
| 42 | xpath_select_button_cold_reboot_no = \ |
| 43 | "//*[@id='power-operations']/div[3]/div[4]" \ |
| 44 | "/confirm/div/div[2]/button[2]" |
| 45 | text_cold_reboot_warning_message = "cold reboot?" |
| 46 | xpath_select_button_cold_reboot_yes = \ |
| 47 | "//*[@id='power-operations']" \ |
| 48 | "/div[3]/div[4]/confirm/div/div[2]/button[2]" |
| 49 | |
| 50 | xpath_select_button_orderly_shutdown = \ |
| 51 | "//*[@id='power__soft-shutdown']" |
| 52 | xpath_orderly_shutdown_warning_message = \ |
| 53 | "//*[@id='power-operations']/div[3]/div[5]/" \ |
| 54 | "confirm/div/div[1]/p[1]/strong" |
| 55 | xpath_select_button_orderly_shutdown_button_no = \ |
| 56 | "//*[@id='power-operations']/div[3]/div[5]"\ |
| 57 | "/confirm/div/div[2]/button[2]" |
| 58 | text_orderly_shutdown_warning_message = "orderly shutdown?" |
| 59 | xpath_select_button_orderly_shutdown_yes = \ |
| 60 | "//*[@id='power-operations']/div[3]/div[5]" \ |
| 61 | "/confirm/div/div[2]/button[1]" |
| 62 | |
| 63 | xpath_select_button_immediate_shutdown = \ |
| 64 | "//*[@id='power__hard-shutdown']" |
| 65 | xpath_immediate_shutdown_warning_message = \ |
| 66 | "//*[@id='power-operations']/div[3]/div[6]" \ |
| 67 | "/confirm/div/div[1]/p[1]/strong" |
| 68 | xpath_select_button_immediate_shutdown_no = \ |
| 69 | "//*[@id='power-operations']/div[3]/div[6]" \ |
| 70 | "/confirm/div/div[2]/button[2]" |
| 71 | text_immediate_shutdown_warning_message = "immediate shutdown?" |
| 72 | xpath_select_button_immediate_shutdown_yes = \ |
| 73 | "//*[@id='power-operations']/div[3]/div[6]" \ |
| 74 | "/confirm/div/div[2]/button[1]" |
| 75 | |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 76 | obmc_off_state = "Off" |
Sathyajith M S | f52d6fc | 2018-01-24 10:11:18 -0600 | [diff] [blame] | 77 | obmc_standby_state = "Standby" |
Sathyajith M S | 4f26ae7 | 2018-01-16 04:45:05 -0600 | [diff] [blame] | 78 | obmc_running_state = "Running" |
Sivas SRR | ffa4269 | 2018-01-17 05:17:35 -0600 | [diff] [blame] | 79 | |
| 80 | # Power operation elements needed for power on. |
| 81 | header_wrapper = "3" |
| 82 | header_wrapper_elt = "3" |
| 83 | |
| 84 | # Power operation elements needed for power operations confirmation. |
| 85 | power_operations = "3" |
| 86 | warm_boot = "3" |
| 87 | cold_boot = "4" |
| 88 | shut_down = "5" |
| 89 | power_off = "6" |
| 90 | confirm_msg = "2" |
| 91 | yes = "1" |
| 92 | No = "2" |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 93 | |
Rahul Maheshwari | dbbf179 | 2018-10-31 05:36:29 -0500 | [diff] [blame] | 94 | # GUI header elements locators. |
| 95 | xpath_select_server_power = "//a[@href='#/server-control/power-operations']" |
| 96 | |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 97 | # Server health elements locators. |
Rahul Maheshwari | 2f8aaa0 | 2018-11-29 00:23:09 -0600 | [diff] [blame] | 98 | xpath_select_server_health = "//a[@href='#/server-health/event-log']" |
Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 99 | xpath_server_health_text = \ |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 100 | "//*[@id='header__wrapper']/div/div[3]/a[2]/span" |
| 101 | xpath_select_refresh_button = \ |
| 102 | "//*[@id='header__wrapper']/div/div[3]/button" |
Gunnar Mills | 096cd56 | 2018-03-26 10:19:12 -0500 | [diff] [blame] | 103 | xpath_event_severity_all = "//*[@id='event-filter']/div[1]/button[1]" |
Sivas SRR | 008dcc6 | 2018-02-27 06:34:56 -0600 | [diff] [blame] | 104 | xpath_event_severity_high = "//*[@id='event-filter']/div[1]/button[2]" |
| 105 | xpath_event_severity_medium = "//*[@id='event-filter']/div[1]/button[3]" |
| 106 | xpath_event_severity_low = "//*[@id='event-filter']/div[1]/button[4]" |
| 107 | xpath_drop_down_timezone_edt = \ |
| 108 | "//*[@id='event-log']/section[1]/div/div/button" |
| 109 | xpath_refresh_circle = "/html/body/main/loader/div[1]/svg/circle" |
| 110 | xpath_drop_down_timezone_utc = \ |
| 111 | "//*[@id='event-log']/section[1]/div/div/ul/li[2]/button" |
Sivas SRR | 179208e | 2018-03-01 04:08:23 -0600 | [diff] [blame] | 112 | xpath_event_filter_all = "//*[@id='event-filter']/div[3]/div/button" |
| 113 | xpath_event_filter_resolved = \ |
| 114 | "//*[@id='event-filter']/div[3]/div/ul/li[2]/button" |
| 115 | xpath_event_filter_unresolved = \ |
| 116 | "//*[@id='event-filter']/div[3]/div/ul/li[3]/button" |
Sivas SRR | 3e1a83b | 2018-03-12 07:52:07 -0500 | [diff] [blame] | 117 | xpath_event_action_bars = \ |
| 118 | "//*[@id='event__actions-bar']/div[1]/label/span" |
| 119 | xpath_event_action_delete = \ |
| 120 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
| 121 | xpath_event_action_export = \ |
| 122 | "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
| 123 | xpath_number_of_events = \ |
| 124 | "//*[@id='event__actions-bar']/div[2]/p[2]/span" |
Sivas SRR | be02691 | 2018-03-14 11:33:02 -0500 | [diff] [blame] | 125 | xpath_mark_as_resolved = \ |
| 126 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
| 127 | xpath_events_export = "//*[@id='event__actions-bar']/div[2]/div[2]/a" |
| 128 | xpath_event_delete_no = \ |
| 129 | "//*[@id='event__actions-bar']/div[2]/div[1]/div[2]/button[2]" |
| 130 | xpath_event_delete_yes = \ |
| 131 | "//*[@id='event__actions-bar']/div[2]/div[1]/div[2]/button[1]" |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 132 | xpath_individual_event_select = \ |
| 133 | "//*[@id='event-log__events']/log-event[1]/div/div[1]/div[2]/label/" +\ |
| 134 | "span" |
| 135 | xpath_individual_event_delete = \ |
| 136 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[1]" |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 137 | xpath_second_event_select = \ |
| 138 | "//*[@id='event-log__events']/log-event[2]/div/div[1]/div[2]/label/" +\ |
Sivas SRR | 1a94d00 | 2018-04-06 08:48:58 -0500 | [diff] [blame] | 139 | "span" |
Sivas SRR | 2631b63 | 2018-04-04 11:33:21 -0500 | [diff] [blame] | 140 | xpath_individual_event_resolved = \ |
| 141 | "//*[@id='event__actions-bar']/div[2]/div[2]/button[2]" |
Sivas SRR | 1a94d00 | 2018-04-06 08:48:58 -0500 | [diff] [blame] | 142 | xpath_individual_event_export = \ |
| 143 | "//*[@id='event__actions-bar']/div[2]/div[2]/a" |