Skip to content

Commit

Permalink
adding more delay with a condition for testCancelOnFrameClosure
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Jan 5, 2024
1 parent c79bb10 commit 59ae389
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test-integration/studio/ui/EditorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.assertj.swing.finder.WindowFinder;
import org.assertj.swing.fixture.FrameFixture;
import org.assertj.swing.fixture.JMenuItemFixture;
import org.assertj.swing.timing.Condition;
import org.assertj.swing.timing.Timeout;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Expand Down Expand Up @@ -121,7 +123,12 @@ protected boolean isMatching(StudioWindow f) {
//tear down
newFrameFixture.close();
optionPaneButtonClick("No");
pause(50, TimeUnit.MILLISECONDS); // wait as closure happens asynchronously
newFrameFixture.requireNotVisible();

pause(new Condition("Wait till new window is closed") {
@Override
public boolean test() {
return !execute(newFrameFixture.target()::isVisible);
}
}, Timeout.timeout(1, TimeUnit.SECONDS));
}
}

0 comments on commit 59ae389

Please sign in to comment.