Try to make desktop_browser more robust

We've been getting failures lately on the first page load, I
think because Firefox is getting even more grindy on startup. So
turn the 'sleep' into a 'wait_still_screen', extend another wait,
and tweak the 'browser' needle so it only matches after the
bookmark bar has loaded rather than as soon as half the chrome
appears. Also make all the wait_still_screens use similarity 45
for consistency (flashing cursor could be there on any of them).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-10-23 09:46:05 -07:00
parent bd7d3cd663
commit 0d8ceec820
5 changed files with 36 additions and 30 deletions

View File

@ -1,23 +0,0 @@
{
"area": [
{
"width": 20,
"ypos": 74,
"height": 20,
"type": "match",
"xpos": 108
},
{
"ypos": 74,
"width": 24,
"height": 20,
"type": "match",
"xpos": 992
}
],
"tags": [
"firefox",
"browser"
],
"properties": []
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

View File

@ -0,0 +1,30 @@
{
"area": [
{
"height": 18,
"type": "match",
"width": 17,
"xpos": 108,
"ypos": 71
},
{
"height": 18,
"type": "match",
"width": 17,
"xpos": 996,
"ypos": 72
},
{
"height": 17,
"type": "match",
"width": 19,
"xpos": 379,
"ypos": 108
}
],
"properties": [],
"tags": [
"firefox",
"browser"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -33,13 +33,12 @@ sub run {
wait_still_screen(stilltime=>2, similarity_level=>45); wait_still_screen(stilltime=>2, similarity_level=>45);
assert_and_click 'browser_launcher'; assert_and_click 'browser_launcher';
assert_screen 'browser'; assert_screen 'browser';
# wait_idle was deprecated, so we just have sleeps throughout # firefox is quite grindy on startup, let it settle
# this test, as firefox is very grind-y :( wait_still_screen(stilltime=>5, similarity_level=>45);
sleep 5;
# open a new tab so we don't race with the default page load # open a new tab so we don't race with the default page load
# (also focuses the location bar for us) # (also focuses the location bar for us)
_open_new_tab; _open_new_tab;
wait_still_screen(stilltime=>2, similarity_level=>45); wait_still_screen(stilltime=>5, similarity_level=>45);
sleep 3; sleep 3;
# check FAS, typing slowly to avoid errors # check FAS, typing slowly to avoid errors
type_very_safely "https://admin.fedoraproject.org/accounts/\n"; type_very_safely "https://admin.fedoraproject.org/accounts/\n";
@ -49,16 +48,16 @@ sub run {
sleep 2; sleep 2;
type_very_safely "https://kernel.org\n"; type_very_safely "https://kernel.org\n";
assert_and_click "browser_kernelorg_patch"; assert_and_click "browser_kernelorg_patch";
wait_still_screen 2; wait_still_screen(stilltime=>2, similarity_level=>45);
assert_and_click "browser_download_save"; assert_and_click "browser_download_save";
sleep 2; sleep 2;
send_key 'ret'; send_key 'ret';
wait_still_screen 3; wait_still_screen(stilltime=>3, similarity_level=>45);
# browsers do...something...when the download completes, and we # browsers do...something...when the download completes, and we
# expect there's a single click to make it go away and return # expect there's a single click to make it go away and return
# browser to a state where we can open a new tab # browser to a state where we can open a new tab
assert_and_click "browser_download_complete"; assert_and_click "browser_download_complete";
wait_still_screen 2; wait_still_screen(stilltime=>2, similarity_level=>45);
# we'll check it actually downloaded later # we'll check it actually downloaded later
# add-on test: at present all desktops we test (KDE, GNOME) are # add-on test: at present all desktops we test (KDE, GNOME) are
# using Firefox by default so we do this unconditionally, but we # using Firefox by default so we do this unconditionally, but we