handle cockpit 'user name' field not pre-selected on Rawhide

cockpit 118 just landed in Rawhide, and it seems the username
field on the login screen is no longer selected by default,
you have to hit tab to navigate to it. We could get smart and
store the cockpit version in a variable or something, but it
doesn't seem worth it for now, let's just use a simple 'if
rawhide' conditional which can be adjusted as necessary as
things change.

https://github.com/cockpit-project/cockpit/issues/5000
This commit is contained in:
Adam Williamson 2016-09-08 21:42:11 -07:00
parent 1c5fffa859
commit 3672973b9d

View File

@ -79,6 +79,12 @@ sub start_cockpit {
send_key "ret"; send_key "ret";
assert_screen "cockpit_login"; assert_screen "cockpit_login";
if ($login) { if ($login) {
# with cockpit 118, user name field is not highlighted by
# default. for right now 118 is only in Rawhide, we'll have
# to adjust this conditional as necessary.
if (lc(get_var('VERSION')) eq "rawhide") {
wait_screen_change { send_key "tab"; };
}
type_string "root"; type_string "root";
send_key "tab"; send_key "tab";
type_string get_var("ROOT_PASSWORD", "weakpassword"); type_string get_var("ROOT_PASSWORD", "weakpassword");