From: Michael Stapelberg Date: Sat, 9 Jan 2016 11:47:00 +0000 (+0100) Subject: t/525-i3bar-mouse-bindings: wait for i3bar to appear before testing X-Git-Tag: 4.12~55 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=338cb693dcd98235eb2106617f7b7b1f0e9622c6;p=i3%2Fi3 t/525-i3bar-mouse-bindings: wait for i3bar to appear before testing Otherwise, this test is flaky when i3bar takes a while to start. --- diff --git a/testcases/t/525-i3bar-mouse-bindings.t b/testcases/t/525-i3bar-mouse-bindings.t index b76ccaf2..39690291 100644 --- a/testcases/t/525-i3bar-mouse-bindings.t +++ b/testcases/t/525-i3bar-mouse-bindings.t @@ -54,13 +54,22 @@ $i3->subscribe({ if ($event->{change} eq 'focus') { $cv->send($event->{container}); } + if ($event->{change} eq 'new') { + if (defined($event->{container}->{window_properties}->{class}) && + $event->{container}->{window_properties}->{class} eq 'i3bar') { + $cv->send($event->{container}); + } + } }, })->recv; +my $con = $cv->recv; +ok($con, 'i3bar appeared'); + my $left = open_window; my $right = open_window; sync_with_i3; -my $con = $cv->recv; +$con = $cv->recv; is($con->{window}, $right->{id}, 'focus is initially on the right container'); reset_test;