X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Ft%2F503-workspace.t;h=cb0ad92f6dfd77274d616fbb04c4177ee450b161;hb=29dc14dda3abd6c401f5ab133afc7cba44e293ff;hp=7122cb34f503761e34af70d94e760e14b2be6533;hpb=ed2bcc15e384be99225a247435f6cff678e64f0c;p=i3%2Fi3 diff --git a/testcases/t/503-workspace.t b/testcases/t/503-workspace.t index 7122cb34..cb0ad92f 100644 --- a/testcases/t/503-workspace.t +++ b/testcases/t/503-workspace.t @@ -1,15 +1,37 @@ #!perl # vim:ts=4:sw=4:expandtab # +# Please read the following documents before working on tests: +# • https://build.i3wm.org/docs/testsuite.html +# (or docs/testsuite) +# +# • https://build.i3wm.org/docs/lib-i3test.html +# (alternatively: perldoc ./testcases/lib/i3test.pm) +# +# • https://build.i3wm.org/docs/ipc.html +# (or docs/ipc) +# +# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf +# (unless you are already familiar with Perl) +# # Tests whether 'workspace next_on_output' and the like work correctly. # use List::Util qw(first); -use i3test; +use i3test i3_config => <root->warp_pointer(0, 0); +sync_with_i3; + is(focused_ws, '1', 'starting on workspace 1'); # ensure workspace 1 stays open open_window; @@ -37,8 +59,18 @@ open_window; # output 2: 2 cmd 'workspace 1'; cmd 'workspace next'; +# We need to sync after changing focus to a different output to wait for the +# EnterNotify to be processed, otherwise it will be processed at some point +# later in time and mess up our subsequent tests. +sync_with_i3; + is(focused_ws, '2', 'workspace 2 focused'); cmd 'workspace next'; +# We need to sync after changing focus to a different output to wait for the +# EnterNotify to be processed, otherwise it will be processed at some point +# later in time and mess up our subsequent tests. +sync_with_i3; + is(focused_ws, '5', 'workspace 5 focused'); ################################################################################ @@ -57,6 +89,10 @@ cmd 'workspace prev_on_output'; is(focused_ws, '1', 'workspace 1 focused'); cmd 'workspace 2'; +# We need to sync after changing focus to a different output to wait for the +# EnterNotify to be processed, otherwise it will be processed at some point +# later in time and mess up our subsequent tests. +sync_with_i3; cmd 'workspace prev_on_output'; is(focused_ws, '2', 'workspace 2 focused');