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
|
|
|
|
2019-07-08 17:25:46 +00:00
|
|
|
sub _open_new_tab {
|
|
|
|
# I hate life. ctrl-t seems to not always be reliable in openQA
|
|
|
|
# tests since 2019-01 or so, but the 'new tab' button is not
|
|
|
|
# always visible because GNOME might pop up a notification that
|
|
|
|
# blocks it. so, we try both.
|
|
|
|
if (check_screen 'browser_new_tab') {
|
2019-10-19 17:30:50 +00:00
|
|
|
click_lastmatch;
|
2019-07-08 17:25:46 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
send_key 'ctrl-t';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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;
|
Add desktop login test, revise and rename check_desktop
This adds a new test that implementsQA:Testcase_desktop_login
on both GNOME and KDE.
While working on this, we realized that the "desktop_clean"
needles were really "app menu" needles, and for KDE, this was
a duplication with the new "system menu" needles, because on KDE
the app menu and the system menu are the same. So I (Adam)
started to de-duplicate that, but also realized that "app menu
button" is a much more accurate name for these needles, so I was
renaming the old desktop_clean needles to app_menu_button. That
led me to the realization that "check_desktop_clean" is itself a
dumb name, because we don't (at least, any more, way back in the
mists of time we may have done) do anything to check that the
desktop is "clean" - we're really just asserting that we're at a
desktop *at all*. While thinking *that* through, I *also* realized
that the whole "open the overview and look for the app grid icon"
workaround it did is no longer necessary, because GNOME doesn't
use a translucent top bar any more. That went away in GNOME 3.32,
which is in Fedora 30, our oldest supported release.
So I threw that away, renamed the function "check_desktop",
cleaned up all the needle naming and tagging, and also added an
app menu needle for GNOME in Japanese because we were missing
one (the Japanese tests have been using the "app grid icon"
workaround the whole time).
2020-03-20 09:04:43 +00:00
|
|
|
check_desktop;
|
2022-05-25 06:51:59 +00:00
|
|
|
# switch to a VT and disable things that can mess with the test
|
2022-07-28 20:32:57 +00:00
|
|
|
$self->root_console(tty => 3);
|
2022-05-25 06:51:59 +00:00
|
|
|
disable_firefox_studies;
|
|
|
|
desktop_vt;
|
2021-09-06 15:34:45 +00:00
|
|
|
send_key 'super';
|
2016-08-03 20:22:29 +00:00
|
|
|
# wait out animations
|
2022-07-28 20:32:57 +00:00
|
|
|
wait_still_screen(stilltime => 4, similarity_level => 45);
|
2016-08-03 20:22:29 +00:00
|
|
|
assert_and_click 'browser_launcher';
|
2020-11-03 00:34:43 +00:00
|
|
|
assert_screen 'browser', 45;
|
2020-10-23 16:46:05 +00:00
|
|
|
# firefox is quite grindy on startup, let it settle
|
2022-07-28 20:32:57 +00:00
|
|
|
wait_still_screen(stilltime => 5, similarity_level => 45);
|
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)
|
2024-02-03 17:25:44 +00:00
|
|
|
# _open_new_tab;
|
|
|
|
# wait_still_screen(stilltime => 5, similarity_level => 45);
|
|
|
|
# sleep 3;
|
|
|
|
# check FAS, typing slowly to avoid errors
|
|
|
|
# type_very_safely "https://accounts.fedoraproject.org/\n";
|
|
|
|
# assert_screen 'browser_fas_home';
|
2019-07-08 17:25:46 +00:00
|
|
|
_open_new_tab;
|
2022-07-28 20:32:57 +00:00
|
|
|
wait_still_screen(stilltime => 2, similarity_level => 45);
|
2019-02-13 17:51:34 +00:00
|
|
|
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";
|
2022-07-28 20:32:57 +00:00
|
|
|
wait_still_screen(stilltime => 2, similarity_level => 45);
|
2016-08-03 20:22:29 +00:00
|
|
|
# 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";
|
2022-07-28 20:32:57 +00:00
|
|
|
wait_still_screen(stilltime => 2, similarity_level => 45);
|
2016-08-03 20:22:29 +00:00
|
|
|
# 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-08 17:25:46 +00:00
|
|
|
_open_new_tab;
|
2022-07-28 20:32:57 +00:00
|
|
|
wait_still_screen(stilltime => 2, similarity_level => 45);
|
2019-02-13 17:51:34 +00:00
|
|
|
sleep 2;
|
2016-09-12 17:24:30 +00:00
|
|
|
type_very_safely "https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/\n";
|
2023-01-27 06:58:14 +00:00
|
|
|
# sometimes there's some stupid header taking up space and we
|
|
|
|
# need to scroll down to see the 'add' button
|
|
|
|
send_key_until_needlematch "firefox_addon_add", "pgdn", 3, 5;
|
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
|
2022-07-28 20:32:57 +00:00
|
|
|
$self->root_console(tty => 3);
|
2016-08-03 20:22:29 +00:00
|
|
|
my $user = get_var("USER_LOGIN", "test");
|
|
|
|
assert_script_run "test -e /home/$user/Downloads/patch-*.xz";
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
2022-07-28 20:32:57 +00:00
|
|
|
return {fatal => 1};
|
2016-08-03 20:22:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|