Ensure submit button is scrolled to in tests

This commit is contained in:
2020-05-26 00:17:02 +01:00
parent fd6aee83cf
commit 07641a2520

View File

@@ -1,4 +1,5 @@
from pypom import Page, Region
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver import Chrome
from selenium.common.exceptions import NoSuchElementException
@@ -38,8 +39,9 @@ class FormPage(BasePage):
"Array.from(document.getElementsByTagName(\"select\")).forEach(function (el, ind, arr) { el.removeAttribute(\"required\")});")
def submit(self):
previous_errors = self.errors
self.find_element(*self._submit_locator).click()
submit = self.find_element(*self._submit_locator)
ActionChains(self.driver).move_to_element(submit).perform()
submit.click()
# self.wait.until(lambda x: self.errors != previous_errors or self.success) This breaks my date validation test... :D
@property