mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/channel/TestChannelSetup.java
@Test
    public void testControllerHistoryConnectButton() throws InterruptedException, ExecutionException, TimeoutException
    {
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_CHANNELS);
        
        //Remove the channel if existent
        List<WebElement> channels = ChannelsHelper.retrieveChannelsList(m_Driver, ChannelsHelper.SOCKET_TABLE_SELECTOR);
        if (channels.size() >= 1)
        {
            for (WebElement element: channels)
            {
                List<WebElement> channelInfo = element.findElements(By.cssSelector("div[class='ui-dt-c']"));
                //occasionally due to the speed and order of tests the driver will say there are elements, but
                //there aren't, so verify that the element has data, ie, an actual channel, before checking fields 
                if (channelInfo.size() > 2 && channelInfo.get(1).getText().equals(ChannelsHelper.HOST_NAME))
                {
                    ChannelsHelper.removeSocketChannel(m_Driver, "localhost", "4000", false);
                }
            }
        }
        
        final By quickConnectBtnSelector = By.cssSelector("button[id$='quickConnectBtn']");
        NavigationHelper.expandRightSideBarOnly(m_Driver);
        GeneralHelper.safeClickBySelector(quickConnectBtnSelector);
        
        // wait for the controller to respond
        try
        {
            Thread.sleep(2000);
        }
        catch (InterruptedException exception)
        {
            exception.printStackTrace();
        }
        
        //check that the controller side bar has the controller now
        WebElement newController = ControllerHelper.getControllerListElement(
            m_Driver, ControllerHelper.DEFAULT_CONTROLLER_NAME);
        assertThat("Controller with name " + ControllerHelper.DEFAULT_CONTROLLER_NAME + " could not be found.", 
                newController, is(notNullValue()));
        assertThat(newController.getText(), containsString(ControllerHelper.getControllerName()));
    }
/**
     * Verify that localhost can be connected to using the controller history quick connect button.
     */
Verify that localhost can be connected to using the controller history quick connect button.
Verify that localhost can be connected to using the controller history quick connect button .
@Test
    public void testControllerHistoryConnectButton() throws InterruptedException, ExecutionException, TimeoutException
    {
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_CHANNELS);
        List<WebElement> channels = ChannelsHelper.retrieveChannelsList(m_Driver, ChannelsHelper.SOCKET_TABLE_SELECTOR);
        if (channels.size() >= 1)
        {
            for (WebElement element: channels)
            {
                List<WebElement> channelInfo = element.findElements(By.cssSelector("div[class='ui-dt-c']"));
                if (channelInfo.size() > 2 && channelInfo.get(1).getText().equals(ChannelsHelper.HOST_NAME))
                {
                    ChannelsHelper.removeSocketChannel(m_Driver, "localhost", "4000", false);
                }
            }
        }
        final By quickConnectBtnSelector = By.cssSelector("button[id$='quickConnectBtn']");
        NavigationHelper.expandRightSideBarOnly(m_Driver);
        GeneralHelper.safeClickBySelector(quickConnectBtnSelector);
        try
        {
            Thread.sleep(2000);
        }
        catch (InterruptedException exception)
        {
            exception.printStackTrace();
        }
        WebElement newController = ControllerHelper.getControllerListElement(
            m_Driver, ControllerHelper.DEFAULT_CONTROLLER_NAME);
        assertThat("Controller with name " + ControllerHelper.DEFAULT_CONTROLLER_NAME + " could not be found.", 
                newController, is(notNullValue()));
        assertThat(newController.getText(), containsString(ControllerHelper.getControllerName()));
    }
@ Test public void testControllerHistoryConnectButton ( ) throws InterruptedException , ExecutionException , TimeoutException { NavigationHelper . navigateToPage ( m_Driver , NavigationButtonNameConstants . NAVBUT_PROP_CHANNELS ) ; List < WebElement > channels = ChannelsHelper . retrieveChannelsList ( m_Driver , ChannelsHelper . SOCKET_TABLE_SELECTOR ) ; if ( channels . size ( ) >= 1 ) { for ( WebElement element : channels ) { List < WebElement > channelInfo = element . findElements ( By . cssSelector ( "div[class='ui-dt-c']" ) ) ; if ( channelInfo . size ( ) > 2 && channelInfo . get ( 1 ) . getText ( ) . equals ( ChannelsHelper . HOST_NAME ) ) { ChannelsHelper . removeSocketChannel ( m_Driver , "localhost" , "4000" , false ) ; } } } final By quickConnectBtnSelector = By . cssSelector ( "button[id$='quickConnectBtn']" ) ; NavigationHelper . expandRightSideBarOnly ( m_Driver ) ; GeneralHelper . safeClickBySelector ( quickConnectBtnSelector ) ; try { Thread . sleep ( 2000 ) ; } catch ( InterruptedException exception ) { exception . printStackTrace ( ) ; } WebElement newController = ControllerHelper . getControllerListElement ( m_Driver , ControllerHelper . DEFAULT_CONTROLLER_NAME ) ; assertThat ( "Controller with name " + ControllerHelper . DEFAULT_CONTROLLER_NAME + " could not be found." , newController , is ( notNullValue ( ) ) ) ; assertThat ( newController . getText ( ) , containsString ( ControllerHelper . getControllerName ( ) ) ) ; }
Verify that localhost can be connected to using the controller history quick connect button.
Verify that localhost can be connected to using the controller history quick connect button .
//Remove the channel if existent //occasionally due to the speed and order of tests the driver will say there are elements, but //there aren't, so verify that the element has data, ie, an actual channel, before checking fields  // wait for the controller to respond //check that the controller side bar has the controller now