2022-09-27 17:54:40 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
# This script will test if Maps can export the map into a file.
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $location = shift;
|
|
|
|
my $softfail = 0;
|
|
|
|
|
|
|
|
# Go to menu and click on Export.
|
|
|
|
assert_and_click("gnome_burger_menu");
|
|
|
|
assert_and_click("maps_menu_export");
|
|
|
|
|
2024-07-15 23:30:55 +00:00
|
|
|
my $relnum = get_release_number;
|
|
|
|
# the export flow was changed in gnome-maps 47. Releases earlier
|
|
|
|
# than Rawhide and, for now, the flatpak build are still 46, so
|
|
|
|
# we use the older flow there
|
2024-07-12 09:23:38 +00:00
|
|
|
# FIXME!
|
2024-07-15 23:30:55 +00:00
|
|
|
if ($relnum < 41 || get_var('CANNED')) {
|
|
|
|
# old flow
|
|
|
|
# wait for the export screen to appear and settle
|
|
|
|
assert_screen('maps_button_export');
|
|
|
|
wait_still_screen(2);
|
|
|
|
# Rename the file and export it.
|
|
|
|
# The name entry field should have focus already, so we are
|
|
|
|
# just going to rename the proposed file name.
|
|
|
|
send_key('ctrl-a');
|
|
|
|
type_very_safely('exported-map.png');
|
|
|
|
assert_and_click('maps_button_export');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
# new flow
|
2024-07-12 09:23:38 +00:00
|
|
|
# wait for the export screen to appear and settle
|
|
|
|
assert_and_click("maps_button_export");
|
|
|
|
wait_still_screen(2);
|
|
|
|
# Rename the file and export it.
|
|
|
|
# The name entry field should have focus already, so we are
|
|
|
|
# just going to rename the proposed file name.
|
|
|
|
send_key("ctrl-a");
|
|
|
|
type_very_safely("exported-map.png");
|
|
|
|
assert_and_click("maps_button_save");
|
|
|
|
}
|
2022-09-27 17:54:40 +00:00
|
|
|
|
|
|
|
# After the map has been exported, we will open
|
|
|
|
# it in an image viewer to see that it is correct.
|
|
|
|
#
|
|
|
|
# Open the Image Viewer
|
2023-08-23 18:03:36 +00:00
|
|
|
menu_launch_type("image viewer");
|
2022-09-27 17:54:40 +00:00
|
|
|
assert_screen("apps_run_imageviewer");
|
|
|
|
send_key("super-up");
|
|
|
|
# Read the file into the application.
|
|
|
|
send_key("ctrl-o");
|
2023-10-14 17:24:24 +00:00
|
|
|
assert_and_click("gnome_dirs_pictures");
|
2022-09-27 17:54:40 +00:00
|
|
|
assert_and_click("maps_select_file");
|
|
|
|
assert_and_click("gnome_button_open");
|
|
|
|
wait_still_screen(2);
|
|
|
|
|
|
|
|
# Check that the map resembles the saved one.
|
|
|
|
assert_screen("maps_exported_map");
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
return {always_rollback => 1};
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|
|
|
|
|