public void urlEquals ( double seconds , String expectedURL ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { WebDriverWait wait = new WebDriverWait ( app . getDriver ( ) , ( long ) seconds , DEFAULT_POLLING_INTERVAL ) ; wait . until ( ExpectedConditions . urlToBe ( expectedURL ) ) ; double timeTook = Math . min ( ( seconds * 1000 ) - ( end - System . currentTimeMillis ( ) ) , seconds * 1000 ) / 1000 ; checkUrlEquals ( expectedURL , seconds , timeTook ) ; } catch ( TimeoutException e ) { checkUrlEquals ( expectedURL , seconds , seconds ) ; } }
Asserts that the provided URL equals the actual URL the application is currently on . This information will be logged and recorded with a screenshot for traceability and added debugging support .