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 my ($ws, $win1, $win2, $win3, $ws_con);
23 ###############################################################################
24 # Tets moving with 'id' criterion.
25 ###############################################################################
27 $ws = fresh_workspace;
33 # move win1 from the left to the right
34 cmd '[id="' . $win1->{id} . '"] move right';
36 # now they should be switched, with win2 still being focused
37 $ws_con = get_ws($ws);
39 # win2 should be on the left
40 is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with criteria');
41 is($x->input_focus, $win3->{id}, 'it should not disturb focus');
43 ###############################################################################
44 # Tets moving with 'window_type' criterion.
45 ###############################################################################
47 # test all window types
49 'normal' => '_NET_WM_WINDOW_TYPE_NORMAL',
50 'dialog' => '_NET_WM_WINDOW_TYPE_DIALOG',
51 'utility' => '_NET_WM_WINDOW_TYPE_UTILITY',
52 'toolbar' => '_NET_WM_WINDOW_TYPE_TOOLBAR',
53 'splash' => '_NET_WM_WINDOW_TYPE_SPLASH',
54 'menu' => '_NET_WM_WINDOW_TYPE_MENU',
55 'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU',
56 'popup_menu' => '_NET_WM_WINDOW_TYPE_POPUP_MENU',
57 'tooltip' => '_NET_WM_WINDOW_TYPE_TOOLTIP',
58 'notification' => '_NET_WM_WINDOW_TYPE_NOTIFICATION'
61 while (my ($window_type, $atom) = each %window_types) {
63 $ws = fresh_workspace;
65 $win1 = open_window(window_type => $x->atom(name => $atom));
69 cmd '[window_type="' . $window_type . '"] move right';
71 $ws_con = get_ws($ws);
72 is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with window_type = ' . $window_type);
73 is($x->input_focus, $win3->{id}, 'it should not disturb focus');
77 ###############################################################################