public static ExpectedCondition < Boolean > not ( final ExpectedCondition < ? > condition ) { return new ExpectedCondition < Boolean > ( ) { @ Override public Boolean apply ( WebDriver driver ) { Object result = condition . apply ( driver ) ; return result == null || result . equals ( Boolean . FALSE ) ; } @ Override public String toString ( ) { return "condition to not be valid: " + condition ; } } ; }
An expectation with the logical opposite condition of the given condition .