Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add test for The Battle For Wesnoth #16539

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions schedule/functional/extra_tests_gnome.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ conditional_schedule:
- '{{x86_64_tests}}'
- x11/multi_users_dm
- x11/gnucash
- gaming/wesnoth
- texlive/latexdiff
- appgeo/qgis
- x11/network/hwsim_wpa2_enterprise_setup
Expand Down
68 changes: 68 additions & 0 deletions tests/gaming/wesnoth.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Summary: The Battle for Wesnoth game test
# Maintainer: Christian Lanig <[email protected]>

use base "x11test";
use strict;
use warnings;
use testapi;

sub run {
select_console "x11";
ensure_installed "wesnoth", timeout => 600;
x11_start_program "wesnoth";

# Double click necessary to achieve focus on window
assert_and_click "wesnoth-preferences";
assert_and_click "wesnoth-preferences-display";
assert_and_click "wesnoth-preferences-display-anim-map";
assert_and_click "wesnoth-preferences-unit-standing-anim";
assert_and_click "wesnoth-preferences-display-idle-anim";
assert_and_click "wesnoth-preferences-close";
assert_and_click "wesnoth-campaign-button";
assert_and_click "wesnoth-campaign-brothers-select";
assert_and_click "wesnoth-play-btn";
assert_and_click "wesnoth-skip-btn";
assert_screen "wesnoth-ingame";

# Skip dialogue
for (1 .. 11) {
click_lastmatch;
}

assert_and_click "wesnoth-menu";
assert_and_click "wesnoth-save-game";
assert_and_click "wesnoth-save-btn";
assert_and_click "wesnoth-save-confirm";

# Sometimes mouse lands on the border shifting the displayed map area
mouse_set(100, 100);

# Focus display on lead figure
send_key "l";

assert_and_click "wesnoth-horseman";
assert_and_click "wesnoth-camp";
assert_screen "wesnoth-horseman-on-camp";
assert_and_click "wesnoth-fortress-field", button => "right";
assert_and_click "wesnoth-recruit";
assert_and_click "wesnoth-recruit-btn";
assert_screen "wesnoth-new-archer";
assert_and_click "wesnoth-menu";
assert_and_click "wesnoth-load-btn";
assert_and_click "wesnoth-load-confirm";

# Focus display on lead figure
send_key "l";

assert_screen "wesnoth-camp";
assert_and_click "wesnoth-endturn";
assert_and_click "wesnoth-confirm-endturn";
assert_screen "wesnoth-night";
assert_and_click "wesnoth-menu";
assert_and_click "wesnoth-menu-quit-to-desktop";
assert_and_click "wesnoth-menu-quit-to-desktop-confirm";
}
1;