mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
tests: functional: Fix submitting forms with notifications present
Closes: #2194. In the four cases fixed, if a notification is present with a 'btn-primary' in it, then instead of submitting the intended form, the button on the notification is clicked. This will result in an indefinite wait for the form to perform an action. Fix this by specifying which form exactly we want to submit. Tests: - Run functional tests for config app and updates app. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
f394beb2ef
commit
a94ebc567d
@ -4,6 +4,7 @@ Functional, browser based tests for config app.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
from plinth.tests import functional
|
||||
|
||||
pytestmark = [
|
||||
@ -61,8 +62,7 @@ def _set_home_page(browser, home_page):
|
||||
functional.nav_to_module(browser, 'config')
|
||||
drop_down = browser.find_by_id('id_homepage')
|
||||
drop_down.select(home_page)
|
||||
update_setup = browser.find_by_css('.btn-primary')
|
||||
functional.submit(browser, element=update_setup)
|
||||
functional.submit(browser, form_class='form-configuration')
|
||||
|
||||
|
||||
def _check_home_page_redirect(browser, app_name):
|
||||
|
||||
@ -4,6 +4,7 @@ Functional, browser based tests for upgrades app.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
from plinth.tests import functional
|
||||
|
||||
pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.upgrades]
|
||||
@ -51,8 +52,7 @@ def _enable_automatic(browser, should_enable):
|
||||
else:
|
||||
checkbox_element.uncheck()
|
||||
|
||||
update_setup = browser.find_by_css('.btn-primary')
|
||||
functional.submit(browser, element=update_setup)
|
||||
functional.submit(browser, form_class='form-configuration')
|
||||
|
||||
|
||||
def _get_automatic(browser):
|
||||
|
||||
@ -441,8 +441,7 @@ def app_can_be_disabled(browser, app_name):
|
||||
def set_domain_name(browser, domain_name):
|
||||
nav_to_module(browser, 'config')
|
||||
browser.find_by_id('id_domainname').fill(domain_name)
|
||||
update_setup = browser.find_by_css('.btn-primary[type="submit"]')
|
||||
submit(browser, element=update_setup)
|
||||
submit(browser, form_class='form-configuration')
|
||||
|
||||
|
||||
########################
|
||||
@ -493,8 +492,7 @@ def running_inside_container():
|
||||
def set_hostname(browser, hostname):
|
||||
nav_to_module(browser, 'config')
|
||||
browser.find_by_id('id_hostname').fill(hostname)
|
||||
update_setup = browser.find_by_css('.btn-primary')
|
||||
submit(browser, element=update_setup)
|
||||
submit(browser, form_class='form-configuration')
|
||||
|
||||
|
||||
def set_advanced_mode(browser, mode):
|
||||
@ -505,8 +503,7 @@ def set_advanced_mode(browser, mode):
|
||||
else:
|
||||
advanced_mode.uncheck()
|
||||
|
||||
update_setup = browser.find_by_css('.btn-primary')
|
||||
submit(browser, element=update_setup)
|
||||
submit(browser, form_class='form-configuration')
|
||||
|
||||
|
||||
####################
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user