mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/AssetHelper.java
public static void deactivateAsset(final WebDriver driver, final String assetName) throws InterruptedException
    {
        //Initial page/tab check.
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_ASSETS, ASSET_CONFIG_TAB_ID);
        
        //Retrieve the asset to be deactivated.
        WebElement asset = retrieveAsset(driver, assetName);
        if (asset != null)
        {
            //--deactivate the asset
            asset.findElement(By.cssSelector("button[id*='deactivationButton']")).click();
            
            Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                    pollingEvery(2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                            StaleElementReferenceException.class);
            
            //Wait till the status of the asset is deactivated.
            Boolean result = fwait.until(new ExpectedCondition<Boolean>()
            {
                @Override
                public Boolean apply(WebDriver driver)
                {
                    WebElement asset = retrieveAsset(driver, assetName);
                    WebElement status = asset.findElement(By.cssSelector("span[id*='assetActiveStatus']"));
                    return status.getText().matches("DEACTIVATED");
                }
            });
            // TODO: TH-3085: Re-enable verification of deactivation status
            //assertThat(result, is(true));
            LOG.info("Asset deactivated: " + result);
            return;
        }
        throw new IllegalArgumentException("No asset found with name: " + assetName);
    }
/**
     * Assuming an asset with the given name is already created and activated, remove the asset.
     */
Assuming an asset with the given name is already created and activated, remove the asset.
Assuming an asset with the given name is already created and activated remove the asset .
public static void deactivateAsset(final WebDriver driver, final String assetName) throws InterruptedException
    {
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_ASSETS, ASSET_CONFIG_TAB_ID);
        WebElement asset = retrieveAsset(driver, assetName);
        if (asset != null)
        {
            asset.findElement(By.cssSelector("button[id*='deactivationButton']")).click();
            Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                    pollingEvery(2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                            StaleElementReferenceException.class);
            Boolean result = fwait.until(new ExpectedCondition<Boolean>()
            {
                @Override
                public Boolean apply(WebDriver driver)
                {
                    WebElement asset = retrieveAsset(driver, assetName);
                    WebElement status = asset.findElement(By.cssSelector("span[id*='assetActiveStatus']"));
                    return status.getText().matches("DEACTIVATED");
                }
            });
            LOG.info("Asset deactivated: " + result);
            return;
        }
        throw new IllegalArgumentException("No asset found with name: " + assetName);
    }
public static void deactivateAsset ( final WebDriver driver , final String assetName ) throws InterruptedException { NavigationHelper . pageAndTabCheck ( driver , NavigationButtonNameConstants . NAVBUT_PROP_ASSETS , ASSET_CONFIG_TAB_ID ) ; WebElement asset = retrieveAsset ( driver , assetName ) ; if ( asset != null ) { asset . findElement ( By . cssSelector ( "button[id*='deactivationButton']" ) ) . click ( ) ; Wait < WebDriver > fwait = new FluentWait < WebDriver > ( driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( NoSuchElementException . class , StaleElementReferenceException . class ) ; Boolean result = fwait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement asset = retrieveAsset ( driver , assetName ) ; WebElement status = asset . findElement ( By . cssSelector ( "span[id*='assetActiveStatus']" ) ) ; return status . getText ( ) . matches ( "DEACTIVATED" ) ; } } ) ; LOG . info ( "Asset deactivated: " + result ) ; return ; } throw new IllegalArgumentException ( "No asset found with name: " + assetName ) ; }
Assuming an asset with the given name is already created and activated, remove the asset.
Assuming an asset with the given name is already created and activated remove the asset .
//Initial page/tab check. //Retrieve the asset to be deactivated. //--deactivate the asset //Wait till the status of the asset is deactivated. // TODO: TH-3085: Re-enable verification of deactivation status //assertThat(result, is(true));