mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/observation/ObservationHelper.java
public static void verifyObservationPanel(WebElement panel, ExpectedObservation observation)
    {
        //verify asset name
        WebElement wassetName = panel.findElement(By.cssSelector("span[id*='obsAssetName']"));
        assertThat(wassetName.getText(), is(observation.getAssetName()));
        
        //verify mode
        WebElement mode;
        switch (observation.getSystemMode())
        {
            case TEST_MODE:
                mode = panel.findElement(By.cssSelector("img[id*='testMode']"));
                String opSource = mode.getAttribute("src");
                String opPic = ImageHelper.getPictureOrIconName(opSource, ".png");
                assertThat(opPic, is(observation.retireveExpectedSystemModeImage()));
                break;
            case OPERATIONAL_MODE:
                mode = panel.findElement(By.cssSelector("img[id*='opMode']"));
                String testSource = mode.getAttribute("src");
                String testPic = ImageHelper.getPictureOrIconName(testSource, ".png");
                assertThat(testPic, is(observation.retireveExpectedSystemModeImage()));
                break;
        }
        
        //verify icons
        WebElement obImage = panel.findElement(By.cssSelector("table>tbody>tr:nth-child(1)>td:nth-child(3)"));
        List<WebElement> images = obImage.findElements(By.tagName("img"));
        
        if (observation.hasRelatedObs())
        {
            WebElement linkImg = panel.findElement(By.cssSelector("table>tbody>tr:nth-child(1)>td:nth-child(4)"));
            images.add(linkImg.findElement(By.tagName("img")));
        }
        
        verifyImageSet(images, observation.retrieveExpectedHeaderImages());

        // verify created time
        WebElement time = panel.findElement(By.cssSelector("span[id*='obsCreatedTime']"));
        assertThat(time.getText().isEmpty(), is(false));

        // verify observed time if set in observation
        if (observation.hasObservedTime())
        {
            time = panel.findElement(By.cssSelector("span[id*='obsObservedTime']"));
            assertThat(time.getText().isEmpty(), is(false));
        }
    }
/**
     * Function to verify observation panels. This function takes a panel to search in, a expected mode icon
     * to look for, and a list of expected images to be found.
     */
Function to verify observation panels. This function takes a panel to search in, a expected mode icon
to look for, and a list of expected images to be found.
Function to verify observation panels . This function takes a panel to search in a expected mode icon to look for and a list of expected images to be found .
public static void verifyObservationPanel(WebElement panel, ExpectedObservation observation)
    {
        WebElement wassetName = panel.findElement(By.cssSelector("span[id*='obsAssetName']"));
        assertThat(wassetName.getText(), is(observation.getAssetName()));
        WebElement mode;
        switch (observation.getSystemMode())
        {
            case TEST_MODE:
                mode = panel.findElement(By.cssSelector("img[id*='testMode']"));
                String opSource = mode.getAttribute("src");
                String opPic = ImageHelper.getPictureOrIconName(opSource, ".png");
                assertThat(opPic, is(observation.retireveExpectedSystemModeImage()));
                break;
            case OPERATIONAL_MODE:
                mode = panel.findElement(By.cssSelector("img[id*='opMode']"));
                String testSource = mode.getAttribute("src");
                String testPic = ImageHelper.getPictureOrIconName(testSource, ".png");
                assertThat(testPic, is(observation.retireveExpectedSystemModeImage()));
                break;
        }
        WebElement obImage = panel.findElement(By.cssSelector("table>tbody>tr:nth-child(1)>td:nth-child(3)"));
        List<WebElement> images = obImage.findElements(By.tagName("img"));
        if (observation.hasRelatedObs())
        {
            WebElement linkImg = panel.findElement(By.cssSelector("table>tbody>tr:nth-child(1)>td:nth-child(4)"));
            images.add(linkImg.findElement(By.tagName("img")));
        }
        verifyImageSet(images, observation.retrieveExpectedHeaderImages());
        WebElement time = panel.findElement(By.cssSelector("span[id*='obsCreatedTime']"));
        assertThat(time.getText().isEmpty(), is(false));
        if (observation.hasObservedTime())
        {
            time = panel.findElement(By.cssSelector("span[id*='obsObservedTime']"));
            assertThat(time.getText().isEmpty(), is(false));
        }
    }
public static void verifyObservationPanel ( WebElement panel , ExpectedObservation observation ) { WebElement wassetName = panel . findElement ( By . cssSelector ( "span[id*='obsAssetName']" ) ) ; assertThat ( wassetName . getText ( ) , is ( observation . getAssetName ( ) ) ) ; WebElement mode ; switch ( observation . getSystemMode ( ) ) { case TEST_MODE : mode = panel . findElement ( By . cssSelector ( "img[id*='testMode']" ) ) ; String opSource = mode . getAttribute ( "src" ) ; String opPic = ImageHelper . getPictureOrIconName ( opSource , ".png" ) ; assertThat ( opPic , is ( observation . retireveExpectedSystemModeImage ( ) ) ) ; break ; case OPERATIONAL_MODE : mode = panel . findElement ( By . cssSelector ( "img[id*='opMode']" ) ) ; String testSource = mode . getAttribute ( "src" ) ; String testPic = ImageHelper . getPictureOrIconName ( testSource , ".png" ) ; assertThat ( testPic , is ( observation . retireveExpectedSystemModeImage ( ) ) ) ; break ; } WebElement obImage = panel . findElement ( By . cssSelector ( "table>tbody>tr:nth-child(1)>td:nth-child(3)" ) ) ; List < WebElement > images = obImage . findElements ( By . tagName ( "img" ) ) ; if ( observation . hasRelatedObs ( ) ) { WebElement linkImg = panel . findElement ( By . cssSelector ( "table>tbody>tr:nth-child(1)>td:nth-child(4)" ) ) ; images . add ( linkImg . findElement ( By . tagName ( "img" ) ) ) ; } verifyImageSet ( images , observation . retrieveExpectedHeaderImages ( ) ) ; WebElement time = panel . findElement ( By . cssSelector ( "span[id*='obsCreatedTime']" ) ) ; assertThat ( time . getText ( ) . isEmpty ( ) , is ( false ) ) ; if ( observation . hasObservedTime ( ) ) { time = panel . findElement ( By . cssSelector ( "span[id*='obsObservedTime']" ) ) ; assertThat ( time . getText ( ) . isEmpty ( ) , is ( false ) ) ; } }
Function to verify observation panels.
Function to verify observation panels .
//verify asset name //verify mode //verify icons // verify created time // verify observed time if set in observation