package guitests;

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

import org.junit.Test;

import guitests.guihandles.HelpWindowHandle;

public class HelpWindowTest extends TaskListGuiTest {

    @Test
    public void openHelpWindow() {
        //use accelerator
        commandBox.clickOnTextField();
        assertHelpWindowOpen(mainMenu.openHelpWindowUsingAccelerator());

        resultDisplay.clickOnTextArea();
        assertHelpWindowOpen(mainMenu.openHelpWindowUsingAccelerator());

        taskListPanel.clickOnListView();
        assertHelpWindowOpen(mainMenu.openHelpWindowUsingAccelerator());

        browserPanel.clickOnWebView();
        assertHelpWindowNotOpen(mainMenu.openHelpWindowUsingAccelerator());

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

        //use command
        assertHelpWindowOpen(commandBox.runHelpCommand());
    }

    private void assertHelpWindowOpen(HelpWindowHandle helpWindowHandle) {
        assertTrue(helpWindowHandle.isWindowOpen());
        helpWindowHandle.closeWindow();
    }

    private void assertHelpWindowNotOpen(HelpWindowHandle helpWindowHandle) {
        assertFalse(helpWindowHandle.isWindowOpen());
    }

}

@@ -16,52 +16,8 @@
 s;%0A%0A
-import static org.junit.Assert.assertFalse;%0A
 impo
@@ -55,16 +55,16 @@
 rtTrue;%0A
+
 %0Aimport 
@@ -599,124 +599,8 @@
 );%0A%0A
-        browserPanel.clickOnWebView();%0A        assertHelpWindowNotOpen(mainMenu.openHelpWindowUsingAccelerator());%0A%0A
     
@@ -900,24 +900,24 @@
 dowOpen());%0A
+
         help
@@ -955,145 +955,6 @@
  %7D%0A%0A
-    private void assertHelpWindowNotOpen(HelpWindowHandle helpWindowHandle) %7B%0A        assertFalse(helpWindowHandle.isWindowOpen());%0A    %7D%0A%0A
 %7D%0A

remove browser clicking in HelpWindowTest