mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/comms/TestAddCommsDlg.java
@Test
    public void testConfirmStackCancel() throws InterruptedException
    {
        NavigationHelper.pageAndTabCheck(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_COMMS, null);
        String physName = CommsGeneralHelper.getAvailablePhysicalLink(m_Driver);

        // Bring up the add comms dialog.
        WebElement addCommsButton = m_Driver.findElement(By.cssSelector("button[id*='addCommsButton']"));
        addCommsButton.click();

        // Wait til the add comms dialog is visible.
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div[id$='addAccordion']")));

        // select link layer and wait until the dialog reflects that the link type has been selected
        WebElement layer = CommsAddDialogHelper.layerSelectHelper(m_Driver, "Link Layer",
                "example.ccomms.ExampleLinkLayer");
        assertThat(layer, is(notNullValue()));
        layer.click();
        wait.until(ExpectedConditions.textToBePresentInElementValue(By.cssSelector("input[name$='linkData_selection']"),
                "example.ccomms.ExampleLinkLayer"));

        // enter the layer name
        WebElement input = m_Driver.findElement(By.cssSelector("input[id$='linkName']"));
        GeneralHelper.retrySendKeys(m_Driver, input, "testLink", 5);

        // select physical link and wait until the dialog reflects that the physical link has been selected
        layer = CommsAddDialogHelper.layerSelectHelper(m_Driver, "Physical Link", physName);
        assertThat(layer, is(notNullValue()));
        layer.click();
        wait.until(ExpectedConditions.textToBePresentInElementValue(
                By.cssSelector("input[name$='physicalData_selection']"), physName));

        // click confirm stack
        WebElement confirmStackButton = m_Driver.findElement(By.cssSelector("button[id$='confirmStackButton']"));
        confirmStackButton.click();

        // wait until the confirm stack table is shown and then click cancel button
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("span[id$='confirmStack']")));
        confirmStackButton = m_Driver.findElement(By.cssSelector("button[id$='confirmCancelButton']"));
        confirmStackButton.click();

        WebElement addStack = wait.until(
                ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div[id$='addAccordion']")));
        assertThat(addStack, is(notNullValue())); // ensure that add stack dialog was found

        // ---close the dialog---
        WebElement closeButton = m_Driver.findElement(By.cssSelector("button[id*='cancelStackButton']"));
        closeButton.click();

        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("div[id$='addCommsDialog']")));
        assertThat(CommsGeneralHelper.retrieveStack(m_Driver, "testLink"), is(nullValue()));
    }
/**
     * Verify canceling confirm dialog will go back to add comms dialog. Verify canceling will not create stack.
     */
Verify canceling confirm dialog will go back to add comms dialog. Verify canceling will not create stack.
Verify canceling confirm dialog will go back to add comms dialog . Verify canceling will not create stack .
@Test
    public void testConfirmStackCancel() throws InterruptedException
    {
        NavigationHelper.pageAndTabCheck(m_Driver, NavigationButtonNameConstants.NAVBUT_PROP_COMMS, null);
        String physName = CommsGeneralHelper.getAvailablePhysicalLink(m_Driver);
        WebElement addCommsButton = m_Driver.findElement(By.cssSelector("button[id*='addCommsButton']"));
        addCommsButton.click();
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div[id$='addAccordion']")));
        WebElement layer = CommsAddDialogHelper.layerSelectHelper(m_Driver, "Link Layer",
                "example.ccomms.ExampleLinkLayer");
        assertThat(layer, is(notNullValue()));
        layer.click();
        wait.until(ExpectedConditions.textToBePresentInElementValue(By.cssSelector("input[name$='linkData_selection']"),
                "example.ccomms.ExampleLinkLayer"));
        WebElement input = m_Driver.findElement(By.cssSelector("input[id$='linkName']"));
        GeneralHelper.retrySendKeys(m_Driver, input, "testLink", 5);
        layer = CommsAddDialogHelper.layerSelectHelper(m_Driver, "Physical Link", physName);
        assertThat(layer, is(notNullValue()));
        layer.click();
        wait.until(ExpectedConditions.textToBePresentInElementValue(
                By.cssSelector("input[name$='physicalData_selection']"), physName));
        WebElement confirmStackButton = m_Driver.findElement(By.cssSelector("button[id$='confirmStackButton']"));
        confirmStackButton.click();
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("span[id$='confirmStack']")));
        confirmStackButton = m_Driver.findElement(By.cssSelector("button[id$='confirmCancelButton']"));
        confirmStackButton.click();
        WebElement addStack = wait.until(
                ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div[id$='addAccordion']")));
        assertThat(addStack, is(notNullValue())); 
        WebElement closeButton = m_Driver.findElement(By.cssSelector("button[id*='cancelStackButton']"));
        closeButton.click();
        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("div[id$='addCommsDialog']")));
        assertThat(CommsGeneralHelper.retrieveStack(m_Driver, "testLink"), is(nullValue()));
    }
