Annotation Type JPostmanRunner


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface JPostmanRunner
    Executes multiple Postman requests from a collection folder before a test method runs.

    This annotation behaves like JPostmanResponse, but the request names are discovered from the selected Postman folder instead of being declared one by one. Explicit JPostmanResponse methods for the same namespace, folder, and request name are skipped by the runner.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] asserts
      Optional assertion rule sections to apply after response execution.
      String data
      Optional data group or data section to apply before request execution.
      String[] dependsOn
      Dependency method names to run before this runner.
      boolean enabled
      Runs this runner even when JPostmanContext.skipAll() is enabled.
      String[] exclude
      Request names to exclude from this runner.
      String executor  
      String[] filter
      Optional response fields to keep before printing or verifying.
      String[] folder
      Collection folder path from the collection root to the target folder.
      String id
      Optional annotation id used by dependsOn = "#id".
      String[] include
      Request names to include.
      boolean lifecycle
      Enables the new request/response runner lifecycle callback mode.
      String log
      Local automatic JPostman failure output mode.
      String namespace
      Context namespace to use.
      String rule
      Optional secure rule section for response filtering and masking.
      boolean skip
      Skips this runner/test execution before dependencies or request execution run.
      boolean soft
      Whether to use soft assertion verification.
      String[] tags
      Logical tags for this runner execution.
      int verify
      Expected HTTP status code for each executed request.
    • Element Detail

      • id

        String id
        Optional annotation id used by dependsOn = "#id".
        Returns:
        annotation id
        Default:
        ""
      • tags

        String[] tags
        Logical tags for this runner execution.
        Returns:
        runner tags, or empty array when not defined
        Default:
        {}
      • namespace

        String namespace
        Context namespace to use. Empty means the default context.
        Returns:
        context namespace
        Default:
        ""
      • folder

        String[] folder
        Collection folder path from the collection root to the target folder.

        Each value represents one folder level. An empty value selects requests from the collection root.

         folder = "Products"
         folder = { "level1", "level2", "level3" }
         
        Returns:
        folder path levels from parent to child
        Default:
        {""}
      • rule

        String rule
        Optional secure rule section for response filtering and masking.
        Returns:
        secure rule section
        Default:
        ""
      • filter

        String[] filter
        Optional response fields to keep before printing or verifying.
        Returns:
        response fields to keep
        Default:
        {}
      • dependsOn

        String[] dependsOn
        Dependency method names to run before this runner.

        For runner launcher methods, a single runner dependency such as dependsOn = "#testRunner" can reuse the referenced runner body with this annotation's tags when this runner does not define its own folder, include/exclude, executor, rule, filter, data, asserts, verify, soft, or lifecycle settings.

        Returns:
        dependency method names
        Default:
        {}
      • include

        String[] include
        Request names to include. Empty means include all discovered requests.
        Returns:
        request names to include
        Default:
        {}
      • exclude

        String[] exclude
        Request names to exclude from this runner.
        Returns:
        request names to exclude
        Default:
        {}
      • verify

        int verify
        Expected HTTP status code for each executed request.

        The default value -1 uses JPostmanContext.verifyStatusCode(). Use 0 to explicitly skip status-code verification for this runner, even when the context has a default expected status code. Set a concrete value when each runner request should be verified by the annotation runtime.

        Returns:
        expected HTTP status code, -1 to use the context default, or 0 to skip status-code verification for this runner
        Default:
        -1
      • executor

        String executor
        Returns:
        executor id
        Default:
        ""
      • log

        String log
        Local automatic JPostman failure output mode. Values are single-choice; use one value only.
        • none - print only the minimum failure message and the first useful user-code stack frame.
        • debug - print the configured debug output and use minimum failure output when debug is none.
        • error - print the failure message and include the trace.
        Returns:
        local automatic failure output mode
        Default:
        "debug"
      • soft

        boolean soft
        Whether to use soft assertion verification.
        Returns:
        true to use soft assertions
        Default:
        false
      • lifecycle

        boolean lifecycle
        Enables the new request/response runner lifecycle callback mode.

        The default false invokes blank-request @JPostmanRequest dependencies once for each selected collection request after that request is prepared, then invokes the runner method body after the response. Set this to true to keep dependencies as one-time runner setup and enable the before-request/response lifecycle used by jpostman.runner().start(...), jpostman.runner().request(...), or jpostman.runner().response(...) and when the fluent runner chain should control the method body for the before/after phases.

        Returns:
        true to enable before-request and response lifecycle callbacks
        Default:
        false
      • data

        String data
        Optional data group or data section to apply before request execution.

        Use this for request data loaded by JPostmanContext.dataload(). For example, data = "product" applies the product data group, while data = "product.mouse" applies an exact data section.

        Returns:
        data group or section name, or empty string when no data should be applied
        Default:
        ""
      • asserts

        String[] asserts
        Optional assertion rule sections to apply after response execution.

        Assertion files are loaded by JPostmanContext.assertions() or the assertions config property. This selector only chooses sections from those already-loaded files. Java reserves the word assert, so the annotation member is named asserts.

        Returns:
        assertion rule sections, or empty array to use request-name/default resolution
        Default:
        {}
      • enabled

        boolean enabled
        Runs this runner even when JPostmanContext.skipAll() is enabled.
        Returns:
        true to opt in while skipAll is active
        Default:
        false
      • skip

        boolean skip
        Skips this runner/test execution before dependencies or request execution run.
        Returns:
        true to skip this runner/test execution
        Default:
        false