thebrowsercompany / swift-webdriver

A Swift library for communicating with WebDriver (Appium/WinAppDriver) endpoints
BSD 3-Clause "New" or "Revised" License
105 stars 3 forks source link

Should `retryUntil` throw if it fails? #61

Closed jeffdav closed 1 year ago

jeffdav commented 1 year ago

Consider:

try closeButton.click()

This will retry if we catch winAppDriver_elementNotInteractable. However, if we time out without it succeeding, then we just carry on and a test that does the above will not fail in any explicit way, especially if this is the last thing a test does.

So I think that retryUntil should throw if it times-out. It should either throw the original error, or throw a retry time'd out error with enough context to figure out what failed.