Skip to content

new

Terminal window
jk new -h
Create a new test
Usage: jk new [OPTIONS] [NAME]
Arguments:
[NAME] The name of the test file to be created
Options:
--from_openapi <from_openapi> OpenApi spec to derive tests from
-f, --full Generate a test template with all available options
-m, --multistage Generate a multi-stage test template
-o Output template to the console instead of saving to a file
-h, --help Print help

Description

Creates a new test file template with the given name at the current location.

You can also generate more complex templates, output the generated template to the console, and generate tests file from OpenAPI specifications via options.

Arguments

ArgumentDefaultDescription
nameThe name or path of the test file to be created. This value is required unless the -o option is specified. If a path is provided, any relevant directories must already exist.

Options

OptionValueDescription
‑‑from_openapiThe path to the source OpenAPI specificationGenerate test definitions from an OpenAPI specification. This will generate test templates for all specified path and HTTP method combinations. Generated files will be placed in a directory of the given name, with a hierarchical structure that corresponds to the paths in the specification file.
‑f
‑‑full
Generate a test template with all available fields.
‑h
‑‑help
Print command details, arguments, and options to the console.
‑m
‑‑multistage
Generate a multi-stage test template.
‑oEnable output of the generated template to the console instead of saving it to a file. (Note: this option has no effect when also specifying the --from_openapi option.)