mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/asset/TestAssetPage.java
@Test
    public void testCreateAssetWithRequiredProps() throws InterruptedException
    {
        final Map<String, Object> props = new HashMap<>();
        props.put("Activate on startup", true);
        props.put("Plugin overrides position", true);
        props.put("hostname", "127.0.0.1");
        props.put("portNumber", "1337");
        
        //---Create asset that has required properties---
        AssetHelper.createAsset(m_Driver, "ExampleRequiredPropAsset", "reqPropAsset", props);
        
        //---Verified asset was actually created---
        final WebElement asset = AssetHelper.retrieveAsset(m_Driver, "reqPropAsset");
        assertThat(asset, is(notNullValue()));
        
        //---bring up configuration dialog---
        asset.findElement(By.cssSelector("button[id*='configurationButton']")).click();
        
        //---verify header is visible---
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("assetEditConfiguration")));     
        
        //---retrieve the configuration table used to verify appropriate configuration values are being used---
        WebElement configDialog = m_Driver.findElement(By.id("assetEditConfiguration"));
        WebElement configTable = configDialog.findElement(By.cssSelector("tbody[id$='compositeConfigTable_data']"));
        
        //---verify values were persisted---
        assertThat(ConfigurationHelper.getBooleanButtonValue(configTable, "Activate on startup"), is(true));
        assertThat(ConfigurationHelper.getBooleanButtonValue(configTable, "Plugin overrides position"), is(true));
        assertThat(ConfigurationHelper.getInputBoxValue(configTable, "hostname"), is("127.0.0.1"));
        assertThat(ConfigurationHelper.getInputBoxValue(configTable, "portNumber"), is("1337"));
        
        //---close the configuration dialog after verifying properties---
        configDialog = m_Driver.findElement(By.id("assetEditConfiguration"));
        WebElement cancelConfig = configDialog.findElement(By.cssSelector("button[id*='cancelConfig']"));
        cancelConfig.click();
        
        //---verify dialog is closed---
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button[id*='configurationButton']")));
        
        //---deactivate asset since it should automatically start due to the configuration properties---
        AssetHelper.deactivateAsset(m_Driver, "reqPropAsset");
        AssetHelper.removeAsset(m_Driver, "reqPropAsset");
    }
/**
     * Verify that an asset with required configuration properties can be created through the GUI and that the 
     * appropriate configuration values are actually set.
     */
Verify that an asset with required configuration properties can be created through the GUI and that the
appropriate configuration values are actually set.
Verify that an asset with required configuration properties can be created through the GUI and that the appropriate configuration values are actually set .
@Test
    public void testCreateAssetWithRequiredProps() throws InterruptedException
    {
        final Map<String, Object> props = new HashMap<>();
        props.put("Activate on startup", true);
        props.put("Plugin overrides position", true);
        props.put("hostname", "127.0.0.1");
        props.put("portNumber", "1337");
        AssetHelper.createAsset(m_Driver, "ExampleRequiredPropAsset", "reqPropAsset", props);
        final WebElement asset = AssetHelper.retrieveAsset(m_Driver, "reqPropAsset");
        assertThat(asset, is(notNullValue()));
        asset.findElement(By.cssSelector("button[id*='configurationButton']")).click();
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("assetEditConfiguration")));     
        WebElement configDialog = m_Driver.findElement(By.id("assetEditConfiguration"));
        WebElement configTable = configDialog.findElement(By.cssSelector("tbody[id$='compositeConfigTable_data']"));
        assertThat(ConfigurationHelper.getBooleanButtonValue(configTable, "Activate on startup"), is(true));
        assertThat(ConfigurationHelper.getBooleanButtonValue(configTable, "Plugin overrides position"), is(true));
        assertThat(ConfigurationHelper.getInputBoxValue(configTable, "hostname"), is("127.0.0.1"));
        assertThat(ConfigurationHelper.getInputBoxValue(configTable, "portNumber"), is("1337"));
        configDialog = m_Driver.findElement(By.id("assetEditConfiguration"));
        WebElement cancelConfig = configDialog.findElement(By.cssSelector("button[id*='cancelConfig']"));
        cancelConfig.click();
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button[id*='configurationButton']")));
        AssetHelper.deactivateAsset(m_Driver, "reqPropAsset");
        AssetHelper.removeAsset(m_Driver, "reqPropAsset");
    }
@ Test public void testCreateAssetWithRequiredProps ( ) throws InterruptedException { final Map < String , Object > props = new HashMap < > ( ) ; props . put ( "Activate on startup" , true ) ; props . put ( "Plugin overrides position" , true ) ; props . put ( "hostname" , "127.0.0.1" ) ; props . put ( "portNumber" , "1337" ) ; AssetHelper . createAsset ( m_Driver , "ExampleRequiredPropAsset" , "reqPropAsset" , props ) ; final WebElement asset = AssetHelper . retrieveAsset ( m_Driver , "reqPropAsset" ) ; assertThat ( asset , is ( notNullValue ( ) ) ) ; asset . findElement ( By . cssSelector ( "button[id*='configurationButton']" ) ) . click ( ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . id ( "assetEditConfiguration" ) ) ) ; WebElement configDialog = m_Driver . findElement ( By . id ( "assetEditConfiguration" ) ) ; WebElement configTable = configDialog . findElement ( By . cssSelector ( "tbody[id$='compositeConfigTable_data']" ) ) ; assertThat ( ConfigurationHelper . getBooleanButtonValue ( configTable , "Activate on startup" ) , is ( true ) ) ; assertThat ( ConfigurationHelper . getBooleanButtonValue ( configTable , "Plugin overrides position" ) , is ( true ) ) ; assertThat ( ConfigurationHelper . getInputBoxValue ( configTable , "hostname" ) , is ( "127.0.0.1" ) ) ; assertThat ( ConfigurationHelper . getInputBoxValue ( configTable , "portNumber" ) , is ( "1337" ) ) ; configDialog = m_Driver . findElement ( By . id ( "assetEditConfiguration" ) ) ; WebElement cancelConfig = configDialog . findElement ( By . cssSelector ( "button[id*='cancelConfig']" ) ) ; cancelConfig . click ( ) ; wait . until ( ExpectedConditions . visibilityOfElementLocated ( By . cssSelector ( "button[id*='configurationButton']" ) ) ) ; AssetHelper . deactivateAsset ( m_Driver , "reqPropAsset" ) ; AssetHelper . removeAsset ( m_Driver , "reqPropAsset" ) ; }
Verify that an asset with required configuration properties can be created through the GUI and that the
 appropriate configuration values are actually set.
Verify that an asset with required configuration properties can be created through the GUI and that the appropriate configuration values are actually set .
//---Create asset that has required properties--- //---Verified asset was actually created--- //---bring up configuration dialog--- //---verify header is visible--- //---retrieve the configuration table used to verify appropriate configuration values are being used--- //---verify values were persisted--- //---close the configuration dialog after verifying properties--- //---verify dialog is closed--- //---deactivate asset since it should automatically start due to the configuration properties---