ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] RFC: test-aboutdialog (GUI)
@ 2005-06-18 16:36 Alexey Tourbin
  2005-06-18 18:26 ` [devel] " Konstantin A. Lepikhov
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexey Tourbin @ 2005-06-18 16:36 UTC (permalink / raw)
  To: devel


[-- Attachment #1.1: Type: text/plain, Size: 2179 bytes --]

Здравствуйте.

Вопрос "примитивного" тестирования GUI, в целом, проработан: найден
способ отслеживания окон и передаче окнам нажатий клавиш -- это умеет
делать перловый модуль X11::GUITest (в сизифе пока нет).

Предлагается создать пакет test-aboutdialog (или с другим похожим
названием), который занимается следующим:

1) Запускает приложение;
2) Вызывает About dialog (Help->About);
3) Закрывает About dialog;
4) Закрывает приложение (File->Exit).

Нужно теперь сформировать список приложений, которые будут тестироваться
таким образом -- их не должно быть слишком много, но и не должно быть
слишком мало.  Сейчас мне удаётся (или почти удается) тестировать таким
образом gedit, gqvew, knoqueror и firefox.  Думаю, что ещё
десяток-другой нужно добавить.

$ DISPLAY=:0 perl test-gedit.pl
ok 1 # launch gedit
ok 2 # found gedit window 16777220
ok 3 # sent %(h)a
ok 4 # found About dialog 16777371
ok 5 # sent %(c)
ok 6 # About dialog 16777371 closed
ok 7 # sent %(f)q
ok 8 # gedit window 16777220 closed
ok 1 # launch gqview
ok 2 # found gqview window 16777220
ok 3 # sent %(h)a
ok 4 # found About dialog 16777372
ok 5 # sent %(c)
ok 6 # About dialog 16777372 closed
ok 7 # sent %(f)x
ok 8 # gqview window 16777220 closed
ok 1 # launch firefox
ok 2 # found firefox window 16777268
ok 3 # sent %(h)a
ok 4 # found About dialog 16777505
ok 5 # sent

ok 6 # About dialog 16777505 closed
ok 7 # sent %(f)q
ok 8 # firefox window 16777268 closed
ok 1 # launch konqueror
kbuildsycoca running...
konqueror: ERROR: Error in BrowserExtension::actionSlotMap(), unknown action : searchProvider
ok 2 # found konqueror window 16777223
ok 3 # sent %(h)a
ok 4 # found About dialog 16777830
QPixmap: Invalid pixmap parameters
ok 5 # sent %(c)
ok 6 # About dialog 16777830 closed
ok 7 # sent %(l)q
ok 8 # konqueror window 16777223 closed
$ xMutex destroy failure: Device or resource busy
ICE default IO error handler doing an exit(), pid = 10042, errno = 0

Как видим, konqueror шлёт нам какие-то проклятия, но не фатальные.
Под Xvfb пока не работает, не знаю точно почему. :(

Кто что думает или может посоветовать/помочь -- пишите.

[-- Attachment #1.2: test-gedit.pl --]
[-- Type: text/plain, Size: 1702 bytes --]

#!/usr/bin/perl

use strict;

use sigtrap qw(die normal-signals);

END {
	local $SIG{TERM} = 'IGNORE';
	kill TERM => -$$;
}

use X11::GUITest qw(StartApp WaitWindowViewable SendKeys WaitWindowClose);

sub testAboutDialog {
	my $app = shift;
	my %args = (
		wname	=> $app,	# window name pattern
		dname	=> 'About',	# dialog name pattern
		dopen	=> '%(h)a',	# Alt-H a (open dialog)
		dclose	=> '%(c)',	# Alt-C (close dialog)
		wclose	=> '%(f)q',	# Alt-F q (close window)
		@_
	);

	StartApp($app) and print "ok 1 # launch $app\n"
		or die "unable to launch $app\n"; sleep 1;

	my ($win) = WaitWindowViewable($args{wname});
	$win and print "ok 2 # found $args{wname} window $win\n"
		or die "unable to find $args{wname} window\n"; sleep 1;

	SendKeys($args{dopen}) and print "ok 3 # sent $args{dopen}\n"
		or die "unable to send $args{dopen}\n"; sleep 1;

	my ($dia) = WaitWindowViewable($args{dname});
	$dia and print "ok 4 # found $args{dname} dialog $dia\n"
		or die "unable to find $args{dname} dialog\n"; sleep 1;

	SendKeys($args{dclose}) and print "ok 5 # sent $args{dclose}\n"
		or die "unable to send $args{dclose}\n"; sleep 1;

	WaitWindowClose($dia) and print "ok 6 # $args{dname} dialog $dia closed\n"
		or die "unable to close $args{dname} dialog $dia\n"; sleep 1;

	SendKeys($args{wclose}) and print "ok 7 # sent $args{wclose}\n"
		or die "unable to send $args{wclose}\n"; sleep 1;

	WaitWindowClose($win) and print "ok 8 # $args{wname} window $win closed\n"
		or die "unable to close $args{wname} window $win\n"; sleep 1;
}

testAboutDialog("gedit");
testAboutDialog("gqview", wclose => "%(f)x");
testAboutDialog("firefox", dclose => "\n");
testAboutDialog("konqueror", wclose => "%(l)q");

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-07-21 18:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-18 16:36 [devel] RFC: test-aboutdialog (GUI) Alexey Tourbin
2005-06-18 18:26 ` [devel] " Konstantin A. Lepikhov
2005-06-18 19:02   ` Alexey Tourbin
2005-06-18 21:09     ` Konstantin A. Lepikhov
2005-06-18 22:10 ` Alexey Tourbin
2005-06-18 22:58   ` Alexey Tourbin
2005-07-13  4:06     ` Alexey Tourbin
2005-07-21 18:25       ` [devel] Xvfb keyboard Alexey Tourbin
2005-06-20  7:25 ` [devel] RFC: test-aboutdialog (GUI) Sviataslau Svirydau
2005-06-20 12:14   ` [devel] " Alexey Tourbin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git