Create test suite for Fedora Media Writer #462

Merged
adamwill merged 16 commits from newtest/fedora-media-writer into main 2026-06-08 04:02:55 +00:00
3 changed files with 29 additions and 28 deletions
Showing only changes of commit a5b3166873 - Show all commits

Move specific subroutines back into the test script
Some checks failed
CI via Tox and perl / tox (pull_request) Successful in 3m43s
CI via Tox and perl / perl (pull_request) Failing after 31s

Some subroutines are only used once, so there is no need to
have them in a library. This moves them back into the code.
Lukáš Růžička 2026-01-28 12:24:55 +01:00

View file

@ -8,34 +8,9 @@ use lockapi;
use testapi;
use utils;
our @EXPORT = qw(select_edition select_version select_arch confirm_disk_modification check_written_content);
our @EXPORT = qw(check_written_content);
# Selects a Fedora edition in Media Writer by opening the dropdown,
# clicking the given edition, and asserting the selected state.
sub select_edition {
my $edition = shift;
assert_and_click("mwriter_dropdown_arrow");
assert_and_click("mwriter_select_$edition");
assert_screen("mwriter_selected_$edition");
}
# Selects a Fedora version in Media Writer by opening the version dropdown
# and clicking the specified version entry.
sub select_version {
my $version = shift;
assert_and_click("mwriter_dropdown_version");
assert_and_click("mwriter_select_$version");
}
# Selects a target architecture in Media Writer by opening the architecture
# dropdown and clicking the specified architecture entry.
sub select_arch {
my $arch = shift;
assert_and_click("mwriter_dropdown_arch");
assert_and_click("mwriter_select_$arch");
}
# Validates that the USB media was written correctly.
# Verifies the embedded checksum on the device and compares its contents
# byte-for-byte with the originally downloaded ISO image.

View file

@ -6,6 +6,31 @@ use utils;
use disks;
use mwriter;
# Selects a Fedora edition in Media Writer by opening the dropdown,
# clicking the given edition, and asserting the selected state.
sub select_edition {
my $edition = shift;
assert_and_click("mwriter_dropdown_arrow");
assert_and_click("mwriter_select_$edition");
assert_screen("mwriter_selected_$edition");
}
# Selects a Fedora version in Media Writer by opening the version dropdown
# and clicking the specified version entry.
sub select_version {
my $version = shift;
assert_and_click("mwriter_dropdown_version");
assert_and_click("mwriter_select_$version");
}
# Selects a target architecture in Media Writer by opening the architecture
# dropdown and clicking the specified architecture entry.
sub select_arch {
my $arch = shift;
assert_and_click("mwriter_dropdown_arch");
assert_and_click("mwriter_select_$arch");
}
sub run {
my $self = shift;
my $currver = get_var("CURRREL", "43");
@ -48,7 +73,7 @@ sub run {
wait_still_screen(5);
# When auth dialog appears, deal with it.
authenticate();
authenticate($password, timeout => 15, stillscreen => 3);
# Sometimes, downloading does not start immediately
# and a Write button is shown. If that is the case,

View file

@ -8,6 +8,7 @@ use mwriter;
sub run {
my $self = shift;
my $password = get_var("USER_PASSWORD", "weakpassword");
# Start the application
menu_launch_type("media-writer", checkstart => 1);
@ -38,7 +39,7 @@ sub run {
# Confirm writing to usb.
assert_and_click('mwriter_confirm_button');
wait_still_screen(5);
authenticate();
authenticate($password, timeout => 15, stillscreen => 3);
# Sometimes, downloading does not start immediately
# and a Write button is shown. If that is the case,