mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/advanced/TestSystemConfigurationTab.java
public void assertDeleteConfig() throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        
        //Wait until the configuration table is available.
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("tbody[id*='configTable_data']")));

        Wait<WebDriver> fwait = new FluentWait<WebDriver>(m_Driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(1, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        
        //Delete the configuration.
        WebElement deleteButton = fwait.until(new ExpectedCondition<WebElement>()
        {
            @Override
            public WebElement apply(WebDriver driver)
            {
                WebElement configPanel = ConfigurationHelper.findConfigurationPanel(m_PidToChange, false);
                return configPanel.findElement(By.cssSelector("button[id*='deleteConfig']"));
            }
        });
        assertThat(deleteButton, is (notNullValue()));
        deleteButton.click();
        ConfigurationHelper.handleDeleteConfigDialog(m_Driver, m_PidToChange, true);
        
        //Sleep need so controller has time to delete configuration and send response.
        Thread.sleep(2000);
        
        //Verify that config is new or unbound.
        Boolean unbound = fwait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement configPanel = ConfigurationHelper.findConfigurationPanel(m_PidToChange, false);
                WebElement unbound = configPanel.findElement(By.cssSelector("span[id*='unboundConfig']"));
                return unbound.getText().equals("Unbound or new configuration.");
            }
        });
        assertThat(unbound, is(true));
        
        // make sure values are defaults again
        WebElement configurationPanel = ConfigurationHelper.findConfigurationPanel(m_PidToChange, false);
        WebElement configPropsTable = 
                configurationPanel.findElement(By.cssSelector("tbody[id$='compositeConfigTable_data']"));
        wait.until(ExpectedConditions.visibilityOf(configPropsTable));
        
        assertThat(ConfigurationHelper.getInputBoxValue(configPropsTable, "Some int"), is("8"));
        assertThat(ConfigurationHelper.getSelectOneListBoxValue(configPropsTable, "Some enum"), is("Value1"));
        assertThat(ConfigurationHelper.getBooleanButtonValue(configPropsTable, "Some bool"), is(false));
        
        //Close the config panel.
        WebElement collapseConfig = configurationPanel.findElement(
                By.cssSelector("span[class='ui-icon ui-icon-minusthick']"));
        collapseConfig.click();
        
        //Wait for config panel to collapse.
        Thread.sleep(1000);
        assertThat(configPropsTable.isDisplayed(), is(false));
    }
/**
     * Test deleting a configuration.
     * Verify that the values are returned to the default.
     * This test depends on the {@link #assertChangeConfig()} test to alter the values of the configuration first. 
     * If that test fails then this test will also fail since there will be no configuration to delete.
     */
Test deleting a configuration.
Verify that the values are returned to the default.
This test depends on the  #assertChangeConfig() test to alter the values of the configuration first.
If that test fails then this test will also fail since there will be no configuration to delete.
Test deleting a configuration . Verify that the values are returned to the default . This test depends on the #assertChangeConfig () test to alter the values of the configuration first . If that test fails then this test will also fail since there will be no configuration to delete .
public void assertDeleteConfig() throws InterruptedException
    {
        WebDriverWait wait = new WebDriverWait(m_Driver, 5);
        wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("tbody[id*='configTable_data']")));
        Wait<WebDriver> fwait = new FluentWait<WebDriver>(m_Driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(1, TimeUnit.SECONDS).ignoring(StaleElementReferenceException.class, 
                        NoSuchElementException.class);
        WebElement deleteButton = fwait.until(new ExpectedCondition<WebElement>()
        {
            @Override
            public WebElement apply(WebDriver driver)
            {
                WebElement configPanel = ConfigurationHelper.findConfigurationPanel(m_PidToChange, false);
                return configPanel.findElement(By.cssSelector("button[id*='deleteConfig']"));
            }
        });
        assertThat(deleteButton, is (notNullValue()));
        deleteButton.click();
        ConfigurationHelper.handleDeleteConfigDialog(m_Driver, m_PidToChange, true);
        Thread.sleep(2000);
        Boolean unbound = fwait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement configPanel = ConfigurationHelper.findConfigurationPanel(m_PidToChange, false);
                WebElement unbound = configPanel.findElement(By.cssSelector("span[id*='unboundConfig']"));
                return unbound.getText().equals("Unbound or new configuration.");
            }
        });
        assertThat(unbound, is(true));
        WebElement configurationPanel = ConfigurationHelper.findConfigurationPanel(m_PidToChange, false);
        WebElement configPropsTable = 
                configurationPanel.findElement(By.cssSelector("tbody[id$='compositeConfigTable_data']"));
        wait.until(ExpectedConditions.visibilityOf(configPropsTable));
        assertThat(ConfigurationHelper.getInputBoxValue(configPropsTable, "Some int"), is("8"));
        assertThat(ConfigurationHelper.getSelectOneListBoxValue(configPropsTable, "Some enum"), is("Value1"));
        assertThat(ConfigurationHelper.getBooleanButtonValue(configPropsTable, "Some bool"), is(false));
        WebElement collapseConfig = configurationPanel.findElement(
                By.cssSelector("span[class='ui-icon ui-icon-minusthick']"));
        collapseConfig.click();
        Thread.sleep(1000);
        assertThat(configPropsTable.isDisplayed(), is(false));
    }
