From 358695e417db5d1fe12dea8f7ad5bbde9ff34abf Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sun, 15 Sep 2024 11:54:35 -0700 Subject: [PATCH] doublek_workaround: tweak to work for other letters too In a couple of cases we type something that *doesn't* start with a 'k', so we should use that other letter for the workaround. Signed-off-by: Adam Williamson --- lib/utils.pm | 6 ++++-- tests/desktop_terminal.pm | 2 +- tests/desktop_update_graphical.pm | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 87c5c56f..9fbcbbc9 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -1767,11 +1767,13 @@ sub start_applications { # close operation before we do anything 'real'. this is repeated in # several tests so we share it here sub kde_doublek_workaround { + my %args = @_; + $args{key} //= 'k'; wait_screen_change { send_key 'super'; }; wait_still_screen 3; - send_key "k"; + send_key $args{key}; wait_still_screen 5; - send_key "esc"; + send_key 'esc'; } 1; diff --git a/tests/desktop_terminal.pm b/tests/desktop_terminal.pm index ee37bbd8..e156e2ae 100644 --- a/tests/desktop_terminal.pm +++ b/tests/desktop_terminal.pm @@ -8,7 +8,7 @@ sub run { my $relnum = get_release_number; check_desktop; # try and avoid double-typing issues - kde_doublek_workaround if (get_var("DESKTOP") eq "kde"); + kde_doublek_workaround(key => 't') if (get_var("DESKTOP") eq "kde"); menu_launch_type('terminal'); assert_screen "apps_run_terminal"; wait_still_screen(stilltime => 5, similarity_level => 42); diff --git a/tests/desktop_update_graphical.pm b/tests/desktop_update_graphical.pm index 2fb7c3e1..f5f3d386 100644 --- a/tests/desktop_update_graphical.pm +++ b/tests/desktop_update_graphical.pm @@ -24,7 +24,7 @@ sub run { # run the updater if ($desktop eq 'kde') { # try and avoid double-typing issues - kde_doublek_workaround; + kde_doublek_workaround(key => 'd'); menu_launch_type('discover'); # Wait for it to run and maximize it to make sure we see the # Updates entry