From c4d1d95a456ff595ab29c400f274c6438f0c270b Mon Sep 17 00:00:00 2001 From: dzmipt Date: Fri, 5 Jan 2024 22:48:02 +0100 Subject: [PATCH] add delay to EditorTest --- src/studio/ui/StudioWindow.java | 2 -- test-integration/studio/ui/EditorTest.java | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/studio/ui/StudioWindow.java b/src/studio/ui/StudioWindow.java index 0ab6f1fd..4e794e55 100755 --- a/src/studio/ui/StudioWindow.java +++ b/src/studio/ui/StudioWindow.java @@ -835,11 +835,9 @@ public void close() { } else { boolean result = execute(editorTab -> editorTab.getEditorsPanel().closeTab(editorTab)); if (!result) return; - log.info("StudioWindow closing"); // closing the last tab would trigger this code again if (allWindows.contains(this)) { allWindows.remove(this); - log.info("StudioWindow disposing"); dispose(); refreshAllMenus(); } diff --git a/test-integration/studio/ui/EditorTest.java b/test-integration/studio/ui/EditorTest.java index f9ee3403..f72b10a4 100644 --- a/test-integration/studio/ui/EditorTest.java +++ b/test-integration/studio/ui/EditorTest.java @@ -11,8 +11,10 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.util.concurrent.TimeUnit; import static org.assertj.swing.edt.GuiActionRunner.execute; +import static org.assertj.swing.timing.Pause.pause; import static org.junit.Assert.assertEquals; public class EditorTest extends StudioTest { @@ -112,11 +114,14 @@ protected boolean isMatching(StudioWindow f) { newFrameFixture.textBox("editor1").enterText("x"); newFrameFixture.menuItem("Close Window").click(); optionPaneButtonClick("Cancel"); + + pause(50, TimeUnit.MILLISECONDS); // wait as closure happens asynchronously newFrameFixture.requireVisible(); //tear down newFrameFixture.close(); optionPaneButtonClick("No"); + pause(50, TimeUnit.MILLISECONDS); // wait as closure happens asynchronously newFrameFixture.requireNotVisible(); } }