Work around Firefox 'close multiple tabs' warning

Somehow, recently, FreeIPA tests are running into Firefox not
quitting because it's showing a warning about closing multiple
tabs. (I think we didn't *get* multiple tabs before but now we
do, for some reason). So let's work around this by clicking
"Close tabs" if the warning appears.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-10-30 18:23:19 -07:00
parent d4c87a4f36
commit e6c8c5f0ff
7 changed files with 35 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 get_milestone boot_decrypt check_release menu_launch_type start_cockpit repo_setup gnome_initial_setup anaconda_create_user check_desktop_clean download_modularity_tests/;
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 get_milestone 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/;
sub run_with_error_check {
my ($func, $error_screen) = @_;
@ -657,3 +657,18 @@ sub download_modularity_tests {
assert_script_run 'curl -o /root/test.py https://pagure.io/fedora-qa/modularity_testing_scripts/raw/master/f/modular_functions.py';
assert_script_run 'chmod 755 /root/test.py';
}
sub quit_firefox {
# Quit Firefox, handling the 'close multiple tabs' warning screen if
# it shows up
send_key "ctrl-q";
# expect to get to either the tabs warning or a console
if (check_screen ["user_console", "root_console", "firefox_close_tabs"], 30) {
# if we hit a console, we're done
return unless match_has_tag "firefox_close_tabs";
# otherwise, POJITO
assert_and_click "firefox_close_tabs";
}
# it's a bit odd if we reach here, but could mean we quit to a
# desktop, or the firefox_close_tabs needle went stale...
}

View File

@ -0,0 +1,15 @@
{
"tags": [
"firefox_close_tabs"
],
"properties": [],
"area": [
{
"xpos": 669,
"ypos": 416,
"width": 66,
"height": 20,
"type": "match"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -36,7 +36,7 @@ sub run {
assert_and_click "freeipa_webui_logout";
wait_still_screen 3;
# close browser, back to console
send_key "ctrl-q";
quit_firefox;
# we don't get back to a prompt instantly and keystrokes while X
# is still shutting down are swallowed, so wait_still_screen before
# finishing (and handing off to freeipa_client_postinstall)

View File

@ -41,7 +41,7 @@ sub run {
wait_still_screen 1;
assert_and_click "freeipa_webui_policy_save";
# quit browser to return to console
send_key "ctrl-q";
quit_firefox;
# we don't get back to a prompt instantly and keystrokes while X
# is still shutting down are swallowed, so wait_still_screen before
# finishing (and handing off to freeipa_client_postinstall)

View File

@ -38,7 +38,7 @@ sub run {
# join involves package installs, so it may take some time
assert_screen "cockpit_join_complete", 300;
# quit browser to return to console
send_key "ctrl-q";
quit_firefox;
# we don't get back to a prompt instantly and keystrokes while X
# is still shutting down are swallowed, so wait_still_screen before
# finishing (and handing off to freeipa_client_postinstall)

View File

@ -12,7 +12,7 @@ sub run {
# test cockpit web UI start
start_cockpit(0);
# quit firefox (return to console)
send_key "ctrl-q";
quit_firefox;
}
sub test_flags {