public void text ( String expectedPattern ) { String text = checkText ( expectedPattern , 0 , 0 ) ; assertNotNull ( NO_ELEMENT_FOUND , text ) ; assertTrue ( "Text Mismatch: text of '" + text + DOES_NOT_MATCH_PATTERN + expectedPattern + "'" , text . matches ( expectedPattern ) ) ; }
Asserts that the element s text matches the regular expression pattern provided . If the element isn t present 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 .