mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/channel/TestChannelSetup.java
@Test
    public void testCreateChannelImage() throws InterruptedException
    {
        //navigate to the channels page
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_CHANNELS);

        //collapse sidebars
        NavigationHelper.collapseSideBars(m_Driver);
        
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button[id*='addChannel']")));
        WebElement addChannel = m_Driver.findElement(By.cssSelector("button[id*='addChannel']"));
        assertThat(addChannel, is(notNullValue()));
        addChannel.click();
        
        // wait for dialog to show
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("propsDlg")));
        
        // need to change channel type
        final WebElement changeChannelType = m_Driver.findElement(By.cssSelector("button[id*='changeChannelType']"));
        changeChannelType.click();
        
        wait.until(ExpectedConditions.visibilityOfElementLocated(
                By.cssSelector("div[id*='chooseChannelTable']")));
        final WebElement newChannelTable = m_Driver.findElement(By.cssSelector("tbody[id$='chooseChannelTable_data']"));
        
        WebElement channelImg = newChannelTable.findElement(By.tagName("img"));
        assertThat(channelImg.isDisplayed(), is(true));
        
        String source = channelImg.getAttribute("src");
        String img = ImageHelper.getPictureOrIconName(source, ".png");
        
        assertThat(img, is("socket.png"));
        
        //close the dialog
        WebElement closeButton = m_Driver.findElement(By.cssSelector("span[class='ui-icon ui-icon-closethick']"));
        closeButton.click();
    }
/**
     * Verify socket image is correct when choosing the channel type in the add channel dialog.
     */
Verify socket image is correct when choosing the channel type in the add channel dialog.
Verify socket image is correct when choosing the channel type in the add channel dialog .
@Test
    public void testCreateChannelImage() throws InterruptedException
    {
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_CHANNELS);
        NavigationHelper.collapseSideBars(m_Driver);
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button[id*='addChannel']")));
        WebElement addChannel = m_Driver.findElement(By.cssSelector("button[id*='addChannel']"));
        assertThat(addChannel, is(notNullValue()));
        addChannel.click();
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("propsDlg")));
        final WebElement changeChannelType = m_Driver.findElement(By.cssSelector("button[id*='changeChannelType']"));
        changeChannelType.click();
        wait.until(ExpectedConditions.visibilityOfElementLocated(
                By.cssSelector("div[id*='chooseChannelTable']")));
        final WebElement newChannelTable = m_Driver.findElement(By.cssSelector("tbody[id$='chooseChannelTable_data']"));
        WebElement channelImg = newChannelTable.findElement(By.tagName("img"));
        assertThat(channelImg.isDisplayed(), is(true));
        String source = channelImg.getAttribute("src");
        String img = ImageHelper.getPictureOrIconName(source, ".png");
        assertThat(img, is("socket.png"));
        WebElement closeButton = m_Driver.findElement(By.cssSelector("span[class='ui-icon ui-icon-closethick']"));
        closeButton.click();
    }
@ Test public void testCreateChannelImage ( ) throws InterruptedException { NavigationHelper . navigateToPage ( m_Driver , NavigationButtonNameConstants . NAVBUT_PROP_CHANNELS ) ; NavigationHelper . collapseSideBars ( m_Driver ) ; WebDriverWait wait = new WebDriverWait ( m_Driver , 5 ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "button[id*='addChannel']" ) ) ) ; WebElement addChannel = m_Driver . findElement ( By . cssSelector ( "button[id*='addChannel']" ) ) ; assertThat ( addChannel , is ( notNullValue ( ) ) ) ; addChannel . click ( ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . id ( "propsDlg" ) ) ) ; final WebElement changeChannelType = m_Driver . findElement ( By . cssSelector ( "button[id*='changeChannelType']" ) ) ; changeChannelType . click ( ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "div[id*='chooseChannelTable']" ) ) ) ; final WebElement newChannelTable = m_Driver . findElement ( By . cssSelector ( "tbody[id$='chooseChannelTable_data']" ) ) ; WebElement channelImg = newChannelTable . findElement ( By . tagName ( "img" ) ) ; assertThat ( channelImg . isDisplayed ( ) , is ( true ) ) ; String source = channelImg . getAttribute ( "src" ) ; String img = ImageHelper . getPictureOrIconName ( source , ".png" ) ; assertThat ( img , is ( "socket.png" ) ) ; WebElement closeButton = m_Driver . findElement ( By . cssSelector ( "span[class='ui-icon ui-icon-closethick']" ) ) ; closeButton . click ( ) ; }
Verify socket image is correct when choosing the channel type in the add channel dialog.
Verify socket image is correct when choosing the channel type in the add channel dialog .
//navigate to the channels page //collapse sidebars // wait for dialog to show // need to change channel type //close the dialog