public void cssValue ( String attribute , String expectedValue ) { String cssValue = checkCssValue ( attribute , expectedValue , 0 , 0 ) ; String reason = NO_ELEMENT_FOUND ; if ( cssValue == null && expectedValue != null && getElement ( ) . is ( ) . present ( ) ) { reason = "CSS attribute not found" ; } assertFalse ( reason , cssValue == null && expectedValue != null ) ; assertEquals ( "CSS Value Mismatch" , expectedValue , cssValue ) ; }
Asserts that the element has a css attribute with a value equal to the value provided . If the element isn t present or the css doesn t contain the desired attribute this will constitute a failure same as a mismatch . This information will be logged and recorded with a screenshot for traceability and added debugging support .