Use IDs in locators instead of CSS when it is possible
There were a lot of places that uses CSS_SELECTOR table#someid instead of just ID someid. Closes-Bug: 1353628 Partially implements blueprint: selenium-integration-testing Change-Id: Ic6ac9b425976e60c067fc24e9819374c1a6080c2
This commit is contained in:
parent
8d49a2eeb2
commit
02c6dab840
@ -21,7 +21,7 @@ class FlavorsPage(basepage.BaseNavigationPage):
|
||||
DEFAULT_ID = "auto"
|
||||
FLAVORS_TABLE_NAME_COLUMN_INDEX = 0
|
||||
|
||||
_flavors_table_locator = (by.By.CSS_SELECTOR, 'table#flavors')
|
||||
_flavors_table_locator = (by.By.ID, 'flavors')
|
||||
|
||||
FLAVORS_TABLE_ACTIONS = ("create_flavor", "delete_flavors")
|
||||
FLAVORS_TABLE_ROW_ACTIONS = {
|
||||
|
@ -21,11 +21,11 @@ from openstack_dashboard.test.integration_tests.pages.project.compute import \
|
||||
|
||||
|
||||
class LoginPage(pageobject.PageObject):
|
||||
_login_username_field_locator = (by.By.CSS_SELECTOR, '#id_username')
|
||||
_login_password_field_locator = (by.By.CSS_SELECTOR, '#id_password')
|
||||
_login_username_field_locator = (by.By.ID, 'id_username')
|
||||
_login_password_field_locator = (by.By.ID, 'id_password')
|
||||
_login_submit_button_locator = (by.By.CSS_SELECTOR,
|
||||
'div.modal-footer button.btn')
|
||||
_login_logout_reason_locator = (by.By.CSS_SELECTOR, '#logout_reason')
|
||||
_login_logout_reason_locator = (by.By.ID, 'logout_reason')
|
||||
|
||||
def __init__(self, driver, conf):
|
||||
super(LoginPage, self).__init__(driver, conf)
|
||||
|
@ -22,7 +22,7 @@ from openstack_dashboard.test.integration_tests.regions import tables
|
||||
|
||||
class KeypairsPage(basepage.BaseNavigationPage):
|
||||
|
||||
_key_pairs_table_locator = (by.By.CSS_SELECTOR, 'table#keypairs')
|
||||
_key_pairs_table_locator = (by.By.ID, 'keypairs')
|
||||
|
||||
KEY_PAIRS_TABLE_ACTIONS = ("create_key_pair", "import_key_pair",
|
||||
"delete_key_pair")
|
||||
|
@ -26,7 +26,7 @@ class ImagesPage(basepage.BaseNavigationPage):
|
||||
IMAGES_TABLE_NAME_COLUMN_INDEX = 0
|
||||
IMAGES_TABLE_STATUS_COLUMN_INDEX = 2
|
||||
|
||||
_images_table_locator = (by.By.CSS_SELECTOR, 'table#images')
|
||||
_images_table_locator = (by.By.ID, 'images')
|
||||
|
||||
IMAGES_TABLE_ACTIONS = ("create_image", "delete_images")
|
||||
IMAGES_TABLE_ROW_ACTIONS = {
|
||||
|
@ -17,8 +17,8 @@ from openstack_dashboard.test.integration_tests.regions import tables
|
||||
|
||||
|
||||
class OverviewPage(basepage.BaseNavigationPage):
|
||||
_usage_table_locator = (by.By.CSS_SELECTOR, 'table#project_usage')
|
||||
_date_form_locator = (by.By.CSS_SELECTOR, 'form#date_form')
|
||||
_usage_table_locator = (by.By.ID, 'project_usage')
|
||||
_date_form_locator = (by.By.ID, 'date_form')
|
||||
|
||||
USAGE_TABLE_ACTIONS = ("download_csv",)
|
||||
|
||||
|
@ -18,8 +18,7 @@ from openstack_dashboard.test.integration_tests.regions import forms
|
||||
|
||||
class ChangepasswordPage(basepage.BaseNavigationPage):
|
||||
|
||||
_password_form_locator = (by.By.CSS_SELECTOR,
|
||||
'div#change_password_modal')
|
||||
_password_form_locator = (by.By.ID, 'change_password_modal')
|
||||
|
||||
CHANGE_PASSWORD_FORM_FIELDS = ("current_password", "new_password",
|
||||
"confirm_new_password")
|
||||
|
@ -30,7 +30,7 @@ class UsersettingsPage(basepage.BaseNavigationPage):
|
||||
|
||||
SETTINGS_FORM_FIELDS = ("language", "timezone", "pagesize")
|
||||
|
||||
_settings_form_locator = (by.By.CSS_SELECTOR, 'div#user_settings_modal')
|
||||
_settings_form_locator = (by.By.ID, 'user_settings_modal')
|
||||
_change_password_tab_locator = (by.By.CSS_SELECTOR,
|
||||
'a[href*="/settings/password/"]')
|
||||
|
||||
|
@ -17,8 +17,7 @@ from openstack_dashboard.test.integration_tests.regions import menus
|
||||
|
||||
|
||||
class TopBarRegion(baseregion.BaseRegion):
|
||||
_user_dropdown_menu_locator = (by.By.CSS_SELECTOR,
|
||||
'div#profile_editor_switcher')
|
||||
_user_dropdown_menu_locator = (by.By.ID, 'profile_editor_switcher')
|
||||
_openstack_brand_locator = (by.By.CSS_SELECTOR, 'a[href*="/home/"]')
|
||||
|
||||
@property
|
||||
|
Loading…
Reference in New Issue
Block a user