mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/observation/ObservationFilterHelper.java
public static void clickFilterByDateCheckBox(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 30);
        
        wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.cssSelector("div[id$='filterByDate']"))));
        WebElement checkBoxDiv = driver.findElement(By.cssSelector("div[id$='filterByDate']"));
        
        //collect possible elements
        List<WebElement> startInput = driver.findElements(By.cssSelector("input[id$='startDateFilter_input']"));
        List<WebElement> endInput = driver.findElements(By.cssSelector("input[id$='endDateFilter_input']"));
        //click the checkbox
        WebElement dateCheckBox = checkBoxDiv.findElement(By.cssSelector("div[class*='ui-chkbox-box']"));
        dateCheckBox.click();
        
        if (startInput.isEmpty() || endInput.isEmpty())
        {
            //If empty then the filter by date is not currently selected and therefore should
            //wait till the filter by date panel is displayed before continuing.
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id$='startDateFilter_input']")));
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id$='endDateFilter_input']")));
        }
        else
        {
            //If not empty then filter by date is currently selected and therefore should wait till the filter by
            //date panel is no longer displayed before continuing.
            wait.until(ExpectedConditions.invisibilityOfElementLocated(
                    By.cssSelector("input[id$='startDateFilter_input']")));
            wait.until(ExpectedConditions.invisibilityOfElementLocated(
                    By.cssSelector("input[id$='endDateFilter_input']")));
        }
    }
/**
     * Method checks the filter by date check box on the observation tab.
     * 
     * @param driver
     *      {@link WebDriver} currently in use for running the tests.
     */
Method checks the filter by date check box on the observation tab.

@param driver
WebDriver currently in use for running the tests.
Method checks the filter by date check box on the observation tab . @param driver WebDriver currently in use for running the tests .
public static void clickFilterByDateCheckBox(final WebDriver driver) throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(driver, 30);
        wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.cssSelector("div[id$='filterByDate']"))));
        WebElement checkBoxDiv = driver.findElement(By.cssSelector("div[id$='filterByDate']"));
        List<WebElement> startInput = driver.findElements(By.cssSelector("input[id$='startDateFilter_input']"));
        List<WebElement> endInput = driver.findElements(By.cssSelector("input[id$='endDateFilter_input']"));
        WebElement dateCheckBox = checkBoxDiv.findElement(By.cssSelector("div[class*='ui-chkbox-box']"));
        dateCheckBox.click();
        if (startInput.isEmpty() || endInput.isEmpty())
        {
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id$='startDateFilter_input']")));
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id$='endDateFilter_input']")));
        }
        else
        {
            wait.until(ExpectedConditions.invisibilityOfElementLocated(
                    By.cssSelector("input[id$='startDateFilter_input']")));
            wait.until(ExpectedConditions.invisibilityOfElementLocated(
                    By.cssSelector("input[id$='endDateFilter_input']")));
        }
    }
public static void clickFilterByDateCheckBox ( final WebDriver driver ) throws InterruptedException { WebDriverWait wait = new WebDriverWait ( driver , 30 ) ; wait . until ( ExpectedConditions . visibilityOf ( driver . findElement ( By . cssSelector ( "div[id$='filterByDate']" ) ) ) ) ; WebElement checkBoxDiv = driver . findElement ( By . cssSelector ( "div[id$='filterByDate']" ) ) ; List < WebElement > startInput = driver . findElements ( By . cssSelector ( "input[id$='startDateFilter_input']" ) ) ; List < WebElement > endInput = driver . findElements ( By . cssSelector ( "input[id$='endDateFilter_input']" ) ) ; WebElement dateCheckBox = checkBoxDiv . findElement ( By . cssSelector ( "div[class*='ui-chkbox-box']" ) ) ; dateCheckBox . click ( ) ; if ( startInput . isEmpty ( ) || endInput . isEmpty ( ) ) { wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "input[id$='startDateFilter_input']" ) ) ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "input[id$='endDateFilter_input']" ) ) ) ; } else { wait . until ( ExpectedConditions . invisibilityOfElementLocated ( By . cssSelector ( "input[id$='startDateFilter_input']" ) ) ) ; wait . until ( ExpectedConditions . invisibilityOfElementLocated ( By . cssSelector ( "input[id$='endDateFilter_input']" ) ) ) ; } }
Method checks the filter by date check box on the observation tab.
Method checks the filter by date check box on the observation tab .
//collect possible elements //click the checkbox //If empty then the filter by date is not currently selected and therefore should //wait till the filter by date panel is displayed before continuing. //If not empty then filter by date is currently selected and therefore should wait till the filter by //date panel is no longer displayed before continuing.