ScreenPyHQ / screenpy

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

Handle natural language for plural vs singular cases in SeeAnyOf and SeeAllOf #33

Closed bandophahita closed 1 year ago

bandophahita commented 2 years ago

The current describe and beat logging for SeeAnyOf and SeeAllOf look awkward when there is only a singleton test case present.

Admin tries to see if all of 1 tests pass, eventually.
    Admin sees if all of the following 1 tests pass:
        Admin sees if the username field is visible.

It sure would be nice if that language read properly.

bandophahita commented 2 years ago

A thought came up in a discord discussion about implementing some way to allow the caller to turn off their beat message when it made sense to do so. If we had that ability, we would potentially be able to circumvent the need for singular language and just let the See beat logging write while turning off the SeeAnyOf.

Doing that, would allow us to go from:

Admin tries to see if all of 1 test passes, eventually.
    Admin sees if all of the following 1 test passes:
        Admin sees if the username field is visible.

to this:

Admin tries to see if all of 1 tests pass, eventually.
    Admin sees if the username field is visible.

or even this:

Admin tries to see if the username field is visible, eventually.
    Admin inspects the username field.
        => <selenium.webdriver.remote.webelement.WebElement (session="d6bc23ef9e202527d87ca1adf3898bb3", element="adfaffe1-6f9f-4b8f-9dec-d0a422ab0d7b")>
    ... hoping it's visible
        => True
perrygoy commented 1 year ago

Complete! Along with a whole handful of present-tense Actions!