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