diff --git a/src/test/java/seedu/address/ui/HelpWindowTest.java b/src/test/java/seedu/address/ui/HelpWindowTest.java index 461f5bba2eae..4fcb1fcfb9f7 100644 --- a/src/test/java/seedu/address/ui/HelpWindowTest.java +++ b/src/test/java/seedu/address/ui/HelpWindowTest.java @@ -46,8 +46,11 @@ public void isShowing_helpWindowIsHiding_returnsFalse() { } @Test - public void focus_helpWindowNotFocused_focused() { + public void focus_helpWindowNotFocused_focused() throws Exception { guiRobot.interact(helpWindow::show); + + // Focus on another stage to remove focus from the helpWindow + FxToolkit.setupStage(Stage::requestFocus); assertFalse(helpWindow.getRoot().isFocused()); guiRobot.interact(helpWindow::focus);