From 38610d8eb8dc56daafd888c71041f10f77705ad9 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 30 Aug 2022 22:37:42 -0700 Subject: [PATCH] tests: functional: Force specifying form to submit more accurately Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/tests/functional/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 5fec4bfe1..e5880b0b9 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -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()