|
| 1 | +# Copyright SUSE LLC |
| 2 | +# SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | +# |
| 4 | +# Summary: The Battle for Wesnoth game test |
| 5 | +# Maintainer: Christian Lanig <clanig@suse.com> |
| 6 | + |
| 7 | +use base "x11test"; |
| 8 | +use strict; |
| 9 | +use warnings; |
| 10 | +use testapi; |
| 11 | + |
| 12 | +sub run { |
| 13 | + select_console "x11"; |
| 14 | + ensure_installed "wesnoth", timeout => 600; |
| 15 | + x11_start_program "wesnoth"; |
| 16 | + |
| 17 | + # Double click necessary to achieve focus on window |
| 18 | + assert_and_click "wesnoth-preferences"; |
| 19 | + assert_and_click "wesnoth-preferences-display"; |
| 20 | + assert_and_click "wesnoth-preferences-display-anim-map"; |
| 21 | + assert_and_click "wesnoth-preferences-unit-standing-anim"; |
| 22 | + assert_and_click "wesnoth-preferences-display-idle-anim"; |
| 23 | + assert_and_click "wesnoth-preferences-close"; |
| 24 | + assert_and_click "wesnoth-campaign-button"; |
| 25 | + assert_and_click "wesnoth-campaign-brothers-select"; |
| 26 | + assert_and_click "wesnoth-play-btn"; |
| 27 | + assert_and_click "wesnoth-skip-btn"; |
| 28 | + assert_screen "wesnoth-ingame"; |
| 29 | + |
| 30 | + # Skip dialogue |
| 31 | + for (1 .. 11) { |
| 32 | + click_lastmatch; |
| 33 | + } |
| 34 | + |
| 35 | + assert_and_click "wesnoth-menu"; |
| 36 | + assert_and_click "wesnoth-save-game"; |
| 37 | + assert_and_click "wesnoth-save-btn"; |
| 38 | + assert_and_click "wesnoth-save-confirm"; |
| 39 | + |
| 40 | + # Sometimes mouse lands on the border shifting the displayed map area |
| 41 | + mouse_set(100, 100); |
| 42 | + |
| 43 | + # Focus display on lead figure |
| 44 | + send_key "l"; |
| 45 | + |
| 46 | + assert_and_click "wesnoth-horseman"; |
| 47 | + assert_and_click "wesnoth-camp"; |
| 48 | + assert_screen "wesnoth-horseman-on-camp"; |
| 49 | + assert_and_click "wesnoth-fortress-field", button => "right"; |
| 50 | + assert_and_click "wesnoth-recruit"; |
| 51 | + assert_and_click "wesnoth-recruit-btn"; |
| 52 | + assert_screen "wesnoth-new-archer"; |
| 53 | + assert_and_click "wesnoth-menu"; |
| 54 | + assert_and_click "wesnoth-load-btn"; |
| 55 | + assert_and_click "wesnoth-load-confirm"; |
| 56 | + |
| 57 | + # Focus display on lead figure |
| 58 | + send_key "l"; |
| 59 | + |
| 60 | + assert_screen "wesnoth-camp"; |
| 61 | + assert_and_click "wesnoth-endturn"; |
| 62 | + assert_and_click "wesnoth-confirm-endturn"; |
| 63 | + assert_screen "wesnoth-night"; |
| 64 | + assert_and_click "wesnoth-menu"; |
| 65 | + assert_and_click "wesnoth-menu-quit-to-desktop"; |
| 66 | + assert_and_click "wesnoth-menu-quit-to-desktop-confirm"; |
| 67 | +} |
| 68 | +1; |
0 commit comments