mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/base/TestGuiConfigurationPage.java
@Test
    public void testChangeNameAndId() throws InterruptedException, ExecutionException, TimeoutException
    {
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_GUI_CONFIG);
        //Set the new id of the GUI.
        WebElement nameInput = m_Driver.findElement(By.cssSelector("input[id$='systemname']"));
        nameInput.clear();
        nameInput.sendKeys("gui-test");
        
        //Set the new name of the GUI.
        WebElement idInput = m_Driver.findElement(By.cssSelector("input[id$='sysId']"));
        idInput.clear();
        idInput.sendKeys("0000006D");
        
        //Save the changes to the GUI name and id.
        WebElement saveButton = m_Driver.findElement(By.cssSelector("button[id$='save']"));
        GrowlVerifier.verifyNoWait(10, saveButton, "Updated System Information");
        
        //Connect the GUI to itself.
        ChannelsHelper.createSocketChannel(m_Driver, "localhost", "4001");
        NavigationHelper.expandRightSideBarOnly(m_Driver);
        
        //Find the name of all controllers.
        List<String> controllerNames = new ArrayList<String>();
        for (WebElement nameElement: m_Driver.findElements(By.cssSelector("span[id$='controllerName']")))
        {
            controllerNames.add(nameElement.getText());
        }
        //Verify that the new GUI name is among the list of controller names.
        assertThat(controllerNames, hasItems("gui-test"));
        
        //Set the GUI as the active controller.
        ControllerHelper.setActiveControllerByName(m_Driver, "gui-test");
        
        //Verify that the active controller display displays the correct information.
        WebElement activeController = m_Driver.findElement(By.cssSelector("span[id='activeControllerPanel']"));
        WebElement activeControllerName = activeController.findElement(By.cssSelector("span[id$='controllerName']"));
        assertThat(activeControllerName.getText(), containsString("gui-test"));
        WebElement activeControllerId = activeController.findElement(By.cssSelector("span[id$='controllerId']"));
        assertThat(activeControllerId.getText(), containsString("0x0000006D"));
        
        //Set the controller back to the default.
        ControllerHelper.setActiveControllerByName(m_Driver, "THarvest");
        
        //Verify that the active controller display shows the default controller is selected.
        activeController = m_Driver.findElement(By.cssSelector("span[id='activeControllerPanel']"));
        activeControllerName = activeController.findElement(By.cssSelector("span[id$='controllerName']"));
        assertThat(activeControllerName.getText(), containsString("THarvest"));
        activeControllerId = activeController.findElement(By.cssSelector("span[id$='controllerId']"));        
        assertThat(activeControllerId.getText(), containsString("0x0000007D"));
        
        //Remove the channel that connects the GUI to itself.
        ChannelsHelper.removeSocketChannel(m_Driver, "0x0000006D", "gui-test", "localhost", "4001", false);
        
        //Navigate back to the GUI configuration page.
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_GUI_CONFIG);
        
        //Set the GUI name back to the default.
        nameInput = m_Driver.findElement(By.cssSelector("input[id$='systemname']"));
        nameInput.clear();
        nameInput.sendKeys("gui-generic");
        
        //Set the GUI ID back to the default.
        idInput = m_Driver.findElement(By.cssSelector("input[id$='sysId']"));
        idInput.clear();
        idInput.sendKeys("00000001");
        
        //Save the changes to the GUI name and ID.
        saveButton = m_Driver.findElement(By.cssSelector("button[id$='save']"));
        GrowlVerifier.verifyAndWaitToDisappear(20, saveButton, "Updated System Information");
    }
/**
     * Test that the GUI name and ID can be altered.
     * Verify that the name and ID are updated appropriately by connecting the GUI to itself.
     */
Test that the GUI name and ID can be altered.
Verify that the name and ID are updated appropriately by connecting the GUI to itself.
Test that the GUI name and ID can be altered . Verify that the name and ID are updated appropriately by connecting the GUI to itself .
@Test
    public void testChangeNameAndId() throws InterruptedException, ExecutionException, TimeoutException
    {
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_GUI_CONFIG);
        WebElement nameInput = m_Driver.findElement(By.cssSelector("input[id$='systemname']"));
        nameInput.clear();
        nameInput.sendKeys("gui-test");
        WebElement idInput = m_Driver.findElement(By.cssSelector("input[id$='sysId']"));
        idInput.clear();
        idInput.sendKeys("0000006D");
        WebElement saveButton = m_Driver.findElement(By.cssSelector("button[id$='save']"));
        GrowlVerifier.verifyNoWait(10, saveButton, "Updated System Information");
        ChannelsHelper.createSocketChannel(m_Driver, "localhost", "4001");
        NavigationHelper.expandRightSideBarOnly(m_Driver);
        List<String> controllerNames = new ArrayList<String>();
        for (WebElement nameElement: m_Driver.findElements(By.cssSelector("span[id$='controllerName']")))
        {
            controllerNames.add(nameElement.getText());
        }
        assertThat(controllerNames, hasItems("gui-test"));
        ControllerHelper.setActiveControllerByName(m_Driver, "gui-test");
        WebElement activeController = m_Driver.findElement(By.cssSelector("span[id='activeControllerPanel']"));
        WebElement activeControllerName = activeController.findElement(By.cssSelector("span[id$='controllerName']"));
        assertThat(activeControllerName.getText(), containsString("gui-test"));
        WebElement activeControllerId = activeController.findElement(By.cssSelector("span[id$='controllerId']"));
        assertThat(activeControllerId.getText(), containsString("0x0000006D"));
        ControllerHelper.setActiveControllerByName(m_Driver, "THarvest");
        activeController = m_Driver.findElement(By.cssSelector("span[id='activeControllerPanel']"));
        activeControllerName = activeController.findElement(By.cssSelector("span[id$='controllerName']"));
        assertThat(activeControllerName.getText(), containsString("THarvest"));
        activeControllerId = activeController.findElement(By.cssSelector("span[id$='controllerId']"));        
        assertThat(activeControllerId.getText(), containsString("0x0000007D"));
        ChannelsHelper.removeSocketChannel(m_Driver, "0x0000006D", "gui-test", "localhost", "4001", false);
        NavigationHelper.navigateToPage(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_GUI_CONFIG);
        nameInput = m_Driver.findElement(By.cssSelector("input[id$='systemname']"));
        nameInput.clear();
        nameInput.sendKeys("gui-generic");
        idInput = m_Driver.findElement(By.cssSelector("input[id$='sysId']"));
        idInput.clear();
        idInput.sendKeys("00000001");
        saveButton = m_Driver.findElement(By.cssSelector("button[id$='save']"));
        GrowlVerifier.verifyAndWaitToDisappear(20, saveButton, "Updated System Information");
    }
