public void alertMatches ( double seconds , String expectedAlertPattern ) { try { double timeTook = popup ( seconds ) ; timeTook = popupMatches ( seconds - timeTook , expectedAlertPattern ) ; checkAlertMatches ( expectedAlertPattern , seconds , timeTook ) ; } catch ( TimeoutException e ) { checkAlertMatches ( expectedAlertPattern , seconds , seconds ) ; } }
Waits up to the provided wait time for an alert present on the page has content matching the expected patten . This information will be logged and recorded with a screenshot for traceability and added debugging support .