Protocols
These are the protocols followed by ScreenPy. They form the basis of the structural subtyping employed by ScreenPy.
Each class type below must follow the listed protocol to be considered that class type.
Ability
Action
Question
Resolution
Narrator’s Adapter
- class Adapter(*args, **kwargs)
Required functions for an adapter to the Narrator’s microphone.
Adapters allow the Narrator’s microphone to broadcast to multiple reporting tools, such as stdout or Allure.
Each of the methods described below correspond to the
screenpy.pacing
decorators of the same name. The Narrator expects each of these methods to yield the function back. This allows each adapter to modify the function in whatever ways it needs to while allowing the adapters before and after to do the same.Adapters must follow the function signatures exactly, even if the adapter does not use one or more of the parameters. The Narrator passes these arguments in as keyword arguments, so they must not be renamed.
- act(func: Callable, line: str, gravitas: str | None = None) Generator
Handle narrating an Act, which designates a group of tests.
- scene(func: Callable, line: str, gravitas: str | None = None) Generator
Handle narrating a Scene, which designates a subgroup of tests.
- beat(func: Callable, line: str, gravitas: str | None = None) Generator
Handle narrating a Beat, which is a step in a test.