Skip to main content

Order Mission Suites

Running testronaut without mission filenames discovers a suite from your project. By default, discovered mission files run alphabetically. Use missions.order in testronaut-config.json when a workflow has dependencies, such as logging in first and logging out last.

testronaut-config.json
{
"missions": {
"root": "missions",
"include": ["**/*.mission.js", "**/*.mission.ts"],
"exclude": ["**/*.draft.mission.js"],
"order": [
"login.mission.js",
"account/**/*.mission.js",
"*",
"logout.mission.js"
]
}
}

This example runs:

  1. login.mission.js
  2. matching account missions, alphabetically
  3. all other discovered missions, alphabetically
  4. logout.mission.js

Then run the configured suite normally:

testronaut

Ordering rules​

Order entries are paths or glob patterns relative to missions.root. They are evaluated from top to bottom.

  • A mission is placed by the first order entry that claims it.
  • Matches within one pattern remain alphabetical.
  • * is the catch-all position for missions not claimed by another entry. Missions matching entries after * are reserved for those later positions, which makes patterns such as login β†’ * β†’ logout possible.
  • Discovered missions that are not listed or matched are appended alphabetically.
  • An exact filename that was not discovered produces a warning. An unmatched glob does not, so optional groups can be represented safely.
  • If missions.order is absent or empty, discovery remains alphabetical.

include and exclude decide which files belong to the suite; order only arranges the files that remain after discovery. Tag filters select from that ordered list without re-sorting it.

Verify the suite before running​

Inspect the resolved order without executing browser missions:

testronaut list
testronaut --dry-run
testronaut --dry-run --json

list is useful for a readable check of discovered files and tags. A JSON dry run is convenient for CI validation or scripts.

Explicit command-line order​

When mission filenames are supplied directly, Testronaut runs them in the order given on the command line. missions.order applies only to automatic discovery.

testronaut \
login.mission.js \
checkout.mission.js \
logout.mission.js

Use explicit filenames for a one-off suite. Use missions.order when the same ordering should be the project default for local runs and CI.

Authentication and state​

Ordering controls sequence, but isolated mode still creates a new browser context for every mission file. If later missions need authentication from an earlier login, combine ordering with shared authentication:

testronaut --session=shared-auth

Wrap repeated login setup in launchProtocol() so later mission files can verify and reuse the authenticated state without spending additional model turns. See Reuse Browser Authentication Across Missions.

Keep missions independently verifiable where practical. Ordering is most useful for intentional suite-level dependencies and cleanupβ€”not as a substitute for clear prerequisites and success criteria.