2.0.5 • Published 1 year ago

railflow-zephyr v2.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Railflow Zephyr

Railflow for Zephyr's Command Line Interface (CLI) is wrapper around the Zephyr REST API and allows users to process a variety of testing framework reports from any CICD system and automatically export them to Zephyr. The CLI provides a host of options so that you can display test reports per your needs.

Requirements

  1. NodeJS - v14.17.0 or higher.

Installation

CLI is a NPM based utility. Installing CLI is as simple as installing any other npm package.

$ npm install railflow-zephyr

Licensing

Railflow for Zephyr is a commercial product and requires license to run. You can get a free 14-day evaluation license by contacting Railflow support.

Command Reference

Note: Use double quotes for argument values with spaces. Example: --project "demo project"

Note: CLI will automatically create test cases, cycles, executions, etc. if they do not exist.

KeyDescriptionExample
-v, --versionPrints CLI version-v
-k, --key(either-k or -l is required) License key for online activationCan be set with RAILFLOW_ZEPHYR_LICENSE environment variable-k XXXXX-XXXXX-XXXXX-XXXXX
-l, --license-file(either-k or -l is required) License file path or remote URL file for offline activation-l ./license.skm
-t, --access-token(required) Zephyr Scale Access Token. Can be set withZEPHYR_SCALE_ACCESS_TOKEN environment variable-t XXXXXXxxxXXXXXXXXXXxXXX
-p, --project(required) The key of the corresponding Atlassian Jira project for which Zephyr Scale integration is enabled-p ZT
-f, --format(required) Report format: JUnit, TestNg, TestNg-Steps, Cucumber (case insensitive)-f JUnit
-r, --report-files(required) The file path(s) to the test report file(s) generated during the build. User can pass multiple values separated with spaces.Ant-style patterns such as **/surefire-reports/*.xml can be used. E.g. use target/surefire-reports/*.xml to capture all XML files in target/surefire-reports directory.-r target/surefire-reports/*.xml target/failsafe-reports/*.xml
-sm, --search-mode(required) Specifies the test case lookup algorithm.name - search for test case matching the name within the entire Zephyr Scale. If test case found, update the test case. If test case not found, create a new test case within specified --case-pathpath - search for test case matching the name within the specified --case-path. If test case found, update the test case. If test case not found, create a new test case within specified --case-path-sm path
-cp, --case-path(optional) Path in Zephyr Scale where test cases should be exported into-cp "Folder One/Folder Two"
-cyp, --cycle-path(optional) Path in Zephyr Scale where test cycle should be exported into-cyp "Folder One/Folder Two"
-cn, --cycle-name(optional) Test cycle name in Zephyr Scale-cn "My TestCycle"
-cyf, --cycle-fields(optional) Values for test cycle custom fields in Zephyr Scale. The format is"[Field label]=[value]" "[Field label 2]=[value]"-cyf "Cycle Field 1=value 1" "Cycle Field 2=value 2"
-cf, --case-fields(optional) Values for test case custom fields in Zephyr Scale. The format is"[Field label]=[value]" "[Field label 2]=[value]"-cf Case Field 1=value 1" "Case Field 2=value 2"
-ef, --execution-fields(optional) Values for test execution custom fields in Zephyr Scale. The format is"[Field label]=[value]" "[Field label 2]=[value]"-ef "Execution Field 1=value 1" "Execution Field 2=value 2"
-sf, --step-fields(optional) Values for test step custom fields in Zephyr Scale. The format is"[Field label]=[value]" "[Field label 2]=[value]"-sf "Step Field 1=value 1" "Step Field 2=value 2"
-e, --environment(optional) The name of an environment in Zephyr Scale-e "Linux"
-ls, --labels(optional) Zephyr Scale labels, separated with space. E.g.\"Label1\" \"Label2\" ..."-ls "Label1" "Label2"
-cpr, --case-priority(optional) The name of a priority to be set for test cases-cpr High
-um, --upload-mode(optional) Upload mode: 0 (default) - create new test cases and do not overwrite existing ones;1 - create new cases and overwrite existing ones;2 - do not create new cases and overwrite existing ones;3 - do not create new cases and do not overwrite existing ones.-um 1
-cc, --close-test-cycle(optional) If Zephyr Scale should set the corresponding test cycle status to 'Done' after uploading test results-cc
-dg, --disable-grouping(optional) If Railflow Zephyr should ignore report structure and just upload all tests into a folder which is set by--case-path parameter-dg
-a, --assign(optional) Smart Test Failure Assignment. Comma-separated list of Jira user email IDs. CLI will assign failures to those users based on a round robin algorithm-a "user1@railflow.io,user2@railflow.io"
-af, --assign-file(optional) Smart Test Failure Assignment. Path to a file containing list of Jira user email IDs. Note: One user email ID per line-af ./assignees.txt
-jurl, --jira-url(required if -a or -af is set) Jira URL for Smart Test Failure Assignment feature-jurl https://your-domain.atlassian.net
-ju, --jira-user(required if -a or -af is set) Jira user email ID for Smart Test Failure Assignment feature - it is used for fetching user IDs for email ID provided by -a or -af flags. The user must have the "Browse users and groups" Atlassian Jira global permission-ju user@railflow.io
-jt, --jira-token(required if -a or -af is set) Jira API token (password is not allowed) for Smart Test Failure Assignment feature-jt xxxxxxxxxxxxxx
-ds, --disable-stats(optional) Disable collecting usage and error logs-ds
-px, --proxy(optional) HTTP(S) or SOCKS proxy configuration-px socks://username:password@127.0.0.1:1080
-ti, --timeout(optional) Upload timeout (seconds)-ti 60
npx railflow-zephyr -k XXXXX-XXXXX-XXXXX-XXXXX -t xxxxxxxxxxxxxxxxxx -p JT -f junit -r "./target/surefire-reports/*.xml" -sm path

Using Environment Variables

Sometimes it is not secure or not convenient to pass sensitive data directly in the CLI invocation script (e.g. in CICD environments), so Railflow exposes several environment variables which users can use instead of passing corresponding arguments directly.

If --key or --access-token arguments are not provided, Railflow will use the values from the corresponding environment variables: RAILFLOW_ZEPHYR_LICENSE or ZEPHYR_SCALE_ACCESS_TOKEN respectively.

Updating custom fields in Zephyr Scale

Zephyr Scale allows users to create custom fields for different objects and with variety of types, e.g. String, number, decimal, date, etc... In order to set values to such fields properly, Railflow provides the following functions:

TypeExample
Stringsome value
Integerzephyr.int(42)
Floatzephyr.float(3.14)
Booleanzephyr.bool(true)
Arrayzephyr.array(zephyr.int(42), zephyr.int(24))
DateUseYYYY-MM-DD format, e.g. 2021-11-24

CLI Examples

Export using license key

npx railflow-zephyr -k ABCDE-12345-FGHIJ-67890 -t xyzyxzfdfldsfDFdf -p JT -f junit -r target/surefire-reports/*.xml -sm path -cp "Folder One/Folder Two" -cyp "Cycle Folder One/Cycle Folder Two" -cn "Railflow Zephyr Demo" -a "user1@railflow.io,user2@railflow.io" -jurl https://mydomain.atlassian.net -ju user1@railflow.io -jt myToken

Export using license file

npx railflow-zephyr -l /home/user/ActivationFile20201020.skm -t xyzyxzfdfldsfDFdf -p JT -f junit -r target/surefire-reports/*.xml -sm path -cp "Folder One/Folder Two" -cyp "Cycle Folder One/Cycle Folder Two" -cn "Railflow Zephyr Demo" -a "user1@railflow.io,user2@railflow.io" -jurl https://mydomain.atlassian.net -ju user1@railflow.io -jt myToken

Viewing Results in Zephyr

Automatic Test Creation

Zephyr Results

Zephyr Results

Automatic Test Cycle Creation

Zephyr Results

Test Results Details

Zephyr Results