Configuring Hooks

Hooks can be configured via Hooks tab and can be configured in the same way as you configure any test case in vREST NG.

Few important points to note in configuring hooks:

  1. Type of hook
    • vREST provides 8 types of hooks and data sent to each type of hook is different.
    • The purpose of each type of hook and the information which is available to them is written in guide Hook Types.
  2. Hook Condition
    • A hook condition can be specified in the "Details" sub-tab of the individual hook.
    • Few Use Cases:
      • Suppose you want to execute post test case iteration hook for failed test cases, then provide !{{$tc.result.isPassed}} as a condition of the hook.
      • Suppose you want to execute post test run hook if there are some failed test cases, then provide {{$tr.result.failedCount}} > 0 as a condition of the hook.
  3. Viewing hook results
    • Hook results can be seen in the Test Cases tab.
    • Test Run and test suite specific hooks results
      • These are shown when you click on the Hook Results link available in the Running Status section as shown in the following snapshot.
      • When you click on the Hook Results link, a dialog window will appear showing the individual hook results.
    • Test Case specific hook results
      • These are shown in the "Hooks" sub-tab of the individual test case as shown in the following snapshot.