mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/mp/TestLoadSelectedMission.java
@Test
    public void testSelectedMissionWithController() throws InterruptedException, ExecutionException, TimeoutException
    {
        //open left side bar
        NavigationHelper.expandSideBars(m_Driver);

        //create a channel and set an active controller
        ControllerHelper.setActiveControllerByName(m_Driver, "THarvest");

        Thread.sleep(1000);

        //create the mission to load
        MissionSetupHelper.createMissionSetupWithTestMission(m_Driver, false, false);

        //Wait needed to assure that the elements have loaded.
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//button[contains(@id, 'loadMission')]")));

        //Selects the table which displays the parameters for the mission and then creates a list of the rows within
        //the table.
        WebElement parametersTable = m_Driver.findElement(By.cssSelector("div[class='ui-datatable-scrollable-body']"));
        List<WebElement> tableRows = parametersTable.findElements(By.tagName("tr"));
        //Verify that the four properties of the test mission are shown appropriately.
        assertThat(tableRows.size(), is(4));
        
        MissionSetupHelper.loadMissionToController(m_Driver, "missionSelectedTest");
        
        //Verify that the page navigates back to the first page of the mission wizard.
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(
                "div[id$='missionGrid_content']")));
        WebElement header = m_Driver.findElement(By.cssSelector(
                "li[class='ui-wizard-step-title ui-state-default ui-corner-all ui-state-highlight']"));
        assertThat(header.getText(), is("Choose A Mission"));
        
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_MISSIONS);
        
        MissionHelper.executeStopOnMission(m_Driver, "missionSelectedTest");
        MissionHelper.executeRemoveOnMission(m_Driver, "missionSelectedTest");
    }
/**
     * Setup a mission and click load mission.
     */
Setup a mission and click load mission.
Setup a mission and click load mission .
@Test
    public void testSelectedMissionWithController() throws InterruptedException, ExecutionException, TimeoutException
    {
        NavigationHelper.expandSideBars(m_Driver);
        ControllerHelper.setActiveControllerByName(m_Driver, "THarvest");
        Thread.sleep(1000);
        MissionSetupHelper.createMissionSetupWithTestMission(m_Driver, false, false);
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//button[contains(@id, 'loadMission')]")));
        WebElement parametersTable = m_Driver.findElement(By.cssSelector("div[class='ui-datatable-scrollable-body']"));
        List<WebElement> tableRows = parametersTable.findElements(By.tagName("tr"));
        assertThat(tableRows.size(), is(4));
        MissionSetupHelper.loadMissionToController(m_Driver, "missionSelectedTest");
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(
                "div[id$='missionGrid_content']")));
        WebElement header = m_Driver.findElement(By.cssSelector(
                "li[class='ui-wizard-step-title ui-state-default ui-corner-all ui-state-highlight']"));
        assertThat(header.getText(), is("Choose A Mission"));
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_MISSIONS);
        MissionHelper.executeStopOnMission(m_Driver, "missionSelectedTest");
        MissionHelper.executeRemoveOnMission(m_Driver, "missionSelectedTest");
    }
@ Test public void testSelectedMissionWithController ( ) throws InterruptedException , ExecutionException , TimeoutException { NavigationHelper . expandSideBars ( m_Driver ) ; ControllerHelper . setActiveControllerByName ( m_Driver , "THarvest" ) ; Thread . sleep ( 1000 ) ; MissionSetupHelper . createMissionSetupWithTestMission ( m_Driver , false , false ) ; WebDriverWait wait = new WebDriverWait ( m_Driver , 5 ) ; wait . until ( ExpectedConditions . presenceOfElementLocated ( By . xpath ( "//button[contains(@id, 'loadMission')]" ) ) ) ; WebElement parametersTable = m_Driver . findElement ( By . cssSelector ( "div[class='ui-datatable-scrollable-body']" ) ) ; List < WebElement > tableRows = parametersTable . findElements ( By . tagName ( "tr" ) ) ; assertThat ( tableRows . size ( ) , is ( 4 ) ) ; MissionSetupHelper . loadMissionToController ( m_Driver , "missionSelectedTest" ) ; wait . until ( ExpectedConditions . presenceOfElementLocated ( By . cssSelector ( "div[id$='missionGrid_content']" ) ) ) ; WebElement header = m_Driver . findElement ( By . cssSelector ( "li[class='ui-wizard-step-title ui-state-default ui-corner-all ui-state-highlight']" ) ) ; assertThat ( header . getText ( ) , is ( "Choose A Mission" ) ) ; NavigationHelper . navigateToPage ( m_Driver , NavigationButtonNameConstants . NAVBUT_PROP_MISSIONS ) ; MissionHelper . executeStopOnMission ( m_Driver , "missionSelectedTest" ) ; MissionHelper . executeRemoveOnMission ( m_Driver , "missionSelectedTest" ) ; }
Setup a mission and click load mission.
Setup a mission and click load mission .
//open left side bar //create a channel and set an active controller //create the mission to load //Wait needed to assure that the elements have loaded. //Selects the table which displays the parameters for the mission and then creates a list of the rows within //the table. //Verify that the four properties of the test mission are shown appropriately. //Verify that the page navigates back to the first page of the mission wizard.