ScreenPyHQ / screenpy

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

Add `Loudly` adverb. #72

Open perrygoy opened 1 year ago

perrygoy commented 1 year ago

Since we're adding Quietly in #71, let's add Loudly to do the exact opposite!

Say you've got a complicated Task that does like, twelve other Tasks. You normally don't want those other Tasks logged, so you wrap them in a Quietly so the top-Task can summarize what they're doing. But during one of the sub-sub-sub-Tasks, you enter a string into an input field that you really need to know to debug when the test goes wrong.

Enter text loudly with Loudly! Loudly will make sure that no matter whether a Quietly on the outside told the Narrator to be quiet, or a Quietly inside of it tries to stop narrating, everything it's passed will be narrated. LOUDLY!

perrygoy commented 1 year ago

This one will probably need a new Narrator method that skips any kinks.

bandophahita commented 1 year ago

I think skipping kinks would completely nullify how Eventually works. We depend on the kinking to toss away the repeated loops in Eventually. If someone wrapped Loudly around actions that use Eventually the logging would look pretty atrocious.