@ Test public void testConfirmStackCancel ( ) throws InterruptedException { NavigationHelper . pageAndTabCheck ( m_Driver , NavigationButtonNameConstants . NAVBUT_PROP_COMMS , null ) ; String physName = CommsGeneralHelper . getAvailablePhysicalLink ( m_Driver ) ; WebElement addCommsButton = m_Driver . findElement ( By . cssSelector ( "button[id*='addCommsButton']" ) ) ; addCommsButton . click ( ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "div[id$='addAccordion']" ) ) ) ; WebElement layer = CommsAddDialogHelper . layerSelectHelper ( m_Driver , "Link Layer" , "example.ccomms.ExampleLinkLayer" ) ; assertThat ( layer , is ( notNullValue ( ) ) ) ; layer . click ( ) ; wait . until ( ExpectedConditions . textToBePresentInElementValue ( By . cssSelector ( "input[name$='linkData_selection']" ) , "example.ccomms.ExampleLinkLayer" ) ) ; WebElement input = m_Driver . findElement ( By . cssSelector ( "input[id$='linkName']" ) ) ; GeneralHelper . retrySendKeys ( m_Driver , input , "testLink" , 5 ) ; layer = CommsAddDialogHelper . layerSelectHelper ( m_Driver , "Physical Link" , physName ) ; assertThat ( layer , is ( notNullValue ( ) ) ) ; layer . click ( ) ; wait . until ( ExpectedConditions . textToBePresentInElementValue ( By . cssSelector ( "input[name$='physicalData_selection']" ) , physName ) ) ; WebElement confirmStackButton = m_Driver . findElement ( By . cssSelector ( "button[id$='confirmStackButton']" ) ) ; confirmStackButton . click ( ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "span[id$='confirmStack']" ) ) ) ; confirmStackButton = m_Driver . findElement ( By . cssSelector ( "button[id$='confirmCancelButton']" ) ) ; confirmStackButton . click ( ) ; WebElement addStack = wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "div[id$='addAccordion']" ) ) ) ; assertThat ( addStack , is ( notNullValue ( ) ) ) ; WebElement closeButton = m_Driver . findElement ( By . cssSelector ( "button[id*='cancelStackButton']" ) ) ; closeButton . click ( ) ; wait . until ( ExpectedConditions . invisibilityOfElementLocated ( By . cssSelector ( "div[id$='addCommsDialog']" ) ) ) ; assertThat ( CommsGeneralHelper . retrieveStack ( m_Driver , "testLink" ) , is ( nullValue ( ) ) ) ; }
Verify canceling confirm dialog will go back to add comms dialog.
Verify canceling confirm dialog will go back to add comms dialog .
// Bring up the add comms dialog. // Wait til the add comms dialog is visible. // select link layer and wait until the dialog reflects that the link type has been selected // enter the layer name // select physical link and wait until the dialog reflects that the physical link has been selected // click confirm stack // wait until the confirm stack table is shown and then click cancel button // ensure that add stack dialog was found // ---close the dialog---