1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-11 05:43:11 +00:00
os-autoinst-distri-fedora/tests/applications/nautilus/copy_file.pm

53 lines
1.5 KiB
Perl
Raw Normal View History

2022-02-10 09:29:17 +00:00
use base "installedtest";
use strict;
use testapi;
use utils;
# Copy a file.
sub run {
my $self = shift;
# Enter the Documents directory to get to the test data.
assert_and_click("nautilus_directory_documents");
2022-02-10 09:29:17 +00:00
# Click onto a file to select it.
assert_and_click("nautilus_test_file");
wait_still_screen(2);
2022-02-10 09:29:17 +00:00
# Press the keyboard shortcut to copy the file
send_key("ctrl-c");
2022-02-10 09:29:17 +00:00
# Select a different location to place the file.
assert_and_click("nautilus_directory_downloads");
wait_still_screen(2);
# Assert that we have entered the correct directory.
assert_screen("nautilus_directory_reached_downloads");
2022-02-10 09:29:17 +00:00
# Put the file in the new location
send_key("ctrl-v");
2022-02-10 09:29:17 +00:00
# Check that the file has appeared.
assert_screen("nautilus_test_file");
2022-02-10 09:29:17 +00:00
# Go into the root console and verify the operation in the background.
$self->root_console(tty => 3);
2022-02-10 09:29:17 +00:00
# Verify that the new file exists in original location.
assert_script_run("ls /home/test/Documents/markdown.md", timeout => '60', fail_message => 'The test file was incorrectly removed from the old location.', quiet => '0');
# And also in the new location.
assert_script_run("ls /home/test/Downloads/markdown.md", timeout => '60', fail_message => 'The test file has not been found in the new location.', quiet => '0');
2022-02-10 09:29:17 +00:00
}
sub test_flags {
# Rollback to the previous state to make space for other parts.
return {always_rollback => 1};
}
1;