ScreenPyHQ / screenpy

Screenplay pattern base for Python automated UI test suites.
MIT License
28 stars 4 forks source link

Log how many times `Eventually` attempted the performable. #2

Closed pgoy-dod closed 2 years ago

pgoy-dod commented 2 years ago

With the ability to use Eventually with any Performable, including a Task, sometimes Eventually might not be able to complete its Performable before the 20 second timeout occurs. Eventually will always attempt to complete it at least once, but it would be helpful to know how many times the Performable was attempted.

Please add a counter to the message of the DeliveryError that is raised when Eventually fails!

bandophahita commented 2 years ago

This brings up an interesting problem of blocked operations occurring in the first loop of Eventually that take longer than the timeout. Example: Timeout is set to 5 seconds, but the operations of the first loop take 7 seconds. The way it is currently designed wouldn't stop the loop at 5 seconds.

I dunno if that's a problem we actually need to worry about since the majority of the time these loops typically only last milliseconds at most.

perrygoy commented 2 years ago

Hm... that is an interesting thought. I think that we can probably consider that a Task Failed Successfully sort of situation though, since Eventually's main focus is to just get through some performable without really asserting that it should take a certain time period to complete.