mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/mp/TestMissionAppStatusPage.java
@Test
    public void testCreateAndExecuteTimedTestMission() throws 
        InterruptedException, ExecutionException, TimeoutException, ParseException
    {
        String start = MissionSetupHelper.createMissionAndLoadToController(m_Driver, "Mission 2", true, true);
        
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_MISSIONS);
        
        WebElement theMissionCard = MissionHelper.findCorrectRunningMissionCard(m_Driver, "Mission 2");
        assertThat(theMissionCard, notNullValue());
        
        verifyCommonHeaders(theMissionCard, "SCHEDULED", "test-mission");
        
        WebElement startTime = theMissionCard.findElement(By.cssSelector("span[id*='mStartTime']"));
        assertThat(startTime, notNullValue());
        assertThat(startTime.getText(), is(start + "Z"));
        
        //execute a test
        WebElement testButton = theMissionCard.findElement(By.cssSelector("button[id*='testButton']"));
        assertThat(testButton, notNullValue());
        
        //execute mission
        WebElement executeButton = theMissionCard.findElement(By.cssSelector("button[id*='execButton']"));
        assertThat(executeButton, notNullValue());
        
        //cancel mission
        WebElement cancelButton = theMissionCard.findElement(By.cssSelector("button[id*='cancelButton']"));
        assertThat(cancelButton, notNullValue());
        
        //execute mission 
        MissionHelper.executeStartOnMission(m_Driver, "Mission 2");
        
        WebDriverWait wait = new WebDriverWait(m_Driver, 10);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("span[id*='mStopTime']")));
        
        //verify stop time is correct. first regrab the mission card
        theMissionCard = MissionHelper.findCorrectRunningMissionCard(m_Driver, "Mission 2");
        assertThat(theMissionCard, notNullValue());
        
        WebElement stopTime = theMissionCard.findElement(By.cssSelector("span[id*='mStopTime']"));
        assertThat(stopTime, notNullValue());
        
        Calendar startCalendar = TimeUtil.getCalendarFromFormattedDate(start);
        startCalendar.add(Calendar.MINUTE, 10);
        
        assertThat(stopTime.getText(), is(TimeUtil.getFormattedTime(startCalendar) + "Z"));
        
        //verify button stop is showing
        MissionHelper.executeStopOnMission(m_Driver, "Mission 2");
        
        //grab card again
        theMissionCard = MissionHelper.findCorrectRunningMissionCard(m_Driver, "Mission 2");
        assertThat(theMissionCard, notNullValue());
        
        //verify mission state is shutdown and click shutdown button
        WebElement status2 = theMissionCard.findElement(By.cssSelector("td[id*='mStatus']"));
        
        assertThat(status2, notNullValue());
        assertThat(status2.getText(), is("SHUTDOWN"));
        
        //remove the mission
        MissionHelper.executeRemoveOnMission(m_Driver, "Mission 2");
    }
/**
     * Creates a timed mission, verifies that it shows up as scheduled, executes it, 
     * stops it, and removes the mission.
     */
Creates a timed mission, verifies that it shows up as scheduled, executes it,
stops it, and removes the mission.
Creates a timed mission verifies that it shows up as scheduled executes it stops it and removes the mission .
@Test
    public void testCreateAndExecuteTimedTestMission() throws 
        InterruptedException, ExecutionException, TimeoutException, ParseException
    {
        String start = MissionSetupHelper.createMissionAndLoadToController(m_Driver, "Mission 2", true, true);
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_MISSIONS);
        WebElement theMissionCard = MissionHelper.findCorrectRunningMissionCard(m_Driver, "Mission 2");
        assertThat(theMissionCard, notNullValue());
        verifyCommonHeaders(theMissionCard, "SCHEDULED", "test-mission");
        WebElement startTime = theMissionCard.findElement(By.cssSelector("span[id*='mStartTime']"));
        assertThat(startTime, notNullValue());
        assertThat(startTime.getText(), is(start + "Z"));
        WebElement testButton = theMissionCard.findElement(By.cssSelector("button[id*='testButton']"));
        assertThat(testButton, notNullValue());
        WebElement executeButton = theMissionCard.findElement(By.cssSelector("button[id*='execButton']"));
        assertThat(executeButton, notNullValue());
        WebElement cancelButton = theMissionCard.findElement(By.cssSelector("button[id*='cancelButton']"));
        assertThat(cancelButton, notNullValue());
        MissionHelper.executeStartOnMission(m_Driver, "Mission 2");
        WebDriverWait wait = new WebDriverWait(m_Driver, 10);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("span[id*='mStopTime']")));
        theMissionCard = MissionHelper.findCorrectRunningMissionCard(m_Driver, "Mission 2");
        assertThat(theMissionCard, notNullValue());
        WebElement stopTime = theMissionCard.findElement(By.cssSelector("span[id*='mStopTime']"));
        assertThat(stopTime, notNullValue());
        Calendar startCalendar = TimeUtil.getCalendarFromFormattedDate(start);
        startCalendar.add(Calendar.MINUTE, 10);
        assertThat(stopTime.getText(), is(TimeUtil.getFormattedTime(startCalendar) + "Z"));
        MissionHelper.executeStopOnMission(m_Driver, "Mission 2");
        theMissionCard = MissionHelper.findCorrectRunningMissionCard(m_Driver, "Mission 2");
        assertThat(theMissionCard, notNullValue());
        WebElement status2 = theMissionCard.findElement(By.cssSelector("td[id*='mStatus']"));
        assertThat(status2, notNullValue());
        assertThat(status2.getText(), is("SHUTDOWN"));
        MissionHelper.executeRemoveOnMission(m_Driver, "Mission 2");
    }