public void assertDeleteConfig ( ) throws InterruptedException { WebDriverWait wait = new WebDriverWait ( m_Driver , 5 ) ; wait . until ( ExpectedConditions . presenceOfElementLocated ( By . cssSelector ( "tbody[id*='configTable_data']" ) ) ) ; Wait < WebDriver > fwait = new FluentWait < WebDriver > ( m_Driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 1 , TimeUnit . SECONDS ) . ignoring ( StaleElementReferenceException . class , NoSuchElementException . class ) ; WebElement deleteButton = fwait . until ( new ExpectedCondition < WebElement > ( ) { @ Override public WebElement apply ( WebDriver driver ) { WebElement configPanel = ConfigurationHelper . findConfigurationPanel ( m_PidToChange , false ) ; return configPanel . findElement ( By . cssSelector ( "button[id*='deleteConfig']" ) ) ; } } ) ; assertThat ( deleteButton , is ( notNullValue ( ) ) ) ; deleteButton . click ( ) ; ConfigurationHelper . handleDeleteConfigDialog ( m_Driver , m_PidToChange , true ) ; Thread . sleep ( 2000 ) ; Boolean unbound = fwait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement configPanel = ConfigurationHelper . findConfigurationPanel ( m_PidToChange , false ) ; WebElement unbound = configPanel . findElement ( By . cssSelector ( "span[id*='unboundConfig']" ) ) ; return unbound . getText ( ) . equals ( "Unbound or new configuration." ) ; } } ) ; assertThat ( unbound , is ( true ) ) ; WebElement configurationPanel = ConfigurationHelper . findConfigurationPanel ( m_PidToChange , false ) ; WebElement configPropsTable = configurationPanel . findElement ( By . cssSelector ( "tbody[id$='compositeConfigTable_data']" ) ) ; wait . until ( ExpectedConditions . visibilityOf ( configPropsTable ) ) ; assertThat ( ConfigurationHelper . getInputBoxValue ( configPropsTable , "Some int" ) , is ( "8" ) ) ; assertThat ( ConfigurationHelper . getSelectOneListBoxValue ( configPropsTable , "Some enum" ) , is ( "Value1" ) ) ; assertThat ( ConfigurationHelper . getBooleanButtonValue ( configPropsTable , "Some bool" ) , is ( false ) ) ; WebElement collapseConfig = configurationPanel . findElement ( By . cssSelector ( "span[class='ui-icon ui-icon-minusthick']" ) ) ; collapseConfig . click ( ) ; Thread . sleep ( 1000 ) ; assertThat ( configPropsTable . isDisplayed ( ) , is ( false ) ) ; }
Test deleting a configuration.
Test deleting a configuration .
//Wait until the configuration table is available. //Delete the configuration. //Sleep need so controller has time to delete configuration and send response. //Verify that config is new or unbound. // make sure values are defaults again //Close the config panel. //Wait for config panel to collapse.