diff --git a/PyRIGS/tests/pages.py b/PyRIGS/tests/pages.py index 885173d8..9fa790dc 100644 --- a/PyRIGS/tests/pages.py +++ b/PyRIGS/tests/pages.py @@ -31,6 +31,7 @@ class BasePage(Page): class FormPage(BasePage): _errors_selector = (By.CLASS_NAME, "alert-danger") + _submit_locator = (By.XPATH, "//button[@type='submit' and contains(., 'Save')]") def remove_all_required(self): self.driver.execute_script( diff --git a/assets/tests/pages.py b/assets/tests/pages.py index 77b8e5c6..0605f55c 100644 --- a/assets/tests/pages.py +++ b/assets/tests/pages.py @@ -68,7 +68,6 @@ class AssetList(BasePage): class AssetForm(FormPage): _purchased_from_select_locator = (By.CSS_SELECTOR, 'div#purchased-from-group>div.bootstrap-select') _parent_select_locator = (By.CSS_SELECTOR, 'div#parent-group>div.bootstrap-select') - _submit_locator = (By.CLASS_NAME, 'btn-success') form_items = { 'asset_id': (regions.TextBox, (By.ID, 'id_asset_id')), 'description': (regions.TextBox, (By.ID, 'id_description')), @@ -114,6 +113,7 @@ class AssetCreate(AssetForm): class AssetDuplicate(AssetForm): URL_TEMPLATE = '/assets/asset/id/{asset_id}/duplicate' + _submit_locator = (By.XPATH, "//button[@type='submit' and contains(., 'Duplicate')]") @property def success(self): @@ -152,7 +152,6 @@ class SupplierList(BasePage): class SupplierForm(FormPage): - _submit_locator = (By.XPATH, "//button[@type='submit' and contains(., 'Save')]") form_items = { 'name': (regions.TextBox, (By.ID, 'id_name')), } diff --git a/assets/tests/test_assets.py b/assets/tests/test_assets.py index dd7db6b9..de1c3c74 100644 --- a/assets/tests/test_assets.py +++ b/assets/tests/test_assets.py @@ -136,8 +136,6 @@ class TestAssetForm(AutoLoginTest): self.page.purchased_from_selector.set_option(self.supplier.name, True) self.page.purchase_price = "12.99" self.page.salvage_value = "99.12" - # FIXME Scroll down to make failure screenshot more useful... - ActionChains(self.driver).move_to_element(self.driver.find_element_by_class_name('btn-success')).perform() self.page.date_acquired = acquired = datetime.date(2020, 5, 20) self.page.parent_selector.toggle()