From 338cb693dcd98235eb2106617f7b7b1f0e9622c6 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 9 Jan 2016 12:47:00 +0100 Subject: [PATCH] t/525-i3bar-mouse-bindings: wait for i3bar to appear before testing Otherwise, this test is flaky when i3bar takes a while to start. --- testcases/t/525-i3bar-mouse-bindings.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- 2.39.2