1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-01 05:54:22 +00:00
os-autoinst-distri-fedora/tests/applications/evince/save_as.pm
Adam Williamson 9f6113d581 More tweaking to GNOME file save - always click the button
Let's not trust hitting enter in just one place but hit the save
button like we do elsewhere (this avoids an awkward issue where
hitting enter doesn't work on the new nautilus version). Also,
let's consolidate the needles under a sensible tag name.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-08-20 16:52:51 -07:00

47 lines
1.5 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
# This part of the suite tests tests that Evince can Save the document As another document.
sub run {
my $self = shift;
# Open the menu.
assert_and_click("gnome_burger_menu", button => "left", timeout => 30);
# Select Save As
assert_and_click("evince_menu_saveas", button => "left", timeout => 30);
wait_still_screen(2);
# if we hit the nautilus save-as screen, we have to click to edit
# the filename
click_lastmatch if (check_screen "nautilus_save_filename");
# Type a new name.
type_very_safely("alternative");
# Click on the Save button
assert_and_click("gnome_button_save", 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);
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/${filename}");
}
sub test_flags {
return {always_rollback => 1};
}
1;