tests: functional: Allow submitting form buttons along with inputs

- Sometimes <input type='submit'> are used as submit buttons and at other times
<button type='submit'> is used.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-07-26 13:37:52 -07:00 committed by James Valleroy
parent 1398501ec4
commit ef4292d5fc
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -223,10 +223,11 @@ def submit(browser, element=None, form_class=None, expected_url=None):
if element:
click(browser, element)
elif form_class:
browser.find_by_css(
'.{} input[type=submit]'.format(form_class)).click()
browser.find_by_css(f'.{form_class} input[type=submit], '
f'.{form_class} button[type=submit]').click()
else:
browser.find_by_css('input[type=submit]').click()
browser.find_by_css(
'input[type=submit] button[type=submit]').click()
def set_app_form_value(browser, app_id, element_id, value):