mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/NavigationHelper.java
public static void collapseLeftBarOnly(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#navigationLayout")));
        
        //Checks to make sure the left side bar isn't already collapsed. If it is then just return.
        if (!driver.findElement(By.cssSelector("div#navigationLayout")).isDisplayed())
        {
            return;
        }
        
        WebElement leftSideBar = driver.findElement(By.cssSelector("div#navigationLayout"));
        WebElement collapseButton = 
                leftSideBar.findElement(By.cssSelector("span[class='ui-icon ui-icon-triangle-1-w']"));
        assertThat(collapseButton, is(notNullValue()));
        //An action is used instead of a standard click due to the fact that IE throws an element not found exception
        //when using the standard click. Using an action works in both IE and Firefox.
        Actions builder = new Actions(driver);
        builder.moveToElement(collapseButton).click().build().perform();
        //Wait for the left side bar primefaces element to collapse. Cannot wait till element is invisible because it
        //is deemed invisible before it is fully closed.
        Thread.sleep(500);
    }
/**
     * Function to collapse only the left side bar from the main template. 
     * @param driver
     *  the web driver performing the test
     */
Function to collapse only the left side bar from the main template.
@param driver
the web driver performing the test
Function to collapse only the left side bar from the main template . @param driver the web driver performing the test
public static void collapseLeftBarOnly(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#navigationLayout")));
        if (!driver.findElement(By.cssSelector("div#navigationLayout")).isDisplayed())
        {
            return;
        }
        WebElement leftSideBar = driver.findElement(By.cssSelector("div#navigationLayout"));
        WebElement collapseButton = 
                leftSideBar.findElement(By.cssSelector("span[class='ui-icon ui-icon-triangle-1-w']"));
        assertThat(collapseButton, is(notNullValue()));
        Actions builder = new Actions(driver);
        builder.moveToElement(collapseButton).click().build().perform();
        Thread.sleep(500);
    }
public static void collapseLeftBarOnly ( final WebDriver driver ) throws InterruptedException { WebDriverWait wait = new WebDriverWait ( driver , 5 ) ; wait . until ( ExpectedConditions . presenceOfElementLocated ( By . cssSelector ( "div#navigationLayout" ) ) ) ; if ( ! driver . findElement ( By . cssSelector ( "div#navigationLayout" ) ) . isDisplayed ( ) ) { return ; } WebElement leftSideBar = driver . findElement ( By . cssSelector ( "div#navigationLayout" ) ) ; WebElement collapseButton = leftSideBar . findElement ( By . cssSelector ( "span[class='ui-icon ui-icon-triangle-1-w']" ) ) ; assertThat ( collapseButton , is ( notNullValue ( ) ) ) ; Actions builder = new Actions ( driver ) ; builder . moveToElement ( collapseButton ) . click ( ) . build ( ) . perform ( ) ; Thread . sleep ( 500 ) ; }
Function to collapse only the left side bar from the main template.
Function to collapse only the left side bar from the main template .
//Checks to make sure the left side bar isn't already collapsed. If it is then just return. //An action is used instead of a standard click due to the fact that IE throws an element not found exception //when using the standard click. Using an action works in both IE and Firefox. //Wait for the left side bar primefaces element to collapse. Cannot wait till element is invisible because it //is deemed invisible before it is fully closed.