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