mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/ChannelsHelper.java
public static void createSocketChannel(final WebDriver driver, final String host, final String port,
            final String ssl) throws InterruptedException, ExecutionException, TimeoutException
    {
        //navigate to the channels page if not already there.
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_CHANNELS, null);

        //collapse sidebars
        NavigationHelper.collapseSideBars(driver);
        
        final WebDriverWait wait = new WebDriverWait(driver, 5);
        
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button[id*='addChannel']")));
        final WebElement addChannel = driver.findElement(By.cssSelector("button[id*='addChannel']"));
        assertThat(addChannel, is(notNullValue()));
        addChannel.click();
        
        //now we are on the enter page
        WebElement propsOutputPanel = driver.findElement(By.id("propsDlg"));
        
        WebElement hostName = propsOutputPanel.findElement(By.xpath("//input[contains(@id, 'hostName')]"));
        WebElement hostPort = propsOutputPanel.findElement(By.xpath("//input[contains(@id, 'hostPort')]"));
        WebElement enableSsl = propsOutputPanel.findElement(By.cssSelector("div[id$='enableSsl']"));
        WebElement createButton = propsOutputPanel.findElement(By.xpath("//button[contains(@id, 'createChanButton')]"));
        
        assertThat(hostName, is(notNullValue()));
        assertThat(hostPort, is(notNullValue()));
        assertThat(enableSsl, is(notNullValue()));
        assertThat(createButton, is(notNullValue()));
        
        //change host if not default
        if (!hostName.equals("localhost"))
        {
            hostName.clear();
            hostName.sendKeys(host);
        }
        
        //change port if not default
        if (!hostPort.equals("4000"))
        {
            hostPort.clear();
            hostPort.sendKeys(port);
        }
        
        //change SSL if not equal to desired state
        if (!enableSsl.findElement(By.cssSelector("span")).getText().equals(ssl))
        {
            //toggle SSL button
            enableSsl.click();
        }

        //Create channel and verify controller added growl message is displayed.
        GrowlVerifier.verifyAndWaitToDisappear(25, createButton, "Controller Info:");
        
        final Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(5, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                        StaleElementReferenceException.class);
        
        //confirm that socket with specified ID and port is there
        final Boolean foundSocket = fwait.until(new Function<WebDriver, Boolean>()
        {
            @Override
            public Boolean apply(final WebDriver driver)
            {
                final WebElement socketTable = driver.findElement(SOCKET_TABLE_SELECTOR);
                for (final WebElement element : socketTable.findElements(By.tagName("tr")))
                {
                    List<WebElement> rowCells = element.findElements(By.tagName("td"));
                    WebElement hostDiv = rowCells.get(1).findElement(By.tagName("div"));
                    WebElement portDiv = rowCells.get(2).findElement(By.tagName("div"));
                    WebElement enableSslDiv = rowCells.get(3).findElement(By.tagName("div"));
                    
                    //confirm that socket with specified ID and port is there
                    if (hostDiv.getText().equals(host) && portDiv.getText().equals(port)
                            && enableSslDiv.getText().equals(Boolean.toString(ssl.equals(ENABLE_SSL))))
                    {
                        return true;
                    }
                }
                return false;
            }
        });
        
        assertThat(foundSocket, notNullValue());
        assertThat(foundSocket, is(true));
        
        //return to initial state
        NavigationHelper.expandLeftSideBarOnly(driver);
    }
/**
     * Creates a socket channel for the controller with the id and name specified with 
     * the specified host name, port and SSL state. This function assumes currently on
     * channels page.
     * @param driver
     *  the web driver performing the tests
     * @param host
     *  the host name of the socket to be created
     * @param port
     *  the port of the socket to be created 
     * @param ssl
     *  Yes or No to indicate whether an SSL socket should be used
     */
Creates a socket channel for the controller with the id and name specified with
the specified host name, port and SSL state. This function assumes currently on
channels page.
@param driver
the web driver performing the tests
@param host
the host name of the socket to be created
@param port
the port of the socket to be created
@param ssl
Yes or No to indicate whether an SSL socket should be used
Creates a socket channel for the controller with the id and name specified with the specified host name port and SSL state . This function assumes currently on channels page . @param driver the web driver performing the tests @param host the host name of the socket to be created @param port the port of the socket to be created @param ssl Yes or No to indicate whether an SSL socket should be used
public static void createSocketChannel(final WebDriver driver, final String host, final String port,
            final String ssl) throws InterruptedException, ExecutionException, TimeoutException
    {
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_CHANNELS, null);
        NavigationHelper.collapseSideBars(driver);
        final WebDriverWait wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button[id*='addChannel']")));
        final WebElement addChannel = driver.findElement(By.cssSelector("button[id*='addChannel']"));
        assertThat(addChannel, is(notNullValue()));
        addChannel.click();
        WebElement propsOutputPanel = driver.findElement(By.id("propsDlg"));
        WebElement hostName = propsOutputPanel.findElement(By.xpath("//input[contains(@id, 'hostName')]"));
        WebElement hostPort = propsOutputPanel.findElement(By.xpath("//input[contains(@id, 'hostPort')]"));
        WebElement enableSsl = propsOutputPanel.findElement(By.cssSelector("div[id$='enableSsl']"));
        WebElement createButton = propsOutputPanel.findElement(By.xpath("//button[contains(@id, 'createChanButton')]"));
        assertThat(hostName, is(notNullValue()));
        assertThat(hostPort, is(notNullValue()));
        assertThat(enableSsl, is(notNullValue()));
        assertThat(createButton, is(notNullValue()));
        if (!hostName.equals("localhost"))
        {
            hostName.clear();
            hostName.sendKeys(host);
        }
        if (!hostPort.equals("4000"))
        {
            hostPort.clear();
            hostPort.sendKeys(port);
        }
        if (!enableSsl.findElement(By.cssSelector("span")).getText().equals(ssl))
        {
            enableSsl.click();
        }
        GrowlVerifier.verifyAndWaitToDisappear(25, createButton, "Controller Info:");
        final Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(5, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                        StaleElementReferenceException.class);
        final Boolean foundSocket = fwait.until(new Function<WebDriver, Boolean>()
        {
            @Override
            public Boolean apply(final WebDriver driver)
            {
                final WebElement socketTable = driver.findElement(SOCKET_TABLE_SELECTOR);
                for (final WebElement element : socketTable.findElements(By.tagName("tr")))
                {
                    List<WebElement> rowCells = element.findElements(By.tagName("td"));
                    WebElement hostDiv = rowCells.get(1).findElement(By.tagName("div"));
                    WebElement portDiv = rowCells.get(2).findElement(By.tagName("div"));
                    WebElement enableSslDiv = rowCells.get(3).findElement(By.tagName("div"));
                    if (hostDiv.getText().equals(host) && portDiv.getText().equals(port)
                            && enableSslDiv.getText().equals(Boolean.toString(ssl.equals(ENABLE_SSL))))
                    {
                        return true;
                    }
                }
                return false;
            }
        });
        assertThat(foundSocket, notNullValue());
        assertThat(foundSocket, is(true));
        NavigationHelper.expandLeftSideBarOnly(driver);
    }
