mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
tests: functional: Force specifying form to submit more accurately
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
e87752e065
commit
38610d8eb8
@ -193,6 +193,10 @@ def download_file_outside_browser(url):
|
||||
# Form handling utilities #
|
||||
###########################
|
||||
def submit(browser, element=None, form_class=None, expected_url=None):
|
||||
"""Submit a specific form in the current page and wait for page change."""
|
||||
if not (element or form_class):
|
||||
raise AssertionError('Either element or form_class must be sent')
|
||||
|
||||
with wait_for_page_update(browser, expected_url=expected_url):
|
||||
if element:
|
||||
element.click()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user