Several apps in one test
Some behaviour only exists between apps: the copy that lands in a document, the export that opens in Preview, the file dragged in from Finder. Sisyphus can drive several apps in one test, and the test still reads like a one-app test.
in: another app
Section titled “in: another app”name: The result copies into TextEditapp: calculatorsteps: - type: 6*7= - press: Mod+C - expect: { equals: ["${clipboard()}", "42"] } - in: TextEdit # these steps work in TextEdit… do: - press: Mod+N - press: Mod+V - expect: textbox text: "42" - expect: text "Edit field" # …and this one is back in Calculator value: "42"After the in: block, steps are back in the test’s own app. There’s no “current app” to keep track of.
One step in another app
Section titled “One step in another app”Start a selector with app "…" >>:
- expect: app "Preview" >> window ~"report.pdf"- click: app "Finder" >> button "Back"Which apps you can name
Section titled “Which apps you can name”- An app from your
sisyphus.yaml, with its launch settings. - A system app:
Finder,Dock,menu bar, orfrontmost(whatever app is in front: for “clicking this opens some app”). - Any installed app, by name (
TextEdit,Preview) or bundle id (com.apple.TextEdit).
Most other apps need no configuration at all. sis validate catches a misspelt name and suggests the closest one.
Is the app running?
Section titled “Is the app running?”- expect: { app: Preview, running: true }- expect: { app: Preview, frontmost: true }- wait: { app: Preview, running: false } # it quitDragging between apps, and files
Section titled “Dragging between apps, and files”- drag: { from: app "Finder" >> ~"data.csv", to: list "Imports" }- drag: { file: ./fixtures/data.csv, to: list "Imports" } # a file, as if dropped from the desktopThe clipboard
Section titled “The clipboard”${clipboard()} reads it; set: { clipboard: some text } fills it before a paste.
Cleanup
Section titled “Cleanup”At the end, Sisyphus quits the apps the test started. Apps that were already running are never quit; Sisyphus only closes the windows the test opened in them. What it did is listed in the result.
Keep these tests few
Section titled “Keep these tests few”Test each app’s own behaviour in single-app tests: they’re faster and fail for one reason. Keep cross-app tests for the interaction itself.
