mil.dod.th.ose.gui.integration/src/mil/dod/th/ose/gui/integration/webapp/asset/TestAssetCommands.java
private void grabParameterTableAndVerify(WebElement assetCommandPanel, List<String> expectedValues)
    {
        List<WebElement> rows = getParameterTableRows(assetCommandPanel);
        
        int parameterToValidate = 0; 
        
        for (WebElement row : rows)
        {
            List<WebElement> thirdTd = row.findElements(By.cssSelector("td:nth-child(3)"));
            
            if (thirdTd.size() > 0)
            {
                List<WebElement> inputs = thirdTd.get(0).findElements(By.cssSelector("input[id*='treeInput']" +
                        "[type='text']"));
                List<WebElement> dropDowns = thirdTd.get(0).findElements(By.cssSelector("div[class$='dropDownMenu']"));
                
                
                if (inputs.size() > 0)
                {
                    WebElement textInput = inputs.get(0);
                    
                    assertThat(textInput.getAttribute("value"), is(expectedValues.get(parameterToValidate)));
                    parameterToValidate++;
                }
                else if (dropDowns.size() > 0)
                {
                    WebElement dropDown = dropDowns.get(0).findElement(By.cssSelector("label"));
                    
                    assertThat(dropDown.getText(), is(expectedValues.get(parameterToValidate)));
                    parameterToValidate++;
                }
            }
        }
    }
/**
     * Function to verify parameter values in a command table panel. Function assumes that the command
     * table panel is already visible/expanded.
     * @param assetCommandPanel
     *  the asset command panel which holds the command and its fields that are to be verified
     * @param expectedValues
     *  the expected values of the parameters, in order, as they are expected to appear in the 
     *  parameter table
     */
Function to verify parameter values in a command table panel. Function assumes that the command
table panel is already visible/expanded.
@param assetCommandPanel
the asset command panel which holds the command and its fields that are to be verified
@param expectedValues
the expected values of the parameters, in order, as they are expected to appear in the
parameter table
Function to verify parameter values in a command table panel . Function assumes that the command table panel is already visible / expanded . @param assetCommandPanel the asset command panel which holds the command and its fields that are to be verified @param expectedValues the expected values of the parameters in order as they are expected to appear in the parameter table
private void grabParameterTableAndVerify(WebElement assetCommandPanel, List<String> expectedValues)
    {
        List<WebElement> rows = getParameterTableRows(assetCommandPanel);
        int parameterToValidate = 0; 
        for (WebElement row : rows)
        {
            List<WebElement> thirdTd = row.findElements(By.cssSelector("td:nth-child(3)"));
            if (thirdTd.size() > 0)
            {
                List<WebElement> inputs = thirdTd.get(0).findElements(By.cssSelector("input[id*='treeInput']" +
                        "[type='text']"));
                List<WebElement> dropDowns = thirdTd.get(0).findElements(By.cssSelector("div[class$='dropDownMenu']"));
                if (inputs.size() > 0)
                {
                    WebElement textInput = inputs.get(0);
                    assertThat(textInput.getAttribute("value"), is(expectedValues.get(parameterToValidate)));
                    parameterToValidate++;
                }
                else if (dropDowns.size() > 0)
                {
                    WebElement dropDown = dropDowns.get(0).findElement(By.cssSelector("label"));
                    assertThat(dropDown.getText(), is(expectedValues.get(parameterToValidate)));
                    parameterToValidate++;
                }
            }
        }
    }
private void grabParameterTableAndVerify ( WebElement assetCommandPanel , List < String > expectedValues ) { List < WebElement > rows = getParameterTableRows ( assetCommandPanel ) ; int parameterToValidate = 0 ; for ( WebElement row : rows ) { List < WebElement > thirdTd = row . findElements ( By . cssSelector ( "td:nth-child(3)" ) ) ; if ( thirdTd . size ( ) > 0 ) { List < WebElement > inputs = thirdTd . get ( 0 ) . findElements ( By . cssSelector ( "input[id*='treeInput']" + "[type='text']" ) ) ; List < WebElement > dropDowns = thirdTd . get ( 0 ) . findElements ( By . cssSelector ( "div[class$='dropDownMenu']" ) ) ; if ( inputs . size ( ) > 0 ) { WebElement textInput = inputs . get ( 0 ) ; assertThat ( textInput . getAttribute ( "value" ) , is ( expectedValues . get ( parameterToValidate ) ) ) ; parameterToValidate ++ ; } else if ( dropDowns . size ( ) > 0 ) { WebElement dropDown = dropDowns . get ( 0 ) . findElement ( By . cssSelector ( "label" ) ) ; assertThat ( dropDown . getText ( ) , is ( expectedValues . get ( parameterToValidate ) ) ) ; parameterToValidate ++ ; } } } }
Function to verify parameter values in a command table panel.
Function to verify parameter values in a command table panel .