mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/BundleManagerUtil.java
public static void startBundle(WebDriver driver, String bundleSymbolicName) throws InterruptedException
    {
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_SYS_CONFIG, BUNDLE_TAB_ID);
        
        //Uses the bundle search bar feature to find the specified bundle.
        clearBundleFilter(driver);
        filterBundles(driver, bundleSymbolicName, true);
        
        Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                        StaleElementReferenceException.class);
        
        DebugText.pushText("Attempting to click start button until active");
        fwait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement bundleTable = driver.findElement(By.cssSelector("tbody[id*='bundleTable_data']"));
                WebElement bundleState = bundleTable.findElements(By.tagName("span")).get(3);
                
                //Check if bundle is resolved or installed.
                if (bundleState.getText().equals("Resolved") || bundleState.getText().equals("Installed"))
                {
                    //Start the bundle.
                    bundleTable.findElement(By.cssSelector("button[id*='start']")).click();
                    return true;
                }
                else if (bundleState.getText().equals("Active")) //bundle has already been started
                {
                    return true;
                }
                return false;
            }
        });
        DebugText.popText();
        
        //wait until filtered bundle reaches an active state
        DebugText.pushText("Waiting for active state update");
        fwait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("tbody span.bundleStateActive")));
        DebugText.popText();
        
        //Needed to give the bundle table time to update.
        GeneralHelper.sleepWithText(5, "Waiting for bundle table to completely update");
    }
/**
     * Method that either starts the specified bundle or ensures that it has been already started.
     * @param driver
     *      Instance of the {@link WebDriver} to be used.
     * @param bundleSymbolicName
     *      Symbolic name of the bundle to start.
     */
Method that either starts the specified bundle or ensures that it has been already started.
@param driver
Instance of the  WebDriver to be used.
@param bundleSymbolicName
Symbolic name of the bundle to start.
Method that either starts the specified bundle or ensures that it has been already started . @param driver Instance of the WebDriver to be used . @param bundleSymbolicName Symbolic name of the bundle to start .
public static void startBundle(WebDriver driver, String bundleSymbolicName) throws InterruptedException
    {
        NavigationHelper.pageAndTabCheck(driver, NavigationButtonNameConstants.NAVBUT_PROP_SYS_CONFIG, BUNDLE_TAB_ID);
        clearBundleFilter(driver);
        filterBundles(driver, bundleSymbolicName, true);
        Wait<WebDriver> fwait = new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                        StaleElementReferenceException.class);
        DebugText.pushText("Attempting to click start button until active");
        fwait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement bundleTable = driver.findElement(By.cssSelector("tbody[id*='bundleTable_data']"));
                WebElement bundleState = bundleTable.findElements(By.tagName("span")).get(3);
                if (bundleState.getText().equals("Resolved") || bundleState.getText().equals("Installed"))
                {
                    bundleTable.findElement(By.cssSelector("button[id*='start']")).click();
                    return true;
                }
                else if (bundleState.getText().equals("Active")) 
                {
                    return true;
                }
                return false;
            }
        });
        DebugText.popText();
        DebugText.pushText("Waiting for active state update");
        fwait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("tbody span.bundleStateActive")));
        DebugText.popText();
        GeneralHelper.sleepWithText(5, "Waiting for bundle table to completely update");
    }
public static void startBundle ( WebDriver driver , String bundleSymbolicName ) throws InterruptedException { NavigationHelper . pageAndTabCheck ( driver , NavigationButtonNameConstants . NAVBUT_PROP_SYS_CONFIG , BUNDLE_TAB_ID ) ; clearBundleFilter ( driver ) ; filterBundles ( driver , bundleSymbolicName , true ) ; Wait < WebDriver > fwait = new FluentWait < WebDriver > ( driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( NoSuchElementException . class , StaleElementReferenceException . class ) ; DebugText . pushText ( "Attempting to click start button until active" ) ; fwait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement bundleTable = driver . findElement ( By . cssSelector ( "tbody[id*='bundleTable_data']" ) ) ; WebElement bundleState = bundleTable . findElements ( By . tagName ( "span" ) ) . get ( 3 ) ; if ( bundleState . getText ( ) . equals ( "Resolved" ) || bundleState . getText ( ) . equals ( "Installed" ) ) { bundleTable . findElement ( By . cssSelector ( "button[id*='start']" ) ) . click ( ) ; return true ; } else if ( bundleState . getText ( ) . equals ( "Active" ) ) { return true ; } return false ; } } ) ; DebugText . popText ( ) ; DebugText . pushText ( "Waiting for active state update" ) ; fwait . until ( ExpectedConditions . presenceOfElementLocated ( By . cssSelector ( "tbody span.bundleStateActive" ) ) ) ; DebugText . popText ( ) ; GeneralHelper . sleepWithText ( 5 , "Waiting for bundle table to completely update" ) ; }
Method that either starts the specified bundle or ensures that it has been already started.
Method that either starts the specified bundle or ensures that it has been already started .
//Uses the bundle search bar feature to find the specified bundle. //Check if bundle is resolved or installed. //Start the bundle. //bundle has already been started //wait until filtered bundle reaches an active state //Needed to give the bundle table time to update.