2016-08-03 20:22:29 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
2017-01-18 07:15:44 +00:00
|
|
|
use utils;
|
2016-09-12 17:24:30 +00:00
|
|
|
|
|
|
|
# we are very paranoid with waits and typing speed in this test
|
|
|
|
# because the system can be very busy; it's effectively first boot of
|
|
|
|
# a freshly installed system and we're running Firefox for the first
|
|
|
|
# time, which causes an awful lot of system load, and there's lots of
|
|
|
|
# screen change potentially going on. This makes the test quite slow,
|
|
|
|
# but it's best to be safe. If you're working on the test you might
|
|
|
|
# want to tweak the waits down a bit and use type_safely instead of
|
|
|
|
# type_very_safely for your test runs, just to save your time.
|
2016-08-03 20:22:29 +00:00
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
2017-07-10 18:41:02 +00:00
|
|
|
check_desktop_clean;
|
2016-08-03 20:22:29 +00:00
|
|
|
send_key 'alt-f1';
|
|
|
|
# wait out animations
|
2019-02-13 17:51:34 +00:00
|
|
|
wait_still_screen(stilltime=>2, similarity_level=>45);
|
2016-08-03 20:22:29 +00:00
|
|
|
assert_and_click 'browser_launcher';
|
|
|
|
assert_screen 'browser';
|
2019-02-13 17:51:34 +00:00
|
|
|
# wait_idle was deprecated, so we just have sleeps throughout
|
|
|
|
# this test, as firefox is very grind-y :(
|
|
|
|
sleep 5;
|
2016-08-03 20:22:29 +00:00
|
|
|
# open a new tab so we don't race with the default page load
|
|
|
|
# (also focuses the location bar for us)
|
2019-07-05 23:42:58 +00:00
|
|
|
send_key 'ctrl-t';
|
2019-02-13 17:51:34 +00:00
|
|
|
wait_still_screen(stilltime=>2, similarity_level=>45);
|
|
|
|
sleep 3;
|
2016-09-12 17:24:30 +00:00
|
|
|
# check FAS, typing slowly to avoid errors
|
|
|
|
type_very_safely "https://admin.fedoraproject.org/accounts/\n";
|
2016-08-03 20:22:29 +00:00
|
|
|
assert_screen "browser_fas_home";
|
2019-07-05 23:42:58 +00:00
|
|
|
send_key 'ctrl-t';
|
2019-02-13 17:51:34 +00:00
|
|
|
wait_still_screen(stilltime=>2, similarity_level=>45);
|
|
|
|
sleep 2;
|
2016-09-12 17:24:30 +00:00
|
|
|
type_very_safely "https://kernel.org\n";
|
2016-08-03 20:22:29 +00:00
|
|
|
assert_and_click "browser_kernelorg_patch";
|
|
|
|
assert_and_click "browser_download_save";
|
|
|
|
send_key 'ret';
|
|
|
|
# browsers do...something...when the download completes, and we
|
|
|
|
# expect there's a single click to make it go away and return
|
2019-02-13 17:33:44 +00:00
|
|
|
# browser to a state where we can open a new tab
|
2016-08-03 20:22:29 +00:00
|
|
|
assert_and_click "browser_download_complete";
|
|
|
|
# we'll check it actually downloaded later
|
|
|
|
# add-on test: at present all desktops we test (KDE, GNOME) are
|
|
|
|
# using Firefox by default so we do this unconditionally, but we
|
|
|
|
# may need to conditionalize it if we ever test desktops whose
|
|
|
|
# default browser doesn't support add-ons or uses different ones
|
2019-07-05 23:42:58 +00:00
|
|
|
send_key 'ctrl-t';
|
2019-02-13 17:51:34 +00:00
|
|
|
wait_still_screen(stilltime=>2, similarity_level=>45);
|
|
|
|
sleep 2;
|
2016-09-12 17:24:30 +00:00
|
|
|
type_very_safely "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/\n";
|
2016-08-03 20:22:29 +00:00
|
|
|
assert_and_click "firefox_addon_add";
|
|
|
|
assert_and_click "firefox_addon_install";
|
|
|
|
assert_and_click "firefox_addon_success";
|
|
|
|
# go to a console and check download worked
|
|
|
|
$self->root_console(tty=>3);
|
|
|
|
my $user = get_var("USER_LOGIN", "test");
|
|
|
|
assert_script_run "test -e /home/$user/Downloads/patch-*.xz";
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
return { fatal => 1 };
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|