From 2d67e0b1409cb4364cf0a8167bb3070b62a1fcc1 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 24 Feb 2022 08:24:36 -0800 Subject: [PATCH] desktop_printing: do the file find from a VT script_output has no arg to make it type slowly, and I'm seeing that the test often fails trying to do full-speed script_output at a desktop terminal. Let's do this part from a VT. Signed-off-by: Adam Williamson --- tests/desktop_printing.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/desktop_printing.pm b/tests/desktop_printing.pm index 7df6935c..f421be88 100644 --- a/tests/desktop_printing.pm +++ b/tests/desktop_printing.pm @@ -88,13 +88,12 @@ sub run { assert_and_click "printing_print"; # Exit the application send_key "alt-f4"; - wait_still_screen(stilltime=>3, similarity_level=>45); - # The CLI might be blocked by some application output. Pressing the - # Enter key will dismiss them and return the CLI to the ready status. - send_key("ret"); # Get the name of the printed file. The path location depends - # on the selected method. + # on the selected method. We do this on a VT because there's + # no argument to script_output to make it type slowly, and + # it often fails typing fast in a desktop terminal + $self->root_console(tty=>3); my $directory = $usecups ? "/home/test/Desktop" : "/home/test/Documents"; my $filename = script_output("ls $directory"); my $filepath = "$directory/$filename"; @@ -102,6 +101,12 @@ sub run { # Echo that filename to the terminal for troubleshooting purposes diag("The file of the printed out file is located in $filepath"); + # back to the desktop + desktop_vt(); + wait_still_screen(stilltime=>3, similarity_level=>45); + # The CLI might be blocked by some application output. Pressing the + # Enter key will dismiss them and return the CLI to the ready status. + send_key("ret"); # Open the pdf file in a Document reader and check that it is correctly printed. type_safely("$viewer $filepath &\n"); wait_still_screen(stilltime=>3, similarity_level=>45);