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:
Sunil Mohan Adapa authored and James Valleroy committed 2023-01-30 18:20:53 -05:00
1 parent f394beb2ef
commit a94ebc567d
3 files changed
+7 -10

No files matched your search

@@ -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):