Improve asset audit testing

This commit is contained in:
2020-02-24 17:36:04 +00:00
parent db7440e9da
commit 94412da545
4 changed files with 55 additions and 20 deletions

View File

@@ -184,6 +184,7 @@ class AssetAuditList(AssetList):
_search_text_locator = (By.ID, 'id_query')
_go_button_locator = (By.ID, 'searchButton')
_modal_locator = (By.ID, 'modal')
_errors_selector = (By.CLASS_NAME, "alert-danger")
@property
def modal(self):
@@ -201,6 +202,13 @@ class AssetAuditList(AssetList):
def search(self):
self.find_element(*self._go_button_locator).click()
@property
def error(self):
try:
return self.find_element(*self._errors_selector)
except NoSuchElementException:
return None
class AssetAuditModal(Region):
_errors_selector = (By.CLASS_NAME, "alert-danger")
# Don't use the usual success selector - that tries and fails to hit the '10m long cable' helper button...