## Cycle-CLI (Command Line Interface) execution

Cycle allows the ability to run a Feature File or Playlist from the command line. Combining this functionality with a Continuous Integration or Continuous Testing process allows for the execution of tests at a preset or recurring time.

To execute Cycle from the command line:

1. At the command prompt, navigate to the directory where the cycle-cli.exe file is located (typically C:\Program Files (x86)\TryonSolutions\Cycle).

2. Run cycle-cli followed by any optional parameters, with the last parameter being the name of the Feature File or Playlist to be executed.

Example 1: cycle-cli --output-directory C:\Cycle\Output --project-file MyProject.cycproj webtest.feature

Example 2: cycle-cli --project-file MyProject.cycproj terminal.feature web.feature sql.feature This would run each of the three features sequentially.

Note: If your Feature includes steps that prompt the user, these steps will be skipped.

## Required parameters

Parameter Description Example
Feature or Playlist Path to Feature File or Playlist C:\path\to\feature\feature_name.feature or C:\path\to\playlist\playlist_name.cycplay

## Optional parameters

Parameter Description Example
--echo-settings Echo the current settings to the console and exit C:\Program Files (x86)\TryonSolutions\Cycle>cycle-cli --echo-settings
--error-handling [arg] Error Handling Strategy (examples below) C:\Program Files (x86)\TryonSolutions\Cycle>cycle-cli --error-handling ALL_TESTS [files to run]
--log-level [arg] Logging level cycle-cli --log-level verbose [files to run]
--no-tick Turn off time-elapsed update for steps cycle-cli --no-tick
--output-directory [arg] Report output directory cycle-cli --output-directory C:\Cycle\Output [files to run]
--project-file [arg] Project file cycle-cli --project-file C:\Cycle\MyProject.cycproj [files to run]
--settings-file [arg] Settings file location to override settings used in Cycle client cycle-cli --settings-file C:\Cycle\settingsoverride.json
--tags [arg] Tags to be executed cycle-cli --tags picking [files to run]
--user [arg] User profile to use during test execution. If not provided, Cycle will use a default if possible. cycle-cli --user me@company.com
--help Show help message cycle-cli --help
--version Show Cycle version cycle-cli --version

Note: If your account is going to be used to schedule a job using Cycle-CLI, a Personal Access Token(PAC) is required. A PAC can be obtained under the account page in the User Portal. You can view your Personal Access Token by clicking the Generate' button.

## Error Handling Strategies

#### Features:

FEATURE = End Feature Execution

SCENARIO = Skip to next Scenario

Example: Cycle>cycle-cli --error-handling FEATURE palletpick.feature

#### Playlists:

NONE = Skip to next Scenario

SINGLE_TEST = Skip to next feature

ALL_TESTS = End Playlist Execution

Example: Cycle>cycle-cli --error-handling SINGLE_TEST listpick.cycplay

#### Group Tests:

NONE = Stop Failed Terminal

SINGLE_TEST = Stop Failed Group

ALL_TESTS = End Group Test Execution

Example: Cycle>cycle-cli --error-handling ALL_TESTS volumetest.cvt

## Project File Parameter

This can be either the Project directory or the .cycproj file.

For example, a user has a Project in c:\users\MyUser\myproj... either c:\users\MyUser\myproj or c:\users\MyUser\myproj\myproj.cycproj would be acceptable arguments to follow the --Project-file parameter. This can be an absolute path or relative path. If this argument is not used, Cycle-CLI will look for a .cycproj file the current directory. So in command line, if the user cd's to MyUser\myproj, they would not have to use the --project-file argument.

## Cycle-CLI results

When Cycle-CLI executes, the Step results are output to the command line. Steps that pass are output with a Pass and the number of ms they took to complete. Steps that failed are output with [Fail]. Cycle-CLI completes with the line Feature: Feature Name [Fail]/[Pass] - {number} ms.

Any of the reporting formats available to the main Cycle client can be generated if the respective settings are applied.

## Replicating Settings

In many cases, Cycle-CLI is run on a different computer than Cycle itself. It is important for teams to carefully control what settings are in use when running Cycle-CLI. It is possible to replicate the needed settings by specifying a Project file for your Cycle-CLI execution. All of the pertinent execution settings will be included in the .cycproj file.

In addition to this, if there are a few specific settings that need to be overridden for a CycleCLI execution. They can be saved as "key":value pairs in valid json objects and loaded in for a given execution using the --settings-file parameter.