1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-28 16:43:09 +00:00

Add a wrapper around assert_and_click to handle signature change

So, turns out new os-autoinst does *not* still accept the old
argument style for assert_and_click...and old os-autoinst
doesn't accept the new one. This adds a wrapper that handles
both, so our tests can work with old and new os-autoinst. We can
drop this once both deployments are on newer os-autoinst.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2019-05-28 09:41:33 -07:00
parent bad3263160
commit 43b990195c
3 changed files with 25 additions and 5 deletions

View File

@ -7,7 +7,7 @@ use Exporter;
use lockapi;
use testapi;
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487 get_release_number/;
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile bypass_1691487 get_release_number _assert_and_click/;
sub run_with_error_check {
my ($func, $error_screen) = @_;
@ -570,7 +570,7 @@ sub anaconda_create_user {
@_
);
my $user_login = get_var("USER_LOGIN") || "test";
assert_and_click("anaconda_install_user_creation", timeout=>$args{timeout});
_assert_and_click("anaconda_install_user_creation", timeout=>$args{timeout});
assert_screen "anaconda_install_user_creation_screen";
# wait out animation
wait_still_screen 2;
@ -884,3 +884,23 @@ sub get_release_number {
return $rawrel if ($version eq "Rawhide");
return $version
}
sub _assert_and_click {
# this is a wrapper around assert_and_click which handles this:
# https://github.com/os-autoinst/os-autoinst/pull/1075/files
# it changed the signature without any backward compatibility, so
# earlier os-autoinsts require an *array* of args, but later ones
# require a *hash* of args. This works with both.
my $version = $OpenQA::Isotovideo::Interface::version;
my ($mustmatch, %args) = @_;
if ($version > 13) {
return assert_and_click($mustmatch, %args);
}
else {
$args{timeout} //= $bmwqemu::default_timeout;
$args{button} //= 'left';
$args{dclick} //= 0;
$args{mousehide} //= 0;
return assert_and_click($mustmatch, $args{button}, $args{timeout}, 0, $args{dclick});
}
}

View File

@ -56,12 +56,12 @@ sub run {
} else {
# on lives, we have to explicitly launch anaconda
if (get_var('LIVE')) {
assert_and_click("live_start_anaconda_icon", timeout=>300);
_assert_and_click("live_start_anaconda_icon", timeout=>300);
}
my $language = get_var('LANGUAGE') || 'english';
# wait for anaconda to appear; we click to work around
# RHBZ #1566066 if it happens
assert_and_click("anaconda_select_install_lang", timeout=>300);
_assert_and_click("anaconda_select_install_lang", timeout=>300);
# Select install language
wait_screen_change { assert_and_click "anaconda_select_install_lang_input"; };
type_safely $language;

View File

@ -57,7 +57,7 @@ sub run {
# already be visible at this point, we may not need to refresh
unless (check_screen ['desktop_package_tool_update_apply', 'desktop_package_tool_update_download'], 5) {
# refresh updates
assert_and_click('desktop_package_tool_update_refresh', timeout=>120);
_assert_and_click('desktop_package_tool_update_refresh', timeout=>120);
}
# wait for refresh, then apply updates, moving the mouse every two
# minutes to avoid the idle screen blank kicking in. Depending on