mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/asset/TestAssetLocation.java
@Test
    public void testGetPositionCapabilsConfigHandlePositionFalse() throws InterruptedException
    {
        AssetHelper.createAsset(m_Driver, "ExampleAsset", "testExampleAsset");
        
        //used to check the location inputs are enabled and the default values are correct while avoiding
        //stale element references
        Wait<WebDriver> locationInputWait = new FluentWait<WebDriver>(m_Driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                        StaleElementReferenceException.class);
        
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement latitude = m_Driver.findElement(By.cssSelector("input[id$='" + LAT_INPUT_ID +"']"));
                assertThat(latitude.getAttribute("value"), is(""));
                assertThat(latitude.isEnabled(), is(false));
                return true;
            }
        });
        
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement longitude = m_Driver.findElement(By.cssSelector("input[id$='" + LON_INPUT_ID + "']"));
                assertThat(longitude.getAttribute("value"), is(""));
                assertThat(longitude.isEnabled(), is(false));
                return true;
            }
        });
        
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement altitude = m_Driver.findElement(By.cssSelector("input[id$='" + ALT_INPUT_ID + "']"));
                assertThat(altitude.getAttribute("value"), is(""));
                assertThat(altitude.isEnabled(), is(false));
                return true;
            }
        });
        
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement bank = m_Driver.findElement(By.cssSelector("input[id$='" + BANK_INPUT_ID + "']"));
                assertThat(bank.getAttribute("value"), is(""));
                assertThat(bank.isEnabled(), is(false));
                return true;
            }
        });
        
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement heading = m_Driver.findElement(By.cssSelector("input[id$='" + HEAD_INPUT_ID + "']"));
                assertThat(heading.getAttribute("value"), is(""));
                assertThat(heading.isEnabled(), is(false));
                return true;
            }
        });
        
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement elevation = m_Driver.findElement(By.cssSelector("input[id$='" + ELV_INPUT_ID + "']"));
                assertThat(elevation.getAttribute("value"), is(""));
                assertThat(elevation.isEnabled(), is(false));
                return true;
            }
        });
        
        //verify edit location button shows up
        assertThat(m_Driver.findElements(By.cssSelector("button[id$='" + EDIT_LOC_BUT_ID + "']")).size(), is(1));
        
        //verify sync button shows up
        assertThat(m_Driver.findElements(By.cssSelector("button[id$='" + SYNC_LOC_BUT_ID + "']")).size(), is(1));
        
        AssetHelper.removeAsset(m_Driver, "testExampleAsset");
    }
/**
     * ExampleAsset: has getPosition capability, does not have setPosition capability
     * Asset position handling config property: set to false
     * Bring up the configuration dialog so the default Asset position handling configuration property of true, updates
     * the flag. Verify that the edit button shows up and we can successfully edit and sync the asset location.
     */
has getPosition capability, does not have setPosition capability
Asset position handling config property: set to false
Bring up the configuration dialog so the default Asset position handling configuration property of true, updates
the flag. Verify that the edit button shows up and we can successfully edit and sync the asset location.
has getPosition capability does not have setPosition capability Asset position handling config property : set to false Bring up the configuration dialog so the default Asset position handling configuration property of true updates the flag . Verify that the edit button shows up and we can successfully edit and sync the asset location .
@Test
    public void testGetPositionCapabilsConfigHandlePositionFalse() throws InterruptedException
    {
        AssetHelper.createAsset(m_Driver, "ExampleAsset", "testExampleAsset");
        Wait<WebDriver> locationInputWait = new FluentWait<WebDriver>(m_Driver).withTimeout(30, TimeUnit.SECONDS).
                pollingEvery(2, TimeUnit.SECONDS).ignoring(NoSuchElementException.class, 
                        StaleElementReferenceException.class);
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement latitude = m_Driver.findElement(By.cssSelector("input[id$='" + LAT_INPUT_ID +"']"));
                assertThat(latitude.getAttribute("value"), is(""));
                assertThat(latitude.isEnabled(), is(false));
                return true;
            }
        });
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement longitude = m_Driver.findElement(By.cssSelector("input[id$='" + LON_INPUT_ID + "']"));
                assertThat(longitude.getAttribute("value"), is(""));
                assertThat(longitude.isEnabled(), is(false));
                return true;
            }
        });
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement altitude = m_Driver.findElement(By.cssSelector("input[id$='" + ALT_INPUT_ID + "']"));
                assertThat(altitude.getAttribute("value"), is(""));
                assertThat(altitude.isEnabled(), is(false));
                return true;
            }
        });
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement bank = m_Driver.findElement(By.cssSelector("input[id$='" + BANK_INPUT_ID + "']"));
                assertThat(bank.getAttribute("value"), is(""));
                assertThat(bank.isEnabled(), is(false));
                return true;
            }
        });
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement heading = m_Driver.findElement(By.cssSelector("input[id$='" + HEAD_INPUT_ID + "']"));
                assertThat(heading.getAttribute("value"), is(""));
                assertThat(heading.isEnabled(), is(false));
                return true;
            }
        });
        locationInputWait.until(new ExpectedCondition<Boolean>()
        {
            @Override
            public Boolean apply(WebDriver driver)
            {
                WebElement elevation = m_Driver.findElement(By.cssSelector("input[id$='" + ELV_INPUT_ID + "']"));
                assertThat(elevation.getAttribute("value"), is(""));
                assertThat(elevation.isEnabled(), is(false));
                return true;
            }
        });
        assertThat(m_Driver.findElements(By.cssSelector("button[id$='" + EDIT_LOC_BUT_ID + "']")).size(), is(1));
        assertThat(m_Driver.findElements(By.cssSelector("button[id$='" + SYNC_LOC_BUT_ID + "']")).size(), is(1));
        AssetHelper.removeAsset(m_Driver, "testExampleAsset");
    }
