mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/helpers/MissionSetupHelper.java
public static String createMissionSetupWithTestMission(final WebDriver driver, 
            final boolean hasStartTimeInterval, final boolean hasStopTimeInterval) throws InterruptedException
    {
        NavigationHelper.navigateToPage(driver, NavigationButtonNameConstants.NAVBUT_PROP_SETUP_MIS);
        NavigationHelper.collapseSideBars(driver);
        
        //Wait to assure the page has loaded.
        WebDriverWait wait = new WebDriverWait(driver, 10);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[contains(@id, 'selectInfo')]")));
        
        WebElement testMission = retrieveMissionByName(driver, "test-mission");
        //Verifies that the test mission was found.
        assertThat(testMission, is(notNullValue()));

        //Select and click the select mission button to proceed to the parameters tab.
        WebElement selectMissionButton = testMission.findElement(By.cssSelector("button[id*='selectMission']"));
        assertThat(selectMissionButton, is(notNullValue()));
        selectMissionButton.click();
        //Wait needed to assure that the elements for the tab has loaded.
        wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.visibilityOfElementLocated(
            By.cssSelector("span[class='ui-icon ui-icon-pencil']")));


        //Select and click the next button once all variables have been set.
        GeneralHelper.safeClickBySelector(By.xpath("//button[contains(@id, 'missionWiz_next')]"));
        
        //Wait needed to assure that the elements for the tab has loaded.
        wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[contains(@id, 'tChangerStart')]")));

        //get current time
        long currentTime = System.currentTimeMillis();
        String startTime = "";
        
        //if start time desired
        if (hasStartTimeInterval)
        {
            Calendar calendar = TimeUtil.getCalendarForTime(currentTime);
            calendar.add(Calendar.MINUTE, 10);
            startTime = TimeUtil.getFormattedTime(calendar);
            
            //get the web element
            GeneralHelper.safeClickBySelector(By.cssSelector("div[id='wizForm:tChangerStart']>div:nth-child(2)>span"));
            
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id='wizForm:timeChoose:startTimeSelect_input']")));
            
            WebElement startTimeInput = driver.findElement(
                    By.cssSelector("input[id='wizForm:timeChoose:startTimeSelect_input']"));
            
            assertThat(startTimeInput, notNullValue());

            //input start time 
            startTimeInput.clear();
            startTimeInput.sendKeys(startTime);
            
            //find the done button to close the calendar
            GeneralHelper.safeClickBySelector(By.cssSelector("button[class='ui-datepicker-close" +
                            " ui-state-default ui-priority-primary ui-corner-all']"));
        }
        
        //if stop time desired
        if (hasStopTimeInterval)
        {
            GeneralHelper.safeClickBySelector(By.cssSelector("div[id='wizForm:tChangerEnd']>div:nth-child(2)>span"));
            
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id='wizForm:timeChoose:stopTimeSelect_input']")));
            
            WebElement stopTimeInput = driver.findElement(
                    By.cssSelector("input[id='wizForm:timeChoose:stopTimeSelect_input']"));
            
            assertThat(stopTimeInput, notNullValue());
            
            Calendar calendar = TimeUtil.getCalendarForTime(currentTime);
            calendar.add(Calendar.MINUTE, 20);
            String stopTime = TimeUtil.getFormattedTime(calendar);
            
            stopTimeInput.clear();
            stopTimeInput.sendKeys(stopTime);
            
            //find the done button to close the calendar
            GeneralHelper.safeClickBySelector(By.cssSelector("button[class='ui-datepicker-close " +
                    "ui-state-default ui-priority-primary ui-corner-all']"));
        }
        
        
        //Select and click the restart check box.
        GeneralHelper.safeClickBySelector(
                By.cssSelector("span[class='ui-chkbox-icon ui-chkbox-icon ui-icon ui-icon-check']"));

        //Select and click the next button to proceed to the finish tab.
        GeneralHelper.safeClickBySelector(By.xpath("//button[contains(@id, 'missionWiz_next')]"));
        
        return startTime;
    }
/**
     * Setup a mission. The setup stops at the mission finish page, where the mission can be clear, loaded to a 
     * controller, saved, etc.
     * @param driver
     *  the web driver performing the test
     * @param hasStartTimeInterval
     *  if a start time interval is to be set for the mission being created. 
     *  Start time will be 10 minutes after the current time.
     * @param hasStopTimeInterval
     *  if a stop time interval is to be set for the mission being created.
     *  Stop time will be 20 minutes after the current time.
     * @return
     *  the String version of the start time that the mission was set to if the 
     *  start time interval flag is set to true. If not set, 
     */
