Authoring Guide

Reusing logic — Run Test vs. User-Defined

Two ways to share a step sequence across tests. When to use Run Test (calls another test by name) and when to use User-Defined templates (embedded, editable, propagating).

You'll quickly find sequences you want to reuse: a login flow, a "navigate to settings" pattern, a "set up a clean account" fixture. Mavster has two reuse mechanisms — they look similar from the outside but feel very different in practice.

At a glance

Run TestUser-Defined template
Where the sequence livesA separate, owned test in the same projectA global template available to every project on your Mac
What you see in the call siteA single chip: "Run 'login' test"The full sequence, embedded as editable steps
Edit the source, propagate?Yes — every Run Test step automatically calls the latest versionYes — template edits propagate, except to locally-overridden steps
Edit the call site without affecting source?No — the called test is the same testYes — local overrides flag a step so future template edits skip it
Cross-project reuse?No — Run Test resolves names within the current projectYes — templates are global to the Mac
Run history attributionAttributed to the called testAttributed to whichever test embeds the instance
Recursion / nestingRun Test can call Run Test can call Run TestOne level (children of children are not supported)
Per-call argument valuesArguments dictionary on the Run Test stepArguments dictionary on the User-Defined instance

Pick Run Test when…

  • The sequence has its own meaningful identity (you'd name it "Sign-In Test" or "Setup Test", not "the steps that go before every checkout").
  • You want a single source of truth and don't need per-call-site customization.
  • You want recursive composition — a smoke suite that's a sequence of Run Test steps, where each called test is itself composed of Run Test steps.
  • You want per-test history for the called sequence — every call shows up in the called test's run history with cost and pass/fail.

Pick User-Defined when…

  • The sequence is a building block, not a standalone test ("the dialog dismiss pattern", "the standard list-row tap-and-confirm").
  • You want call sites to show the full sequence inline so the test reads top-to-bottom.
  • You want the template available across every project — User-Defined templates live globally on your Mac.
  • You sometimes need to tweak one instance without touching other instances.

Combine both

The two mechanisms compose. A common pattern:

  • A signup User-Defined template wrapping the field-by-field form interaction.
  • A signup-test test that uses the signup template and surrounds it with project-specific Visual Asserts.
  • A smoke-suite test that calls signup-test (and many others) via Run Test.

The User-Defined template handles UI-level reuse; the Run Test step handles test-level composition.

Anti-patterns

  • Don't use Run Test for one-line wrappers. If the called test is just a single Tap, inline it instead.
  • Don't use User-Defined templates for "your one and only sign-up test". That's a test, not a template.
  • Don't fight the one-level rule. If you find yourself wanting templates inside templates or children of children, the right fix is usually a Run Test step that calls a smaller test, not a deeper nesting.