@ Test public void testGetPositionCapabilsConfigHandlePositionFalse ( ) throws InterruptedException { AssetHelper . createAsset ( m_Driver , "ExampleAsset" , "testExampleAsset" ) ; Wait < WebDriver > locationInputWait = new FluentWait < WebDriver > ( m_Driver ) . withTimeout ( 30 , TimeUnit . SECONDS ) . pollingEvery ( 2 , TimeUnit . SECONDS ) . ignoring ( NoSuchElementException . class , StaleElementReferenceException . class ) ; locationInputWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement latitude = m_Driver . findElement ( By . cssSelector ( "input[id$='" + LAT_INPUT_ID + "']" ) ) ; assertThat ( latitude . getAttribute ( "value" ) , is ( "" ) ) ; assertThat ( latitude . isEnabled ( ) , is ( false ) ) ; return true ; } } ) ; locationInputWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement longitude = m_Driver . findElement ( By . cssSelector ( "input[id$='" + LON_INPUT_ID + "']" ) ) ; assertThat ( longitude . getAttribute ( "value" ) , is ( "" ) ) ; assertThat ( longitude . isEnabled ( ) , is ( false ) ) ; return true ; } } ) ; locationInputWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement altitude = m_Driver . findElement ( By . cssSelector ( "input[id$='" + ALT_INPUT_ID + "']" ) ) ; assertThat ( altitude . getAttribute ( "value" ) , is ( "" ) ) ; assertThat ( altitude . isEnabled ( ) , is ( false ) ) ; return true ; } } ) ; locationInputWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement bank = m_Driver . findElement ( By . cssSelector ( "input[id$='" + BANK_INPUT_ID + "']" ) ) ; assertThat ( bank . getAttribute ( "value" ) , is ( "" ) ) ; assertThat ( bank . isEnabled ( ) , is ( false ) ) ; return true ; } } ) ; locationInputWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement heading = m_Driver . findElement ( By . cssSelector ( "input[id$='" + HEAD_INPUT_ID + "']" ) ) ; assertThat ( heading . getAttribute ( "value" ) , is ( "" ) ) ; assertThat ( heading . isEnabled ( ) , is ( false ) ) ; return true ; } } ) ; locationInputWait . until ( new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { WebElement elevation = m_Driver . findElement ( By . cssSelector ( "input[id$='" + ELV_INPUT_ID + "']" ) ) ; assertThat ( elevation . getAttribute ( "value" ) , is ( "" ) ) ; assertThat ( elevation . isEnabled ( ) , is ( false ) ) ; return true ; } } ) ; assertThat ( m_Driver . findElements ( By . cssSelector ( "button[id$='" + EDIT_LOC_BUT_ID + "']" ) ) . size ( ) , is ( 1 ) ) ; assertThat ( m_Driver . findElements ( By . cssSelector ( "button[id$='" + SYNC_LOC_BUT_ID + "']" ) ) . size ( ) , is ( 1 ) ) ; AssetHelper . removeAsset ( m_Driver , "testExampleAsset" ) ; }
ExampleAsset: has getPosition capability, does not have setPosition capability
 Asset position handling config property: set to false
 Bring up the configuration dialog so the default Asset position handling configuration property of true, updates
 the flag.
ExampleAsset : has getPosition capability does not have setPosition capability Asset position handling config property : set to false Bring up the configuration dialog so the default Asset position handling configuration property of true updates the flag .
//used to check the location inputs are enabled and the default values are correct while avoiding //stale element references //verify edit location button shows up //verify sync button shows up