@ Test public void testChangeNameAndId ( ) throws InterruptedException , ExecutionException , TimeoutException { NavigationHelper . navigateToPage ( m_Driver , NavigationButtonNameConstants . NAVBUT_PROP_GUI_CONFIG ) ; WebElement nameInput = m_Driver . findElement ( By . cssSelector ( "input[id$='systemname']" ) ) ; nameInput . clear ( ) ; nameInput . sendKeys ( "gui-test" ) ; WebElement idInput = m_Driver . findElement ( By . cssSelector ( "input[id$='sysId']" ) ) ; idInput . clear ( ) ; idInput . sendKeys ( "0000006D" ) ; WebElement saveButton = m_Driver . findElement ( By . cssSelector ( "button[id$='save']" ) ) ; GrowlVerifier . verifyNoWait ( 10 , saveButton , "Updated System Information" ) ; ChannelsHelper . createSocketChannel ( m_Driver , "localhost" , "4001" ) ; NavigationHelper . expandRightSideBarOnly ( m_Driver ) ; List < String > controllerNames = new ArrayList < String > ( ) ; for ( WebElement nameElement : m_Driver . findElements ( By . cssSelector ( "span[id$='controllerName']" ) ) ) { controllerNames . add ( nameElement . getText ( ) ) ; } assertThat ( controllerNames , hasItems ( "gui-test" ) ) ; ControllerHelper . setActiveControllerByName ( m_Driver , "gui-test" ) ; WebElement activeController = m_Driver . findElement ( By . cssSelector ( "span[id='activeControllerPanel']" ) ) ; WebElement activeControllerName = activeController . findElement ( By . cssSelector ( "span[id$='controllerName']" ) ) ; assertThat ( activeControllerName . getText ( ) , containsString ( "gui-test" ) ) ; WebElement activeControllerId = activeController . findElement ( By . cssSelector ( "span[id$='controllerId']" ) ) ; assertThat ( activeControllerId . getText ( ) , containsString ( "0x0000006D" ) ) ; ControllerHelper . setActiveControllerByName ( m_Driver , "THarvest" ) ; activeController = m_Driver . findElement ( By . cssSelector ( "span[id='activeControllerPanel']" ) ) ; activeControllerName = activeController . findElement ( By . cssSelector ( "span[id$='controllerName']" ) ) ; assertThat ( activeControllerName . getText ( ) , containsString ( "THarvest" ) ) ; activeControllerId = activeController . findElement ( By . cssSelector ( "span[id$='controllerId']" ) ) ; assertThat ( activeControllerId . getText ( ) , containsString ( "0x0000007D" ) ) ; ChannelsHelper . removeSocketChannel ( m_Driver , "0x0000006D" , "gui-test" , "localhost" , "4001" , false ) ; NavigationHelper . navigateToPage ( m_Driver , NavigationButtonNameConstants . NAVBUT_PROP_GUI_CONFIG ) ; nameInput = m_Driver . findElement ( By . cssSelector ( "input[id$='systemname']" ) ) ; nameInput . clear ( ) ; nameInput . sendKeys ( "gui-generic" ) ; idInput = m_Driver . findElement ( By . cssSelector ( "input[id$='sysId']" ) ) ; idInput . clear ( ) ; idInput . sendKeys ( "00000001" ) ; saveButton = m_Driver . findElement ( By . cssSelector ( "button[id$='save']" ) ) ; GrowlVerifier . verifyAndWaitToDisappear ( 20 , saveButton , "Updated System Information" ) ; }
Test that the GUI name and ID can be altered.
Test that the GUI name and ID can be altered .
//Set the new id of the GUI. //Set the new name of the GUI. //Save the changes to the GUI name and id. //Connect the GUI to itself. //Find the name of all controllers. //Verify that the new GUI name is among the list of controller names. //Set the GUI as the active controller. //Verify that the active controller display displays the correct information. //Set the controller back to the default. //Verify that the active controller display shows the default controller is selected. //Remove the channel that connects the GUI to itself. //Navigate back to the GUI configuration page. //Set the GUI name back to the default. //Set the GUI ID back to the default. //Save the changes to the GUI name and ID.