1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-24 23:03:08 +00:00

Create a test case for Archiver.

This commit is contained in:
Lukas Ruzicka 2022-09-12 09:38:09 +02:00
parent 507a44a6bf
commit ba0062e5be
38 changed files with 400 additions and 0 deletions

View File

@ -0,0 +1,16 @@
{
"area": [
{
"height": 62,
"width": 137,
"xpos": 208,
"ypos": 144,
"type": "match",
"match": 94
}
],
"properties": [],
"tags": [
"archiver_archive_created"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 262,
"ypos": 160,
"width": 137,
"height": 62,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_archive_created"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 253,
"ypos": 153,
"width": 156,
"height": 76,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_archive_created"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 237,
"width": 116,
"height": 55,
"type": "match",
"ypos": 153
}
],
"properties": [],
"tags": [
"archiver_archive_extracted"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 271,
"ypos": 170,
"width": 116,
"height": 55,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_archive_extracted"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"width": 48,
"xpos": 694,
"height": 19,
"type": "match",
"ypos": 285
}
],
"properties": [],
"tags": [
"archiver_button_create"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 693,
"ypos": 308,
"width": 48,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_button_create"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 347,
"ypos": 498,
"width": 90,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_context_archive"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 184,
"type": "match",
"height": 21,
"width": 93,
"xpos": 343
}
],
"properties": [],
"tags": [
"archiver_context_extract"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 346,
"ypos": 204,
"width": 58,
"height": 21,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_context_extract"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 232,
"ypos": 154,
"width": 86,
"height": 53,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_file_one"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 290,
"ypos": 156,
"width": 86,
"height": 71,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_file_one"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"type": "match",
"ypos": 382,
"xpos": 656,
"width": 46,
"height": 22
}
],
"properties": [],
"tags": [
"archiver_format_selector"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 657,
"ypos": 403,
"width": 46,
"height": 22,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_format_selector"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 310,
"width": 99,
"height": 43,
"type": "match",
"ypos": 559
}
],
"properties": [],
"tags": [
"archiver_select_tarxz"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"xpos": 621,
"ypos": 562,
"width": 99,
"height": 43,
"type": "match"
}
],
"properties": [],
"tags": [
"archiver_select_tarxz"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"ypos": 323,
"width": 80,
"height": 20,
"type": "match",
"xpos": 20
}
],
"properties": [],
"tags": [
"gnome_open_location_pictures"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -9,6 +9,8 @@
"QEMUCPUS": "2",
"QEMURAM": "3072",
"QEMUVGA": "virtio",
"XRES": "1024",
"YRES": "768",
"QEMU_VIRTIO_RNG": "1",
"WORKER_CLASS": "qemu_x86_64"
}
@ -70,6 +72,8 @@
"QEMUCPUS": "2",
"QEMURAM": "3072",
"QEMUVGA": "virtio",
"XRES": "1024",
"YRES": "768",
"QEMU_VIRTIO_RNG": "1",
"UEFI": "1",
"UEFI_PFLASH_CODE": "/usr/share/edk2/ovmf/OVMF_CODE.fd",
@ -1085,6 +1089,22 @@
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"archiver": {
"profiles": {
"fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50,
"fedora-Silverblue-dvd_ostree-iso-x86_64-*-64bit": 50,
"fedora-Workstation-live-iso-ppc64le-*-ppc64le": 20,
"fedora-Workstation-live-iso-x86_64-*-64bit": 20,
"fedora-Workstation-upgrade-aarch64-*-aarch64": 40,
"fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22
},
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
"POSTINSTALL_PATH": "tests/applications/archiver",
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"
}
},
"eog": {
"profiles": {
"fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50,

View File

@ -0,0 +1,38 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This will set up the environment for the archiver test.
# It creates nine file and places them in the Documents folder.
# Then opens Nautilus (archive fce) and switches to that folder.
sub run {
my $self = shift;
my $username = get_var("USER_LOGIN") // "test";
# Create the files on the CLI
$self->root_console(tty => 3);
assert_script_run("cd /home/$username/Documents");
assert_script_run('for i in {1..9}; do echo $i > file$i.txt; done');
assert_script_run("chown -R $username:$username /home/$username/Documents/");
# Exit to the GUI
desktop_vt;
# Start the application
menu_launch_type("nautilus");
# Check it has started
assert_screen 'apps_run_files';
# Fullsize the window.
send_key("super-up");
# Open the Documents directory
assert_and_click("gnome_open_location_documents");
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,37 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This script will test if files in a directory can be archived
# in an archive file.
sub run {
my $self = shift;
# We are already in the correct directory, so let's just
# select all the files.
send_key("ctrl-a");
# Right click on the first of them to open the context menu.
assert_and_click("archiver_file_one", button => 'right');
# Select to archive it.
assert_and_click("archiver_context_archive");
# Type the name for the archive
type_very_safely("archived_files");
# Open the selection of formats.
assert_and_click("archiver_format_selector");
# Select the tar.xz method
assert_and_click("archiver_select_tarxz");
# Confirm
assert_and_click("archiver_button_create");
# Assert that a file has been created in that directory (it may take some time)
assert_screen("archiver_archive_created");
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,49 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This script will take a newly created archive and will move it into
# another folder, where it will be extracted and checked.
sub run {
my $self = shift;
my $username = get_var("USER_LOGIN") // "test";
# We are already in the correct directory, so let's just
# select the newly archived file, that should be there.
assert_and_click("archiver_archive_created");
send_key("ctrl-x");
# Go to the Picture folder.
assert_and_click("gnome_open_location_pictures");
# Paste it there.
send_key("ctrl-v");
# Assert that a file has been created in that directory (it may take some time)
assert_screen("archiver_archive_created");
# Right click onto it
click_lastmatch(button => 'right');
# Select to Extract the content
assert_and_click("archiver_context_extract");
# Assert that the extracted folder appeared in that location.
assert_screen("archiver_archive_extracted");
# Go to console for further testing.
$self->root_console(tty => 3);
# The archive has been removed from the original location.
assert_script_run("! ls /home/$username/Documents/archived_files.tar.xz");
# The archive has been put into a new location.
assert_script_run("ls /home/$username/Pictures/archived_files.tar.xz");
# The content was extracted.
#assert_script_run("ls /home/$username/Pictures/archived_files");
# All nine files are there.
validate_script_output("ls /home/$username/Pictures/archived_files/* | wc -l", qr/9/);
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et: