1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-24 23:03:08 +00:00
os-autoinst-distri-fedora/tests/applications/maps/aaa_setup.pm
Adam Williamson 96118b4b60 Maps: handle app UI showing briefly before the access prompt
See e.g. https://openqa.fedoraproject.org/tests/1829593
sometimes we see the app UI briefly before the access prompt
appears. Handle that case by waiting a few seconds and doing
the match again.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2023-03-17 09:19:35 -07:00

63 lines
1.7 KiB
Perl

use base "installedtest";
use strict;
use testapi;
use utils;
# This will set up the environment for the Maps test.
# We only need to start Maps, make it full screen and
# save the status.
sub run {
my $self = shift;
# Start the application
menu_launch_type("Maps");
# Check it has started, or we got the permission prompt
assert_screen ['apps_run_maps', 'grant_access'];
# sometimes we match apps_run_maps for a split second before
# grant_access appears, so handle that
wait_still_screen 3;
assert_screen ['apps_run_maps', 'grant_access'];
if (match_has_tag 'grant_access') {
click_lastmatch;
assert_screen 'apps_run_maps';
}
# Fullsize the window.
send_key("super-up");
# Find a location on the map.
# If the Delete button is visible, click on it to delete the search bar
# and start a new search. If it is not visible, then press Ctrl-F
# to start the first search.
if (check_screen("maps_button_delete_bar")) {
click_lastmatch();
}
else {
send_key("ctrl-f");
}
sleep(1);
# Type in the first location
type_very_safely("brno");
# Wait a little bit for the window to settle.
wait_still_screen(2);
# Click on the location
assert_and_click("maps_select_brno");
# Let's not do any checks (they are done elsewhere),
# just let the screen settle and hit Esc to remove
# the infobox.
wait_still_screen(5);
# Dismis the info box (empty or full)
send_key("esc");
# Check that Map is shown with the correct location
assert_screen("maps_found_brno", timeout => 90);
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et: