Skip to content

Desktop apps that start slowly

Restarting the app before every test is the safest default, but some desktop apps take seconds to start, or need a library or project opened first. Over a hundred tests, that adds up to minutes. reuse keeps the app open for the whole run and puts it back at its starting point after each test.

sisyphus.yaml
apps:
editor:
macos: { app: /Applications/Editor.app }
reuse:
on_launch: # after every (re)launch: get to the start state
- run: open -a /Applications/Editor.app "${project_dir}/fixtures/sample.proj"
- expect: treeitem "sample"
check: # before each test: are we at the start?
- expect: window "Project Browser"

reuse: true is enough if the app needs no on_launch steps.

  1. First test: the app launches, on_launch runs, and the windows open at that point become its baseline.
  2. Before each test: check runs. If it fails, the app is relaunched once.
  3. After each test (pass or fail): open menus are closed, then every window, dialog and sheet that isn’t in the baseline (with Cancel, Close, OK or Escape). The test doesn’t need cleanup steps for windows.
  4. When tidying can’t work (a save prompt, a window that won’t close, a crash) the app is quit and relaunched for the next test. The result says why.

Add discard: true to answer “Don’t Save” prompts instead of relaunching, and steps: for any extra reset of your own.

reuse puts the windows back, not your data. Each test still sets up and resets the data it changes, as always.

Reused apps can hide a test that depends on what an earlier one left behind. Run without reuse regularly, for example nightly in CI:

Terminal window
sis run --no-reuse

reuse is for native desktop apps (macos:). Browsers already get a fresh, fast context per test.

Made by Bussin Bytes© 2026 Bussin Bytes Ltd · sisyphus.bussinbytes.io