mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/asset/TestScanForAssets.java
@Test
    public void testScanForAssetsButton() throws InterruptedException
    {
        //Click scan for assets button.
        GrowlVerifier.verifyAndWaitToDisappear(20, m_Driver.findElement(
                By.cssSelector("button[id$='scanForAssets']")), "Asset created.");

        
        //Sleep for a second to ensure that AJAX has completed.
        Thread.sleep(1000);
        
        Wait<WebDriver> fwait = new FluentWait<WebDriver>(m_Driver).withTimeout(20, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        
        //Wait for the created asset to appear in the assets list.
        Boolean result = fwait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                return AssetHelper.retrieveAsset(driver, "FoundExAsset") != null;
            }
        });
        
        assertThat(result, is(true));
    }
/**
     * Verify that the scan for assets buttons updates the asset page for any assets found when scanning the system.
     */
Verify that the scan for assets buttons updates the asset page for any assets found when scanning the system.
Verify that the scan for assets buttons updates the asset page for any assets found when scanning the system .
@Test
    public void testScanForAssetsButton() throws InterruptedException
    {
        GrowlVerifier.verifyAndWaitToDisappear(20, m_Driver.findElement(
                By.cssSelector("button[id$='scanForAssets']")), "Asset created.");
        Thread.sleep(1000);
        Wait<WebDriver> fwait = new FluentWait<WebDriver>(m_Driver).withTimeout(20, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        Boolean result = fwait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                return AssetHelper.retrieveAsset(driver, "FoundExAsset") != null;
            }
        });
        assertThat(result, is(true));
    }
@ Test public void testScanForAssetsButton ( ) throws InterruptedException { GrowlVerifier . verifyAndWaitToDisappear ( 20 , m_Driver . findElement ( By . cssSelector ( "button[id$='scanForAssets']" ) ) , "Asset created." ) ; Thread . sleep ( 1000 ) ; Wait < WebDriver > fwait = new FluentWait < WebDriver > ( m_Driver ) . withTimeout ( 20 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( StaleElementReferenceException . class , NoSuchElementException . class ) ; Boolean result = fwait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { return AssetHelper . retrieveAsset ( driver , "FoundExAsset" ) != null ; } } ) ; assertThat ( result , is ( true ) ) ; }
Verify that the scan for assets buttons updates the asset page for any assets found when scanning the system.
Verify that the scan for assets buttons updates the asset page for any assets found when scanning the system .
//Click scan for assets button. //Sleep for a second to ensure that AJAX has completed. //Wait for the created asset to appear in the assets list.