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 <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2024-12-11 09:48:54 -08:00 committed by Veiko Aasa
parent 4fdf6a7ffe
commit 765e3176fa
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

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