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. ExplicitJPostmanResponsemethods 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[]assertsOptional assertion rule sections to apply after response execution.StringdataOptional data group or data section to apply before request execution.String[]dependsOnDependency method names to run before this runner.booleanenabledRuns this runner even whenJPostmanContext.skipAll()is enabled.String[]excludeRequest names to exclude from this runner.StringexecutorString[]filterOptional response fields to keep before printing or verifying.String[]folderCollection folder path from the collection root to the target folder.StringidOptional annotation id used by dependsOn = "#id".String[]includeRequest names to include.booleanlifecycleEnables the new request/response runner lifecycle callback mode.StringlogLocal automatic JPostman failure output mode.StringnamespaceContext namespace to use.StringruleOptional secure rule section for response filtering and masking.booleanskipSkips this runner/test execution before dependencies or request execution run.booleansoftWhether to use soft assertion verification.String[]tagsLogical tags for this runner execution.intverifyExpected 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
-1usesJPostmanContext.verifyStatusCode(). Use0to 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,
-1to use the context default, or0to 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 isnone.error- print the failure message and include the trace.
- Returns:
- local automatic failure output mode
- Default:
- "debug"
-
-
-
lifecycle
boolean lifecycle
Enables the new request/response runner lifecycle callback mode.The default
falseinvokes blank-request@JPostmanRequestdependencies once for each selected collection request after that request is prepared, then invokes the runner method body after the response. Set this totrueto keep dependencies as one-time runner setup and enable the before-request/response lifecycle used byjpostman.runner().start(...),jpostman.runner().request(...), orjpostman.runner().response(...)and when the fluent runner chain should control the method body for the before/after phases.- Returns:
trueto 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, whiledata = "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 theassertionsconfig property. This selector only chooses sections from those already-loaded files. Java reserves the wordassert, so the annotation member is namedasserts.- Returns:
- assertion rule sections, or empty array to use request-name/default resolution
- Default:
- {}
-
-
-
enabled
boolean enabled
Runs this runner even whenJPostmanContext.skipAll()is enabled.- Returns:
trueto opt in while skipAll is active
- Default:
- false
-
-