mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/advanced/TestSystemConfigurationTab.java
@Test
    public void testCreateConfigDialog() throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        
        //open create configuration dialog and record count of existing configurations
        String rowNum = ConfigurationHelper.createConfigDialogHelper("example.ccomms.ExamplePhysicalLinkConfig", true);
        WebElement configTable = m_Driver.findElement(By.cssSelector("tbody[id*='factoryConfigTable_data']"));
        int originalConfigCount = ConfigurationHelper.getConfigurationsList(rowNum, configTable).size();
        
        //wait until dialog is visible before interacting with it
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div[id='createFactoryConfig']")));
        
        //verify actual values in dialog match expected values
        By configDialogSelector = By.cssSelector("div[id='createFactoryConfig']");
        ConfigurationHelper.verifyDialogValues(m_Driver, configDialogSelector, "Read timeout ms",
                "Timeout value for read calls in milliseconds (Integer)");
        ConfigurationHelper.verifyDialogValues(m_Driver, configDialogSelector, "Data bits", 
                "How many bits of data in each byte read from the link (Integer)");
        
        //press the cancel button
        WebElement configDialog = m_Driver.findElement(configDialogSelector);
        WebElement cancelButton = configDialog.findElement(By.
                cssSelector("button[id='createFactoryForm:cancelConfig']"));
        wait.until(ExpectedConditions.visibilityOf(cancelButton));
        cancelButton.click();
        
        //verify no new configurations were created
        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("div[id='createFactoryConfig']")));
        configTable = m_Driver.findElement(By.cssSelector("tbody[id*='factoryConfigTable_data']"));
        int newCount = ConfigurationHelper.getConfigurationsList(rowNum, configTable).size();
        assertThat(originalConfigCount, is(newCount)); //indicates no change in the number of configurations 
        
        WebElement config = ConfigurationHelper.findConfigurationPanel(
                "example.ccomms.ExamplePhysicalLinkConfig", true);
        WebElement configPropsTable = 
                config.findElement(By.cssSelector("tbody[class='ui-datatable-data ui-widget-content']"));
        WebElement collapse = config.findElement(By.cssSelector("span[class='ui-icon ui-icon-minusthick']"));
        collapse.click();
        
        //Wait for physical link config panel to collapse.
        Thread.sleep(1000);
        assertThat(configPropsTable.isDisplayed(), is(false));
    }
/**
     * Verify correct dialog values. 
     * Verify the cancel button on the create configuration closes the dialog.
     * Verify the cancel button will not create a new configuration. 
     * 
     */
Verify correct dialog values.
Verify the cancel button on the create configuration closes the dialog.
Verify the cancel button will not create a new configuration.
Verify correct dialog values . Verify the cancel button on the create configuration closes the dialog . Verify the cancel button will not create a new configuration .
@Test
    public void testCreateConfigDialog() throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        String rowNum = ConfigurationHelper.createConfigDialogHelper("example.ccomms.ExamplePhysicalLinkConfig", true);
        WebElement configTable = m_Driver.findElement(By.cssSelector("tbody[id*='factoryConfigTable_data']"));
        int originalConfigCount = ConfigurationHelper.getConfigurationsList(rowNum, configTable).size();
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div[id='createFactoryConfig']")));
        By configDialogSelector = By.cssSelector("div[id='createFactoryConfig']");
        ConfigurationHelper.verifyDialogValues(m_Driver, configDialogSelector, "Read timeout ms",
                "Timeout value for read calls in milliseconds (Integer)");
        ConfigurationHelper.verifyDialogValues(m_Driver, configDialogSelector, "Data bits", 
                "How many bits of data in each byte read from the link (Integer)");
        WebElement configDialog = m_Driver.findElement(configDialogSelector);
        WebElement cancelButton = configDialog.findElement(By.
                cssSelector("button[id='createFactoryForm:cancelConfig']"));
        wait.until(ExpectedConditions.visibilityOf(cancelButton));
        cancelButton.click();
        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("div[id='createFactoryConfig']")));
        configTable = m_Driver.findElement(By.cssSelector("tbody[id*='factoryConfigTable_data']"));
        int newCount = ConfigurationHelper.getConfigurationsList(rowNum, configTable).size();
        assertThat(originalConfigCount, is(newCount)); 
        WebElement config = ConfigurationHelper.findConfigurationPanel(
                "example.ccomms.ExamplePhysicalLinkConfig", true);
        WebElement configPropsTable = 
                config.findElement(By.cssSelector("tbody[class='ui-datatable-data ui-widget-content']"));
        WebElement collapse = config.findElement(By.cssSelector("span[class='ui-icon ui-icon-minusthick']"));
        collapse.click();
        Thread.sleep(1000);
        assertThat(configPropsTable.isDisplayed(), is(false));
    }
@ Test public void testCreateConfigDialog ( ) throws InterruptedException { WebDriverWait wait = new WebDriverWait ( m_Driver , 5 ) ; String rowNum = ConfigurationHelper . createConfigDialogHelper ( "example.ccomms.ExamplePhysicalLinkConfig" , true ) ; WebElement configTable = m_Driver . findElement ( By . cssSelector ( "tbody[id*='factoryConfigTable_data']" ) ) ; int originalConfigCount = ConfigurationHelper . getConfigurationsList ( rowNum , configTable ) . size ( ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "div[id='createFactoryConfig']" ) ) ) ; By configDialogSelector = By . cssSelector ( "div[id='createFactoryConfig']" ) ; ConfigurationHelper . verifyDialogValues ( m_Driver , configDialogSelector , "Read timeout ms" , "Timeout value for read calls in milliseconds (Integer)" ) ; ConfigurationHelper . verifyDialogValues ( m_Driver , configDialogSelector , "Data bits" , "How many bits of data in each byte read from the link (Integer)" ) ; WebElement configDialog = m_Driver . findElement ( configDialogSelector ) ; WebElement cancelButton = configDialog . findElement ( By . cssSelector ( "button[id='createFactoryForm:cancelConfig']" ) ) ; wait . until ( ExpectedConditions . visibilityOf ( cancelButton ) ) ; cancelButton . click ( ) ; wait . until ( ExpectedConditions . invisibilityOfElementLocated ( By . cssSelector ( "div[id='createFactoryConfig']" ) ) ) ; configTable = m_Driver . findElement ( By . cssSelector ( "tbody[id*='factoryConfigTable_data']" ) ) ; int newCount = ConfigurationHelper . getConfigurationsList ( rowNum , configTable ) . size ( ) ; assertThat ( originalConfigCount , is ( newCount ) ) ; WebElement config = ConfigurationHelper . findConfigurationPanel ( "example.ccomms.ExamplePhysicalLinkConfig" , true ) ; WebElement configPropsTable = config . findElement ( By . cssSelector ( "tbody[class='ui-datatable-data ui-widget-content']" ) ) ; WebElement collapse = config . findElement ( By . cssSelector ( "span[class='ui-icon ui-icon-minusthick']" ) ) ; collapse . click ( ) ; Thread . sleep ( 1000 ) ; assertThat ( configPropsTable . isDisplayed ( ) , is ( false ) ) ; }
Verify correct dialog values.
Verify correct dialog values .
//open create configuration dialog and record count of existing configurations //wait until dialog is visible before interacting with it //verify actual values in dialog match expected values //press the cancel button //verify no new configurations were created //indicates no change in the number of configurations  //Wait for physical link config panel to collapse.