From 07641a25209d468d84c55a6eebff4325b03dd5a0 Mon Sep 17 00:00:00 2001 From: Arona Date: Tue, 26 May 2020 00:17:02 +0100 Subject: [PATCH] Ensure submit button is scrolled to in tests --- PyRIGS/tests/pages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PyRIGS/tests/pages.py b/PyRIGS/tests/pages.py index 99644407..28bf059c 100644 --- a/PyRIGS/tests/pages.py +++ b/PyRIGS/tests/pages.py @@ -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