Skip to content

Commit f63312f

Browse files
committed
Add test for The Battle For Wesnoth
This commit adds a test for The Battle for Wesnoth. The test is the first test based on text based OCR needles. It checks the launch of the program, changing settings, starting a new game, recruiting and moving units, saving and loading, finishing the round and exiting the game.
1 parent 78a1972 commit f63312f

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

schedule/functional/extra_tests_gnome.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ conditional_schedule:
4747
- '{{x86_64_tests}}'
4848
- x11/multi_users_dm
4949
- x11/gnucash
50+
- gaming/wesnoth
5051
- texlive/latexdiff
5152
- appgeo/qgis
5253
- x11/network/hwsim_wpa2_enterprise_setup

tests/gaming/wesnoth.pm

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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

Comments
 (0)