mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/observation/ObservationImageHelper.java
public static void verifyImageIsDisplayed(WebDriver driver)
    {
        WebDriverWait wait = new WebDriverWait(driver, 60);
        
        //Wait for the observation view dialog to be visible.
        WebElement viewerDialog = driver.findElement(By.cssSelector("div[id*='digitalMediaViewer']"));
        wait.until(ExpectedConditions.visibilityOf(viewerDialog));
        
        //Verify that the download button on the observation view dialog is displayed.
        WebElement dlImage = viewerDialog.findElement(By.cssSelector("button[id*='dlImage']"));
        assertThat(dlImage.isDisplayed(), is(true));
        
        //Verify that the image is displayed and that the alternative information is correct.
        WebElement image = viewerDialog.findElement(By.cssSelector("img[id*='obsImageHasRes']"));
        assertThat(image.isDisplayed(), is(true));
        assertThat(image.getAttribute("alt").
                equals("Image type not supported by browser. Please download image to view."), is(true));
        
        //Close the observation viewer dialog.
        WebElement closeDialog = viewerDialog.findElement(By.cssSelector(
                "span[class*='ui-icon ui-icon-closethick']"));
        closeDialog.click();
        
        //Wait till the observation viewer dialog is no longer visible.
        wait.until(ExpectedConditions.invisibilityOfElementLocated(
                By.cssSelector("div[id*='observationViewer']")));
        assertThat(viewerDialog.isDisplayed(), is(false));
    }
/**
     * Verify that the image dialogue is displayed correctly. Assumes the view image button of
     * observation has already been clicked and will detect the elements of the digital media viewer.
     *  
     * @param driver
     *      Selenium Web Driver
     */
Verify that the image dialogue is displayed correctly. Assumes the view image button of
observation has already been clicked and will detect the elements of the digital media viewer.

@param driver
Selenium Web Driver
Verify that the image dialogue is displayed correctly . Assumes the view image button of observation has already been clicked and will detect the elements of the digital media viewer . @param driver Selenium Web Driver
public static void verifyImageIsDisplayed(WebDriver driver)
    {
        WebDriverWait wait = new WebDriverWait(driver, 60);
        WebElement viewerDialog = driver.findElement(By.cssSelector("div[id*='digitalMediaViewer']"));
        wait.until(ExpectedConditions.visibilityOf(viewerDialog));
        WebElement dlImage = viewerDialog.findElement(By.cssSelector("button[id*='dlImage']"));
        assertThat(dlImage.isDisplayed(), is(true));
        WebElement image = viewerDialog.findElement(By.cssSelector("img[id*='obsImageHasRes']"));
        assertThat(image.isDisplayed(), is(true));
        assertThat(image.getAttribute("alt").
                equals("Image type not supported by browser. Please download image to view."), is(true));
        WebElement closeDialog = viewerDialog.findElement(By.cssSelector(
                "span[class*='ui-icon ui-icon-closethick']"));
        closeDialog.click();
        wait.until(ExpectedConditions.invisibilityOfElementLocated(
                By.cssSelector("div[id*='observationViewer']")));
        assertThat(viewerDialog.isDisplayed(), is(false));
    }
public static void verifyImageIsDisplayed ( WebDriver driver ) { WebDriverWait wait = new WebDriverWait ( driver , 60 ) ; WebElement viewerDialog = driver . findElement ( By . cssSelector ( "div[id*='digitalMediaViewer']" ) ) ; wait . until ( ExpectedConditions . visibilityOf ( viewerDialog ) ) ; WebElement dlImage = viewerDialog . findElement ( By . cssSelector ( "button[id*='dlImage']" ) ) ; assertThat ( dlImage . isDisplayed ( ) , is ( true ) ) ; WebElement image = viewerDialog . findElement ( By . cssSelector ( "img[id*='obsImageHasRes']" ) ) ; assertThat ( image . isDisplayed ( ) , is ( true ) ) ; assertThat ( image . getAttribute ( "alt" ) . equals ( "Image type not supported by browser. Please download image to view." ) , is ( true ) ) ; WebElement closeDialog = viewerDialog . findElement ( By . cssSelector ( "span[class*='ui-icon ui-icon-closethick']" ) ) ; closeDialog . click ( ) ; wait . until ( ExpectedConditions . invisibilityOfElementLocated ( By . cssSelector ( "div[id*='observationViewer']" ) ) ) ; assertThat ( viewerDialog . isDisplayed ( ) , is ( false ) ) ; }
Verify that the image dialogue is displayed correctly.
Verify that the image dialogue is displayed correctly .
//Wait for the observation view dialog to be visible. //Verify that the download button on the observation view dialog is displayed. //Verify that the image is displayed and that the alternative information is correct. //Close the observation viewer dialog. //Wait till the observation viewer dialog is no longer visible.