Conditional Step Execution
Ghost Inspector gives you the ability to add conditions to your step execution during a test run. You can use this feature to create branches of step execution within your test, for instance if you need your test to respond slightly differently in a different environment or you wish to import another test under a certain condition.
Adding a Step Condition
return to return a
false value. If the conditional logic returns
true then the step will execute. If the conditional logic returns
false then the step will be skipped.
Conditional Step Grouping
When two subsequent steps have conditional execution enabled and the condition statements are the same, then the steps will group under the same condition heading. This makes it simple to update the condition for multiple steps with the same condition at once. The simplest way to add a step within a current condition is to click Copy and then Paste Below or Paste Above on the existing conditional step.
To remove a condition from a step, simply click <i class="fa fa-code-fork"/ > Remove Condition.
Conditional Evaluation Results
After test execution, any conditional step results will indicate the execution of the step condition and the value of the results in the test result:
- Condition logic must
- Nested conditions are supported. Conditions used on “Import Steps from Test” steps will be combined with any conditions on the imported steps themselves. This means that steps can accumulate multiple conditions when conditions are being applied to multiple levels of imports. The conditions will be effectively AND'ed together. Each condition will be checked in order. The step will be executed only if all conditions return truthy values.