Setup a mission. The setup stops at the mission finish page, where the mission can be clear, loaded to a
controller, saved, etc.
@param driver
the web driver performing the test
@param hasStartTimeInterval
if a start time interval is to be set for the mission being created.
Start time will be 10 minutes after the current time.
@param hasStopTimeInterval
if a stop time interval is to be set for the mission being created.
Stop time will be 20 minutes after the current time.
@return
the String version of the start time that the mission was set to if the
start time interval flag is set to true. If not set.
Setup a mission . The setup stops at the mission finish page where the mission can be clear loaded to a controller saved etc . @param driver the web driver performing the test @param hasStartTimeInterval if a start time interval is to be set for the mission being created . Start time will be 10 minutes after the current time . @param hasStopTimeInterval if a stop time interval is to be set for the mission being created . Stop time will be 20 minutes after the current time . @return the String version of the start time that the mission was set to if the start time interval flag is set to true . If not set .
public static String createMissionSetupWithTestMission(final WebDriver driver, 
            final boolean hasStartTimeInterval, final boolean hasStopTimeInterval) throws InterruptedException
    {
        NavigationHelper.navigateToPage(driver, NavigationButtonNameConstants.NAVBUT_PROP_SETUP_MIS);
        NavigationHelper.collapseSideBars(driver);
        WebDriverWait wait = new WebDriverWait(driver, 10);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//button[contains(@id, 'selectInfo')]")));
        WebElement testMission = retrieveMissionByName(driver, "test-mission");
        assertThat(testMission, is(notNullValue()));
        WebElement selectMissionButton = testMission.findElement(By.cssSelector("button[id*='selectMission']"));
        assertThat(selectMissionButton, is(notNullValue()));
        selectMissionButton.click();
        wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.visibilityOfElementLocated(
            By.cssSelector("span[class='ui-icon ui-icon-pencil']")));
        GeneralHelper.safeClickBySelector(By.xpath("//button[contains(@id, 'missionWiz_next')]"));
        wait = new WebDriverWait(driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[contains(@id, 'tChangerStart')]")));
        long currentTime = System.currentTimeMillis();
        String startTime = "";
        if (hasStartTimeInterval)
        {
            Calendar calendar = TimeUtil.getCalendarForTime(currentTime);
            calendar.add(Calendar.MINUTE, 10);
            startTime = TimeUtil.getFormattedTime(calendar);
            GeneralHelper.safeClickBySelector(By.cssSelector("div[id='wizForm:tChangerStart']>div:nth-child(2)>span"));
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id='wizForm:timeChoose:startTimeSelect_input']")));
            WebElement startTimeInput = driver.findElement(
                    By.cssSelector("input[id='wizForm:timeChoose:startTimeSelect_input']"));
            assertThat(startTimeInput, notNullValue());
            startTimeInput.clear();
            startTimeInput.sendKeys(startTime);
            GeneralHelper.safeClickBySelector(By.cssSelector("button[class='ui-datepicker-close" +
                            " ui-state-default ui-priority-primary ui-corner-all']"));
        }
        if (hasStopTimeInterval)
        {
            GeneralHelper.safeClickBySelector(By.cssSelector("div[id='wizForm:tChangerEnd']>div:nth-child(2)>span"));
            wait.until(ExpectedConditions.visibilityOfElementLocated(
                    By.cssSelector("input[id='wizForm:timeChoose:stopTimeSelect_input']")));
            WebElement stopTimeInput = driver.findElement(
                    By.cssSelector("input[id='wizForm:timeChoose:stopTimeSelect_input']"));
            assertThat(stopTimeInput, notNullValue());
            Calendar calendar = TimeUtil.getCalendarForTime(currentTime);
            calendar.add(Calendar.MINUTE, 20);
            String stopTime = TimeUtil.getFormattedTime(calendar);
            stopTimeInput.clear();
            stopTimeInput.sendKeys(stopTime);
            GeneralHelper.safeClickBySelector(By.cssSelector("button[class='ui-datepicker-close " +
                    "ui-state-default ui-priority-primary ui-corner-all']"));
        }
        GeneralHelper.safeClickBySelector(
                By.cssSelector("span[class='ui-chkbox-icon ui-chkbox-icon ui-icon ui-icon-check']"));
        GeneralHelper.safeClickBySelector(By.xpath("//button[contains(@id, 'missionWiz_next')]"));
        return startTime;
    }
