public void checked ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { elementPresent ( seconds ) ; while ( ! element . is ( ) . checked ( ) && System . currentTimeMillis ( ) < end ) ; double timeTook = Math . min ( ( seconds * 1000 ) - ( end - System . currentTimeMillis ( ) ) , seconds * 1000 ) / 1000 ; checkChecked ( seconds , timeTook ) ; } catch ( TimeoutException e ) { checkNotDisplayed ( seconds , seconds ) ; } }
Waits for the element to be checked . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support .