public static void createSocketChannel ( final WebDriver driver , final String host , final String port , final String ssl ) throws InterruptedException , ExecutionException , TimeoutException { NavigationHelper . pageAndTabCheck ( driver , NavigationButtonNameConstants . NAVBUT_PROP_CHANNELS , null ) ; NavigationHelper . collapseSideBars ( driver ) ; final WebDriverWait wait = new WebDriverWait ( driver , 5 ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "button[id*='addChannel']" ) ) ) ; final WebElement addChannel = driver . findElement ( By . cssSelector ( "button[id*='addChannel']" ) ) ; assertThat ( addChannel , is ( notNullValue ( ) ) ) ; addChannel . click ( ) ; WebElement propsOutputPanel = driver . findElement ( By . id ( "propsDlg" ) ) ; WebElement hostName = propsOutputPanel . findElement ( By . xpath ( "//input[contains(@id, 'hostName')]" ) ) ; WebElement hostPort = propsOutputPanel . findElement ( By . xpath ( "//input[contains(@id, 'hostPort')]" ) ) ; WebElement enableSsl = propsOutputPanel . findElement ( By . cssSelector ( "div[id$='enableSsl']" ) ) ; WebElement createButton = propsOutputPanel . findElement ( By . xpath ( "//button[contains(@id, 'createChanButton')]" ) ) ; assertThat ( hostName , is ( notNullValue ( ) ) ) ; assertThat ( hostPort , is ( notNullValue ( ) ) ) ; assertThat ( enableSsl , is ( notNullValue ( ) ) ) ; assertThat ( createButton , is ( notNullValue ( ) ) ) ; if ( ! hostName . equals ( "localhost" ) ) { hostName . clear ( ) ; hostName . sendKeys ( host ) ; } if ( ! hostPort . equals ( "4000" ) ) { hostPort . clear ( ) ; hostPort . sendKeys ( port ) ; } if ( ! enableSsl . findElement ( By . cssSelector ( "span" ) ) . getText ( ) . equals ( ssl ) ) { enableSsl . click ( ) ; } GrowlVerifier . verifyAndWaitToDisappear ( 25 , createButton , "Controller Info:" ) ; final Wait < WebDriver > fwait = new FluentWait < WebDriver > ( driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 5 , TimeUnit . SECONDS ) . ignoring ( NoSuchElementException . class , StaleElementReferenceException . class ) ; final Boolean foundSocket = fwait . until ( new Function < WebDriver , Boolean > ( ) { @ Override public Boolean apply ( final WebDriver driver ) { final WebElement socketTable = driver . findElement ( SOCKET_TABLE_SELECTOR ) ; for ( final WebElement element : socketTable . findElements ( By . tagName ( "tr" ) ) ) { List < WebElement > rowCells = element . findElements ( By . tagName ( "td" ) ) ; WebElement hostDiv = rowCells . get ( 1 ) . findElement ( By . tagName ( "div" ) ) ; WebElement portDiv = rowCells . get ( 2 ) . findElement ( By . tagName ( "div" ) ) ; WebElement enableSslDiv = rowCells . get ( 3 ) . findElement ( By . tagName ( "div" ) ) ; if ( hostDiv . getText ( ) . equals ( host ) && portDiv . getText ( ) . equals ( port ) && enableSslDiv . getText ( ) . equals ( Boolean . toString ( ssl . equals ( ENABLE_SSL ) ) ) ) { return true ; } } return false ; } } ) ; assertThat ( foundSocket , notNullValue ( ) ) ; assertThat ( foundSocket , is ( true ) ) ; NavigationHelper . expandLeftSideBarOnly ( driver ) ; }
Creates a socket channel for the controller with the id and name specified with
 the specified host name, port and SSL state.
Creates a socket channel for the controller with the id and name specified with the specified host name port and SSL state .
//navigate to the channels page if not already there. //collapse sidebars //now we are on the enter page //change host if not default //change port if not default //change SSL if not equal to desired state //toggle SSL button //Create channel and verify controller added growl message is displayed. //confirm that socket with specified ID and port is there //confirm that socket with specified ID and port is there //return to initial state