public static String createMissionSetupWithTestMission ( final WebDriver driver , final boolean hasStartTimeInterval , final boolean hasStopTimeInterval ) throws InterruptedException { NavigationHelper . navigateToPage ( driver , NavigationButtonNameConstants . NAVBUT_PROP_SETUP_MIS ) ; NavigationHelper . collapseSideBars ( driver ) ; WebDriverWait wait = new WebDriverWait ( driver , 10 ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . xpath ( "//button[contains(@id, 'selectInfo')]" ) ) ) ; WebElement testMission = retrieveMissionByName ( driver , "test-mission" ) ; assertThat ( testMission , is ( notNullValue ( ) ) ) ; WebElement selectMissionButton = testMission . findElement ( By . cssSelector ( "button[id*='selectMission']" ) ) ; assertThat ( selectMissionButton , is ( notNullValue ( ) ) ) ; selectMissionButton . click ( ) ; wait = new WebDriverWait ( driver , 5 ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "span[class='ui-icon ui-icon-pencil']" ) ) ) ; GeneralHelper . safeClickBySelector ( By . xpath ( "//button[contains(@id, 'missionWiz_next')]" ) ) ; wait = new WebDriverWait ( driver , 5 ) ; wait . until ( ExpectedConditions . presenceOfElementLocated ( By . xpath ( "//div[contains(@id, 'tChangerStart')]" ) ) ) ; long currentTime = System . currentTimeMillis ( ) ; String startTime = "" ; if ( hasStartTimeInterval ) { Calendar calendar = TimeUtil . getCalendarForTime ( currentTime ) ; calendar . add ( Calendar . MINUTE , 10 ) ; startTime = TimeUtil . getFormattedTime ( calendar ) ; GeneralHelper . safeClickBySelector ( By . cssSelector ( "div[id='wizForm:tChangerStart']>div:nth-child(2)>span" ) ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "input[id='wizForm:timeChoose:startTimeSelect_input']" ) ) ) ; WebElement startTimeInput = driver . findElement ( By . cssSelector ( "input[id='wizForm:timeChoose:startTimeSelect_input']" ) ) ; assertThat ( startTimeInput , notNullValue ( ) ) ; startTimeInput . clear ( ) ; startTimeInput . sendKeys ( startTime ) ; GeneralHelper . safeClickBySelector ( By . cssSelector ( "button[class='ui-datepicker-close" + " ui-state-default ui-priority-primary ui-corner-all']" ) ) ; } if ( hasStopTimeInterval ) { GeneralHelper . safeClickBySelector ( By . cssSelector ( "div[id='wizForm:tChangerEnd']>div:nth-child(2)>span" ) ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "input[id='wizForm:timeChoose:stopTimeSelect_input']" ) ) ) ; WebElement stopTimeInput = driver . findElement ( By . cssSelector ( "input[id='wizForm:timeChoose:stopTimeSelect_input']" ) ) ; assertThat ( stopTimeInput , notNullValue ( ) ) ; Calendar calendar = TimeUtil . getCalendarForTime ( currentTime ) ; calendar . add ( Calendar . MINUTE , 20 ) ; String stopTime = TimeUtil . getFormattedTime ( calendar ) ; stopTimeInput . clear ( ) ; stopTimeInput . sendKeys ( stopTime ) ; GeneralHelper . safeClickBySelector ( By . cssSelector ( "button[class='ui-datepicker-close " + "ui-state-default ui-priority-primary ui-corner-all']" ) ) ; } GeneralHelper . safeClickBySelector ( By . cssSelector ( "span[class='ui-chkbox-icon ui-chkbox-icon ui-icon ui-icon-check']" ) ) ; GeneralHelper . safeClickBySelector ( By . xpath ( "//button[contains(@id, 'missionWiz_next')]" ) ) ; return startTime ; }
Setup a mission.
Setup a mission .
//Wait to assure the page has loaded. //Verifies that the test mission was found. //Select and click the select mission button to proceed to the parameters tab. //Wait needed to assure that the elements for the tab has loaded. //Select and click the next button once all variables have been set. //Wait needed to assure that the elements for the tab has loaded. //get current time //if start time desired //get the web element //input start time  //find the done button to close the calendar //if stop time desired //find the done button to close the calendar //Select and click the restart check box. //Select and click the next button to proceed to the finish tab.