Skip to content

Commit

Permalink
Merge pull request #137 from okurz/feature/lockscreen_race_fix_poo133301
Browse files Browse the repository at this point in the history
Handle race condition in gui password
  • Loading branch information
mergify[bot] committed Jul 25, 2023
2 parents c4a320f + 09f8535 commit 9caff99
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,25 @@ sub switch_to_x11 {
send_key "ctrl-alt-$x11_tty";
}

sub handle_gui_password {
assert_screen 'lockscreen-password-prompt';
type_string $testapi::password;
assert_screen 'lockscreen-typed-password';
send_key 'ret';
}

sub wait_for_desktop {
assert_screen([qw/boot-menu openqa-desktop/]);
if (match_has_tag('boot-menu')) {
send_key 'ret';
}
send_key 'ret' if match_has_tag('boot-menu');
for (1..3) {
assert_screen 'openqa-desktop', 500;
if (match_has_tag('openqa-desktop-locked')) {
send_key 'esc';
wait_still_screen(1);
type_string $testapi::password . "\n";
handle_gui_password;
}
elsif (match_has_tag('openqa-desktop-login')) {
assert_and_click 'openqa-desktop-login';
wait_still_screen(1);
type_string $testapi::password . "\n";
handle_gui_password;
}
elsif (match_has_tag('openqa-desktop-gnome-auth-required')) {
assert_and_click 'openqa-desktop-gnome-auth-required';
Expand Down

0 comments on commit 9caff99

Please sign in to comment.