mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/AssetCommandHelper.java
public static void executeGetCommand(final WebDriver driver, final String assetName, 
            final String command, final String textToVerify) throws InterruptedException
    {
        clickAccordionPanel(driver, assetName, "Get Commands", ExpandCollapse.EXPAND);
        
        final WebElement assetCommandPanel = getAssetCommandPanel(driver, assetName);
        WebElement commandTab = assetCommandPanel.findElement(By.linkText(command));
        assertThat(commandTab, notNullValue());
        
        commandTab.click();
        
        //wait to give time for tab to change. 
        Thread.sleep(2000);
        
        WebElement tabDiv = assetCommandPanel.findElement(By.cssSelector(
                "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']"));
        
        WebElement executeButton = tabDiv.findElement(By.cssSelector("button[id$='executeButton']"));
        assertThat(executeButton, notNullValue());
        executeButton.click();
        
        GrowlChecker.findGrowlMessage(driver, "Asset Command Executed:");
        
        Wait<WebDriver> fWait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS)
                .pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        
        fWait.until(new ExpectedCondition<Boolean>(){
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement div = assetCommandPanel.findElement(By.cssSelector(
                        "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']"));
                
                WebElement textArea = div.findElement(By.cssSelector(
                        "textarea[id$='responseData'][aria-disabled='false']"));
                
                return textArea.getText().contains(textToVerify);
            }
        });
        
        tabDiv = assetCommandPanel.findElement(By.cssSelector(
                "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']"));
        
        WebElement time = tabDiv.findElement(By.cssSelector("span[id$='timeData']"));
        assertThat(time, notNullValue());
        
        assertThat(time.getText(), not(equalTo("Time Received: N/A")));
    }
/**
     * Executes a get command for a specified asset and verifies the received data.
     * @param driver
     *  the web driver to use
     * @param assetName
     *  the name of the asset on which the get command is to be performed
     * @param command
     *  the name of the command that is to be performed. In this case, command corresponds to the tab shown 
     *  within the "Get Commands" accordion panel.
     *  @param textToVerify
     *  the text output that is to be verified as having shown up when get command is executed. (Text comparison 
     *  performed will be a contains check)
     */
Executes a get command for a specified asset and verifies the received data.
@param driver
the web driver to use
@param assetName
the name of the asset on which the get command is to be performed
@param command
the name of the command that is to be performed. In this case, command corresponds to the tab shown
within the "Get Commands" accordion panel.
@param textToVerify
the text output that is to be verified as having shown up when get command is executed. (Text comparison
performed will be a contains check)
Executes a get command for a specified asset and verifies the received data . @param driver the web driver to use @param assetName the name of the asset on which the get command is to be performed @param command the name of the command that is to be performed . In this case command corresponds to the tab shown within the " Get Commands " accordion panel . @param textToVerify the text output that is to be verified as having shown up when get command is executed . ( Text comparison performed will be a contains check )
public static void executeGetCommand(final WebDriver driver, final String assetName, 
            final String command, final String textToVerify) throws InterruptedException
    {
        clickAccordionPanel(driver, assetName, "Get Commands", ExpandCollapse.EXPAND);
        final WebElement assetCommandPanel = getAssetCommandPanel(driver, assetName);
        WebElement commandTab = assetCommandPanel.findElement(By.linkText(command));
        assertThat(commandTab, notNullValue());
        commandTab.click();
        Thread.sleep(2000);
        WebElement tabDiv = assetCommandPanel.findElement(By.cssSelector(
                "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']"));
        WebElement executeButton = tabDiv.findElement(By.cssSelector("button[id$='executeButton']"));
        assertThat(executeButton, notNullValue());
        executeButton.click();
        GrowlChecker.findGrowlMessage(driver, "Asset Command Executed:");
        Wait<WebDriver> fWait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS)
                .pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        fWait.until(new ExpectedCondition<Boolean>(){
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement div = assetCommandPanel.findElement(By.cssSelector(
                        "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']"));
                WebElement textArea = div.findElement(By.cssSelector(
                        "textarea[id$='responseData'][aria-disabled='false']"));
                return textArea.getText().contains(textToVerify);
            }
        });
        tabDiv = assetCommandPanel.findElement(By.cssSelector(
                "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']"));
        WebElement time = tabDiv.findElement(By.cssSelector("span[id$='timeData']"));
        assertThat(time, notNullValue());
        assertThat(time.getText(), not(equalTo("Time Received: N/A")));
    }
public static void executeGetCommand ( final WebDriver driver , final String assetName , final String command , final String textToVerify ) throws InterruptedException { clickAccordionPanel ( driver , assetName , "Get Commands" , ExpandCollapse . EXPAND ) ; final WebElement assetCommandPanel = getAssetCommandPanel ( driver , assetName ) ; WebElement commandTab = assetCommandPanel . findElement ( By . linkText ( command ) ) ; assertThat ( commandTab , notNullValue ( ) ) ; commandTab . click ( ) ; Thread . sleep ( 2000 ) ; WebElement tabDiv = assetCommandPanel . findElement ( By . cssSelector ( "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']" ) ) ; WebElement executeButton = tabDiv . findElement ( By . cssSelector ( "button[id$='executeButton']" ) ) ; assertThat ( executeButton , notNullValue ( ) ) ; executeButton . click ( ) ; GrowlChecker . findGrowlMessage ( driver , "Asset Command Executed:" ) ; Wait < WebDriver > fWait = new FluentWait < WebDriver > ( driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( StaleElementReferenceException . class , NoSuchElementException . class ) ; fWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement div = assetCommandPanel . findElement ( By . cssSelector ( "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']" ) ) ; WebElement textArea = div . findElement ( By . cssSelector ( "textarea[id$='responseData'][aria-disabled='false']" ) ) ; return textArea . getText ( ) . contains ( textToVerify ) ; } } ) ; tabDiv = assetCommandPanel . findElement ( By . cssSelector ( "div[id*='getCommandTab'][role='tabpanel'][aria-hidden='false']" ) ) ; WebElement time = tabDiv . findElement ( By . cssSelector ( "span[id$='timeData']" ) ) ; assertThat ( time , notNullValue ( ) ) ; assertThat ( time . getText ( ) , not ( equalTo ( "Time Received: N/A" ) ) ) ; }
Executes a get command for a specified asset and verifies the received data.
Executes a get command for a specified asset and verifies the received data .
//wait to give time for tab to change. 