1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-14 02:34:21 +00:00
os-autoinst-distri-fedora/lib/fedoradistribution.pm
Adam Williamson e1ec1997af try to be safer when typing in X: slower, more checks
Summary:
the main thing this does is try and type slower in X - this
should cover nearly everywhere we type anything in X, and make
it type slower. We also add a bit more safety checking to some
old tests which didn't have it (mainly _do_install_and_reboot)
- wait_still_screen after typing to make sure all the keypresses
were registered before continuing.

This is an attempt to mitigate the problems we've seen where
the wrong text gets typed into the wrong places and the tests
break.

This branch is live on staging atm. It still has *some* issues,
but I do think it's an improvement.

Test Plan:
run the tests (probably several times), compare to
runs without the change, see if it's better or worse...

Reviewers: jskladan, garretraziel

Reviewed By: garretraziel

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D993
2016-09-12 10:24:30 -07:00

45 lines
985 B
Perl

package fedoradistribution;
use base 'distribution';
# Fedora distribution class
# Distro-specific functions, that are actually part of the API
# (and it's completely up to us to implement them) should be here
# functions that can be reimplemented:
# ensure_installed
# x11_start_program
# become_root
# script_run
# script_sudo
# type_password
# importing whole testapi creates circular dependency, so import inly
# necessary functions from testapi
use testapi qw(send_key type_string wait_idle assert_screen);
sub init() {
my ($self) = @_;
$self->SUPER::init();
}
sub x11_start_program {
my ($self, $program, $timeout, $options) = @_;
send_key "alt-f2";
assert_screen "desktop_runner";
type_string $program, 20;
wait_idle 5; # because of KDE dialog - SUSE guys are doing the same!
send_key "ret", 1;
}
sub script_run {
my ($self, $program, $timeout) = @_;
type_string $program;
send_key "ret", $timeout;
}
1;
# vim: set sw=4 et: