From 7d62f3b48e9c491ed805e9bf32526c8bf77d3c15 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 18 Mar 2022 10:58:36 -0700 Subject: [PATCH] evince: handle wrong filename in save_as as soft failure There's a bug in the Save As... dialog on the flatpak version of evince currently where the existing filename is not pre- selected, so when the test types 'alternative', it gets prepended to the existing filename instead of overwriting it, and we wind up with alternativeevince.pdf, not alternative.pdf. Let's treat this as a soft failure rather than a hard failure. Signed-off-by: Adam Williamson --- tests/applications/evince/save_as.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/applications/evince/save_as.pm b/tests/applications/evince/save_as.pm index aca7091b..c5e7ae10 100644 --- a/tests/applications/evince/save_as.pm +++ b/tests/applications/evince/save_as.pm @@ -23,10 +23,15 @@ assert_and_click("gnome_button_save_blue", button => "left", timeout => 30); # Now the document is saved under a different name. We will switch to the # terminal console to check that it has been created. $self->root_console(tty=>3); -assert_script_run("ls /home/test/Documents/alternative.pdf"); +my $filename = "alternative.pdf"; +if (script_run("ls /home/test/Documents/${filename}")) { + $filename = "alternativeevince.pdf"; + assert_script_run("ls /home/test/Documents/${filename}"); + record_soft_failure("File name was not pre-selected in Save As dialog: https://gitlab.gnome.org/GNOME/gtk/-/issues/4768"); +} # Now, check that the new file does not differ from the original one. -assert_script_run("diff /home/test/Documents/evince.pdf /home/test/Documents/alternative.pdf"); +assert_script_run("diff /home/test/Documents/evince.pdf /home/test/Documents/${filename}"); } sub test_flags {