onFlowStart / onFlowComplete hooks
Last updated
Was this helpful?
Last updated
Was this helpful?
If some logic needs to be executed before the start or after the completion of maestro flow onStart and onComplete hooks can be used. The hooks are a part of .
Basic usage of an API could look like that:
In case of either onFlowStart / onFlowComplete failure the behavior of maestro is consistent with JUnit (@before / @after) and XCTest (setup / teardown) hooks.
when before onFlowStart hook fails, does that fail the whole flow?
flow marked 🔴
when onFlowStart hook fails, does that skip the main body of the flow execution?
flow execution skipped
when onFlowStart hook fails, does the onFlowComplete hook still run?
onFlowComplete hook is still called
when the onFlowComplete hook fails, does the flow fail?
flow marked 🔴
If either onFlowStart
or onFlowComplete
hooks are implemented within a , their commands will execute as expected. However, note that the execution start and end times will correspond to the subflow's duration, not the main flow's.