Looking at this code more closely, I'm not sure it is doing the correct thing. If success_condition returns False, I need the test to fail. In that case, world.css_find(css_selector)[index].click() does not throw an error, but the operation was also not successful. With your code, I'm afraid the method will either return as though everything is fine.

BTW, this isn't a completely pathological case. We were seeing a sporadic test failure on the Advanced Settings page, probably because of the fact that the notification bar raises up in an animated fashion.

I suggest going back to the boolean, or else I guess you can check the success condition at the very end as well and then throw an Exception if it fails?