2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Test that the `move [direction]` command works with criteria
18 # Bug still in: 4.8-16-g6888a1f
21 ###############################################################################
22 # Tets moving with 'id' criterion.
23 ###############################################################################
25 my $ws = fresh_workspace;
27 my $win1 = open_window;
28 my $win2 = open_window;
29 my $win3 = open_window;
31 # move win1 from the left to the right
32 cmd '[id="' . $win1->{id} . '"] move right';
34 # now they should be switched, with win2 still being focused
35 my $ws_con = get_ws($ws);
37 # win2 should be on the left
38 is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with criteria');
39 is($x->input_focus, $win3->{id}, 'it should not disturb focus');
41 ###############################################################################
42 # Tets moving with 'window_type' criterion.
43 ###############################################################################
45 # test all window types
47 'normal' => '_NET_WM_WINDOW_TYPE_NORMAL',
48 'dialog' => '_NET_WM_WINDOW_TYPE_DIALOG',
49 'utility' => '_NET_WM_WINDOW_TYPE_UTILITY',
50 'toolbar' => '_NET_WM_WINDOW_TYPE_TOOLBAR',
51 'splash' => '_NET_WM_WINDOW_TYPE_SPLASH',
52 'menu' => '_NET_WM_WINDOW_TYPE_MENU',
53 'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU',
54 'popup_menu' => '_NET_WM_WINDOW_TYPE_POPUP_MENU',
55 'tooltip' => '_NET_WM_WINDOW_TYPE_TOOLTIP'
58 while (my ($window_type, $atom) = each %window_types) {
60 $ws = fresh_workspace;
62 $win1 = open_window(window_type => $x->atom(name => $atom));
66 cmd '[window_type="' . $window_type . '"] move right';
68 $ws_con = get_ws($ws);
69 is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with window_type = ' . $window_type);
70 is($x->input_focus, $win3->{id}, 'it should not disturb focus');
74 ###############################################################################