From 765e3176fab250a33cdefb4173d1efa092bfc3bb Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 11 Dec 2024 09:48:54 -0800 Subject: [PATCH] diagnostics: tests: functional: Pick errors more specifically - When notifications badge is present in navigation bar, that could be confused for a diagnostics failure. Make the diagnostics failure selector more specific to avoid this. - This was caused because of removing .badge-warning/error classes in favor of .text-bg-warning/danger classes. Tests: - Enable ejabberd app and use 'systemctl stop ejabberd.service'. Run system-wide diagnostics to see a notification with error it and error badge on the notification icon. Then run functional tests on transmission app which includes diagnostic tests. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/tests/functional/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 3e5ee231d..7e5100761 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -794,12 +794,14 @@ class BaseAppTests: session_browser.find_by_id('id_extra_actions_button').click() submit(session_browser, form_class='form-diagnostics-button') - warning_results = session_browser.find_by_css('.text-bg-warning') + warning_results = session_browser.find_by_css( + '.diagnostic-result > .text-bg-warning') if warning_results: warnings.warn( f'Diagnostics warnings for {self.app_name}: {warning_results}') - failure_results = session_browser.find_by_css('.text-bg-danger') + failure_results = session_browser.find_by_css( + '.diagnostic-result > .text-bg-danger') assert not failure_results @pytest.mark.backups