From e861de50b152a5342efe30ba4769c90ed7442d07 Mon Sep 17 00:00:00 2001 From: Lukas Ruzicka Date: Thu, 4 Apr 2024 18:44:06 +0200 Subject: [PATCH] Create test suite for Desktop Keyring --- templates.fif.json | 14 +++++++++++ tests/applications/keyring/aaa_setup.pm | 33 +++++++++++++++++++++++++ tests/applications/okular/night_mode.pm | 30 ++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 tests/applications/keyring/aaa_setup.pm create mode 100644 tests/applications/okular/night_mode.pm diff --git a/templates.fif.json b/templates.fif.json index 33fc7005..cdc3f46e 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -1335,6 +1335,20 @@ "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" } }, + "desktop_keyring": { + "profiles": { + "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 20, + "fedora-Workstation-live-iso-x86_64-*-64bit": 20, + "fedora-KDE-live-iso-x86_64-*-64bit": 32, + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + }, + "settings": { + "BOOTFROM": "c", + "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", + "POSTINSTALL_PATH": "tests/applications/keyring", + "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" + } + }, "desktop_update_graphical": { "profiles": { "fedora-KDE-live-iso-x86_64-*-64bit": 32, diff --git a/tests/applications/keyring/aaa_setup.pm b/tests/applications/keyring/aaa_setup.pm new file mode 100644 index 00000000..08db2262 --- /dev/null +++ b/tests/applications/keyring/aaa_setup.pm @@ -0,0 +1,33 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This script will install the necessary things to test the Desktop Keyring on Gnome +# and KDE, i.e.: +# - we will install an FTP server. +# - we will set it up so that logins can be made. +# - we will log into the FTP server and make the system to remember the credentials. +# - we will restart the machine and check that the credentials are still remembered. +# - we will open SeaHorse or KDE Wallet to check that the credentials are stored. + +sub run { + my $self = shift; + # Switch to console + $self->root_console(tty => 3); + + # We install the FTP server's package. + assert_script_run("dnf -y install pure-ftpd"); + + # Now, let us set up the server. + # 1. Create an ftp user + assert_script_run("pure-pw useradd "); +} + +sub test_flags { + return {fatal => 1, milestone => 1}; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/applications/okular/night_mode.pm b/tests/applications/okular/night_mode.pm new file mode 100644 index 00000000..5a69d5b5 --- /dev/null +++ b/tests/applications/okular/night_mode.pm @@ -0,0 +1,30 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +# This part of the suite tests that Evince can be switched into night mode. + +sub run { + my $self = shift; + + # Click on the Menu button. + assert_and_click("gnome_burger_menu", timeout => 30, button => "left"); + + # Click on the Night mode to select it. + assert_and_click("evince_toggle_night_mode", button => "left", timeout => 30); + + # The menu stays opened, so hit Esc to dismiss it. + send_key("esc"); + wait_still_screen 2; + + # Check that night mode has been activated. + assert_screen("evince_night_mode", timeout => 30); + +} + +sub test_flags { + return {always_rollback => 1}; +} + +1;