package guitests;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import guitests.guihandles.HelpWindowHandle;
import seedu.address.logic.commands.HelpCommand;

public class HelpWindowTest extends AddressBookGuiTest {

    @Test
    public void openHelpWindow() {
        //use accelerator
        getCommandBox().click();
        getMainMenu().openHelpWindowUsingAccelerator();
        assertHelpWindowOpen();

        getResultDisplay().click();
        getMainMenu().openHelpWindowUsingAccelerator();
        assertHelpWindowOpen();

        getPersonListPanel().click();
        getMainMenu().openHelpWindowUsingAccelerator();
        assertHelpWindowOpen();

        getBrowserPanel().click();
        getMainMenu().openHelpWindowUsingAccelerator();
        assertHelpWindowNotOpen();

        //use menu button
        getMainMenu().openHelpWindowUsingMenu();
        assertHelpWindowOpen();

        //use command box
        runCommand(HelpCommand.COMMAND_WORD);
        assertHelpWindowOpen();
    }

    /**
     * Asserts that the help window is open, and closes it after checking.
     */
    private void assertHelpWindowOpen() {
        assertTrue(HelpWindowHandle.isWindowPresent());
        guiRobot.pauseForHuman();

        new HelpWindowHandle(guiRobot.getStage(HelpWindowHandle.HELP_WINDOW_TITLE)).close();
        mainWindowHandle.focus();
    }

    /**
     * Asserts that the help window isn't open.
     */
    private void assertHelpWindowNotOpen() {
        assertFalse(HelpWindowHandle.isWindowPresent());
    }

}

@@ -275,16 +275,445 @@
 uiTest %7B
+%0A    private static final String ERROR_MESSAGE = %22ATTENTION!!!! : On some computers, this test may fail when run on %22%0A            + %22non-headless mode as FxRobot#clickOn(Node, MouseButton...) clicks on the wrong location. We suspect %22%0A            + %22that this is a bug with TestFX library that we are using. If this test fails, you have to run your %22%0A            + %22tests on headless mode. See UsingGradle.adoc on how to do so.%22;
 %0A%0A    @T
@@ -1649,16 +1649,31 @@
 ertTrue(
+ERROR_MESSAGE, 
 HelpWind
@@ -1999,16 +1999,31 @@
 rtFalse(
+ERROR_MESSAGE, 
 HelpWind

Write header comments concerning possible test failure (#694)