mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/NavigationHelper.java
public static void expandRightSideBarOnly(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#controllerLayout")));
        
        //Checks to make sure the right side bar isn't already expanded. If it is then just return.
        if (driver.findElement(By.cssSelector("div[id='controllerLayout']")).isDisplayed())
        {
            return;
        }
        
        wait.until(ExpectedConditions.presenceOfElementLocated(
                By.xpath("//div[contains(@id, 'controllerLayout-toggler')]")));
        WebElement rightSideBar = driver.findElement(
                By.xpath("//div[contains(@id, 'controllerLayout-toggler')]"));
        
        assertThat(rightSideBar, is(notNullValue()));
        
        WebElement rightButton = rightSideBar.findElement(By.tagName("a"));
        
        assertThat(rightButton, 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(rightButton).click().build().perform();
        //Wait for the right side bar primefaces element to expand. Cannot wait till element is visible because it
        //is deemed visible before it is fully opened.
        Thread.sleep(500);
    }
/**
     * Function to only expand the right side bar when it is collapsed.
     * @param driver
     *  the web driver that is performing the test
     */
Function to only expand the right side bar when it is collapsed.
@param driver
the web driver that is performing the test
Function to only expand the right side bar when it is collapsed . @param driver the web driver that is performing the test
public static void expandRightSideBarOnly(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#controllerLayout")));
        if (driver.findElement(By.cssSelector("div[id='controllerLayout']")).isDisplayed())
        {
            return;
        }
        wait.until(ExpectedConditions.presenceOfElementLocated(
                By.xpath("//div[contains(@id, 'controllerLayout-toggler')]")));
        WebElement rightSideBar = driver.findElement(
                By.xpath("//div[contains(@id, 'controllerLayout-toggler')]"));
        assertThat(rightSideBar, is(notNullValue()));
        WebElement rightButton = rightSideBar.findElement(By.tagName("a"));
        assertThat(rightButton, is(notNullValue()));
        Actions builder = new Actions(driver);
        builder.moveToElement(rightButton).click().build().perform();
        Thread.sleep(500);
    }
public static void expandRightSideBarOnly ( final WebDriver driver ) throws InterruptedException { WebDriverWait wait = new WebDriverWait ( driver , 5 ) ; wait . until ( ExpectedConditions . presenceOfElementLocated ( By . cssSelector ( "div#controllerLayout" ) ) ) ; if ( driver . findElement ( By . cssSelector ( "div[id='controllerLayout']" ) ) . isDisplayed ( ) ) { return ; } wait . until ( ExpectedConditions . presenceOfElementLocated ( By . xpath ( "//div[contains(@id, 'controllerLayout-toggler')]" ) ) ) ; WebElement rightSideBar = driver . findElement ( By . xpath ( "//div[contains(@id, 'controllerLayout-toggler')]" ) ) ; assertThat ( rightSideBar , is ( notNullValue ( ) ) ) ; WebElement rightButton = rightSideBar . findElement ( By . tagName ( "a" ) ) ; assertThat ( rightButton , is ( notNullValue ( ) ) ) ; Actions builder = new Actions ( driver ) ; builder . moveToElement ( rightButton ) . click ( ) . build ( ) . perform ( ) ; Thread . sleep ( 500 ) ; }
Function to only expand the right side bar when it is collapsed.
Function to only expand the right side bar when it is collapsed .
//Checks to make sure the right side bar isn't already expanded. 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 right side bar primefaces element to expand. Cannot wait till element is visible because it //is deemed visible before it is fully opened.