Pacing

These decorators provide ways to mark certain things for Narration. act() and scene() tell the Narrator to mark your tests with annotations, while beat() and aside() feed the Narrator lines to speak into their microphone.

Act

act(title: str, gravitas: str | None = None) Callable[[Callable[P, T]], Callable[P, T]]

Decorator to mark an “act”.

Acts are large groupings of tests, like suites or tests for an epic. You may have a “Smoke” act, or a “Log In” act, or a “Third” act. Think of acts like an Epic ticket.

Args:

title: the title of this act (the epic name). gravitas: how serious this act is (the severity level).

Returns:

The decorated function, which will be narrated when called.

Scene

scene(title: str, gravitas: str | None = None) Callable[[Callable[P, T]], Callable[P, T]]

Decorator to mark a “scene”.

Scenes are smaller groupings of tests which can transcend a suite’s directory grouping. They can be sub-groups of tests of an act, or an inter-act group. Think of scenes like a Feature ticket.

Args:

title: the title of this scene (the feature). gravitas: how serious this scene is (the severity level).

Returns:

The decorated function, which will be narrated when called.

beat

beat(line: str, gravitas: str | None = None) Callable[[Callable[P, T]], Callable[P, T]]

Decorator to describe a “beat” (a step in a test).

A beat’s line can contain markers for replacement via str.format(), which will be figured out from the properties of a decorated method’s class.

For example, if the beat line is “{} clicks on the {target}”, then “{}” will be replaced by the Actor’s name, and “{target}” will be replaced using the Click action’s target property (e.g. Click.target).

Args:

line: the line spoken during this “beat” (the step description). gravitas: the severity for the narration of the line.

Returns:

The decorated function, which will be narrated when called.

aside

aside(line: str, gravitas: str | None = None) None

A line spoken in a stage whisper to the audience (log a message).

Args:

line: the line spoken during this “beat” (the step description). gravitas: the severity for the narration of the line.