ScreenPyHQ / screenpy

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

#54: Make Narrator a singleton. #68

Closed perrygoy closed 1 year ago

perrygoy commented 1 year ago

This PR makes the Narrator class into a singleton. It's main intent is to make it easier to access the Narrator, especially now that the Narrator can be imported from screenpy. I was worried that might be confusing between Narrator and the_narrator.

I've updated the code and documentation to use Narrator() in all the places it used to use the_narrator, except in screenpy.pacing. Even though they are functionally identical, i have a feeling there are some repos who use the_narrator from pacing, and i don't want this to break those suites.

perrygoy commented 1 year ago

After a lot of discussion with @bandophahita, we decided instead to encourage the use of the_narrator. We'll be removing Narrator from the list of top-level screenpy imports and making it clear that it shouldn't be used directly.