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