Hi @mda, welcome to the forum
In those examples, notice that all scenarios specify an
exec option, which is the name of the function each scenario should execute. This is why the script doesn’t export a
default function, since no scenarios would use it. If the scenario doesn’t specify an
exec function, then the
default function will be executed and must be exported.
So this is a way to distinguish different workflows in your tests. One scenario could test the API login, another could be a functional test, etc., which would be more cumbersome to handle if all scenarios executed the same function. More than one scenario could also execute the same function, so this gives you a lot of flexibility with how to structure your tests.
is there no way to actually run multiple scenarios with a single “run” command?
Sure, all scenarios defined in your script will be run with a single
run command, that’s the whole purpose of the feature.
Hope this clears up the confusion. Let us know how we could improve the documentation to hopefully avoid this confusion for others, as we know scenarios are a complex feature. Or feel free to create a PR with your suggestions, the “Suggest edits” link on each page will take you to the source document.