From f86cbd93fb067e355e69e78f9dcf578afa28b79a Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 21 Apr 2022 08:18:56 -0700 Subject: [PATCH] desktop_printing: be a bit more defensive when launching editor Seeing a failure quite often lately where when we try and hit ctrl-p to print, we just type a p. There's no wait between maximizing and trying to print, and only a short wait on launch, so let's try being a bit more defensive there. Signed-off-by: Adam Williamson --- tests/desktop_printing.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/desktop_printing.pm b/tests/desktop_printing.pm index f421be88..36512333 100644 --- a/tests/desktop_printing.pm +++ b/tests/desktop_printing.pm @@ -61,9 +61,10 @@ sub run { wait_still_screen(2); # Open the text editor and maximize it. - type_very_safely "$editor /home/test/testfile.txt &\n"; - wait_still_screen(stilltime=>3, similarity_level=>45); - send_key($maximize); + wait_screen_change { type_very_safely "$editor /home/test/testfile.txt &\n"; }; + wait_still_screen(stilltime=>2, similarity_level=>45); + wait_screen_change { send_key($maximize); }; + wait_still_screen(stilltime=>2, similarity_level=>45); # Print the file using one of the available methods send_key "ctrl-p";