@testiny/cli

1.12.0 • Public • Published

Testiny CLI

Use the Testiny CLI to import test cases and test runs into your Testiny Organization.

  • Test cases can be imported from CSV files (see example below)
  • Test runs can be imported from CSV, JUnit and Playwright JSON

Quick Start

  • Create an API key with write permissions on the project you want to import to
  • Set the API key as the TESTINY_API_KEY environment variable or pass with --apikey
  • Running just testiny-importer testcase or testiny-importer testrun command prompts for required options

General Options

Usage: testiny-importer [options] [command]

Options:
  --app <url>                    App endpoint to use (default: "https://app.testiny.io/")
  -P, --project <nameOrKey>      Target project id or key
  -y, --confirm                  Do not prompt for confirmation before starting import
  --disable-custom-fields        Disable custom field import. Will fail if required custom fields
                                 with no defaults are enabled
  --disable-tc-keys              Disable test case import key hints
  --disable-nested-folders       Disable nesting of imported folders (flat mode)
  --folder-separator <token>     Token for folder name separation (default ' > ')
  --duplicates <duplicate mode>  Controls how duplicates are detected (choices: "off", "title",
                                 "folder_title", default: "folder_title")
  --licenses                     Show included package licenses
  --apikey <apiKey>              The API key to use. Not recommended - use the environment variable
                                 TESTINY_API_KEY or TESTINY_IMPORT_API_KEY instead
  -h, --help                     display help for command

Commands:
  testcase [options]             Import testcases (with folders)
  testrun [options]              Import test case results as a testrun
  help [command]                 display help for command

Importing Test Cases

Usage: testiny-importer testcase [options]

Import testcases (with folders)

Options:
  --csv <file>               Import this CSV file
  --csv-encoding <encoding>  CSV file encoding (default: "utf8")
  --steps <step mode>        Controls how steps are imported (choices: "off", "rows", "newlines", "numbered", "numbered_bracket")
  -h, --help                 display help for command

Importing Test Runs

Usage: testiny-importer testrun [options]

Import test case results as a testrun

Options:
  --csv <file>               Import this CSV file
  --csv-encoding <encoding>  CSV file encoding (default: "utf8")
  --junit <file>             Import this JUnit XML file
  --playwright <file>        Import this Playwright JSON file
  --name <test run name>     Name of the test run (use %date, %host and %source as placeholders)
  --update                   Allow run with given name to be updated, otherwise creates a new run with that name (default: false)
  --close                    Close the testrun after a successful import (default: false)
  --folder <folder name>     Override folder name for all created testcases
  --testplan <nameOrKey>     Target testplan id or title
  --testcases <tc mode>      Controls how testcases are created if no existing TC is found (choices: "ignore", "fail", "create",
                             default: "create")
  -h, --help                 display help for command

Example Files

CSV Example for importing test cases

folder,title,precondition,steps,expected_result
"Folder Name", "Test case title", "Precondition text, can be empty", "Steps text (depends on step mode setting)", "Expected result, can be empty"
"Folder Name > Subfolder Name", "Another test case title", "", "Folders can be nested by using the folder separator token", ""

Bundled licenses

For licenses of bundled dependencies, please see LICENSE.txt in the package directory

Package Sidebar

Install

npm i @testiny/cli

Weekly Downloads

786

Version

1.12.0

License

none

Unpacked Size

2.26 MB

Total Files

5

Last publish

Collaborators

  • testiny