mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-04 14:18:22 +00:00
Ensure submit button is scrolled to in tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from pypom import Page, Region
|
from pypom import Page, Region
|
||||||
|
from selenium.webdriver.common.action_chains import ActionChains
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver import Chrome
|
from selenium.webdriver import Chrome
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
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\")});")
|
"Array.from(document.getElementsByTagName(\"select\")).forEach(function (el, ind, arr) { el.removeAttribute(\"required\")});")
|
||||||
|
|
||||||
def submit(self):
|
def submit(self):
|
||||||
previous_errors = self.errors
|
submit = self.find_element(*self._submit_locator)
|
||||||
self.find_element(*self._submit_locator).click()
|
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
|
# self.wait.until(lambda x: self.errors != previous_errors or self.success) This breaks my date validation test... :D
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user