ScreenPyHQ / screenpy

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

#67: fix consistency between SeeAnyOf and SeeAllOf. #77

Closed perrygoy closed 1 year ago

perrygoy commented 1 year ago

This PR ensures both SeeAnyOf and SeeAllOf behave consistently:

... and those were the two ways they were inconsistent! Well one way they were inconsistent and one new thing to handle.

bandophahita commented 1 year ago

This one is hard for me. I'm not a fan of either raising an exception when called without tests.

When this issue came up, I found it odd that actor.shall(SeeAllOf()) would pass but actor.shall(SeeAnyOf()) would fail.

I feel doing nothing should result in passing. Much like the following in pytest would result in passing.

def test_func():
    pass

The above inconsistency is what I called into question.

While we also talked about if SeeAnyOf should continue looping after it finds the first pass, I don't believe these two actions need to be consistent in their looping behavior. I feel it makes sense to match the common behavior of python for all() vs any().

That said, this new change (failing without an argument) would be consistent behavior with any and all.

edit - that's what I get for not working on this for weeks at a time. We DID talk about the above and the latest changes reflect that.