@ Test public void testCreateAndExecuteTimedTestMission ( ) throws InterruptedException , ExecutionException , TimeoutException , ParseException { String start = MissionSetupHelper . createMissionAndLoadToController ( m_Driver , "Mission 2" , true , true ) ; NavigationHelper . navigateToPage ( m_Driver , NavigationButtonNameConstants . NAVBUT_PROP_MISSIONS ) ; WebElement theMissionCard = MissionHelper . findCorrectRunningMissionCard ( m_Driver , "Mission 2" ) ; assertThat ( theMissionCard , notNullValue ( ) ) ; verifyCommonHeaders ( theMissionCard , "SCHEDULED" , "test-mission" ) ; WebElement startTime = theMissionCard . findElement ( By . cssSelector ( "span[id*='mStartTime']" ) ) ; assertThat ( startTime , notNullValue ( ) ) ; assertThat ( startTime . getText ( ) , is ( start + "Z" ) ) ; WebElement testButton = theMissionCard . findElement ( By . cssSelector ( "button[id*='testButton']" ) ) ; assertThat ( testButton , notNullValue ( ) ) ; WebElement executeButton = theMissionCard . findElement ( By . cssSelector ( "button[id*='execButton']" ) ) ; assertThat ( executeButton , notNullValue ( ) ) ; WebElement cancelButton = theMissionCard . findElement ( By . cssSelector ( "button[id*='cancelButton']" ) ) ; assertThat ( cancelButton , notNullValue ( ) ) ; MissionHelper . executeStartOnMission ( m_Driver , "Mission 2" ) ; WebDriverWait wait = new WebDriverWait ( m_Driver , 10 ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "span[id*='mStopTime']" ) ) ) ; theMissionCard = MissionHelper . findCorrectRunningMissionCard ( m_Driver , "Mission 2" ) ; assertThat ( theMissionCard , notNullValue ( ) ) ; WebElement stopTime = theMissionCard . findElement ( By . cssSelector ( "span[id*='mStopTime']" ) ) ; assertThat ( stopTime , notNullValue ( ) ) ; Calendar startCalendar = TimeUtil . getCalendarFromFormattedDate ( start ) ; startCalendar . add ( Calendar . MINUTE , 10 ) ; assertThat ( stopTime . getText ( ) , is ( TimeUtil . getFormattedTime ( startCalendar ) + "Z" ) ) ; MissionHelper . executeStopOnMission ( m_Driver , "Mission 2" ) ; theMissionCard = MissionHelper . findCorrectRunningMissionCard ( m_Driver , "Mission 2" ) ; assertThat ( theMissionCard , notNullValue ( ) ) ; WebElement status2 = theMissionCard . findElement ( By . cssSelector ( "td[id*='mStatus']" ) ) ; assertThat ( status2 , notNullValue ( ) ) ; assertThat ( status2 . getText ( ) , is ( "SHUTDOWN" ) ) ; MissionHelper . executeRemoveOnMission ( m_Driver , "Mission 2" ) ; }
Creates a timed mission, verifies that it shows up as scheduled, executes it,
 stops it, and removes the mission.
Creates a timed mission verifies that it shows up as scheduled executes it stops it and removes the mission .
//execute a test //execute mission //cancel mission //execute mission  //verify stop time is correct. first regrab the mission card //verify button stop is showing //grab card again //verify mission state is shutdown and click shutdown button //remove the mission