Creating steps

A package step represents the most important part of a package. It has a name which should be unique and depending on the step’s type, the user can configure specific information.

Steps are executed in the order defined on package level and it can be configured to stop execution in case any of the steps exists with a code different than 0.

The user can also disable a step or reorder the steps. In the step definition form, the user can use a series of parameters called environment and system parameters. The environment parameters can be edited by going to the Settings forms and adding values to the form located on the bottom. For more details please check the Transforming parameters section. 

Supported step types

  1. Command
  2. Script
  3. Nunit 2.X
  4. Nunit 3.X
  5. Visual test console 2015 or 2017
  6. Text replacer

A short demonstration that creates a package with a Nunit 2.x step

1. Command

A command type has a file and parameter properties. The file can be any executable, Bat, or type that the operating system is able to execute.

The parameters field is a string and it will be provided to the executed command file.

The path of the file must be relative to the root of the package folder. The easiest way is to click the “Pick” button because it will generate automatically the folder alias and the relative path. Any system or environment parameters are supported in the file or parameter fields.

The following video shows how to add a step of command type to a package. The step will execute an example.bat file which receives as input a parameter and performs an echo with it. In this case, the params sent to the BAT file it’s an environment parameter defined in Korredo and transformed based on the configuration available on agent level.

 

2. Script

A script step has only a text field where the user can enter any windows bash command. Any %system% or %env%, but without %system.TestList% or %system.TestListSeparatedByComma% (these params can be used only in a Nunit/VS Test step type)

The following video shows how to add a custom script which echoes system and env parameters:

3. Nunit 2.X

Using this type you can run tests from assemblies that use Nunit 2.X. Note: The Nunit 2.X runner is part of the Korredo installation in the Runners folder.

A dedicated nunit add-in exists and Korredo will receive information about running tests in real-time, even the test suite is not finished yet.

It is required to select one of the assemblies shown in the Assembly dropdown and click the “Use it” button. The NUnit parameters are automatically generated and it is recommended to not modify them.

Any %env% or %system% can be used in the parameter field.

4. Nunit 3.X

Using this type you can run tests from assemblies that use Nunit 3.X (up to 3.8.1).

Note: The Nunit 3.X runner is part of the Korredo installation in the Runners folder.

A dedicated nunit addin exists and Korredo will receive information about running tests in real-time, even the test suite is not finished yet.

It is required to select one of the assemblies shown in the Assembly dropdown and click the “Use it” button. The NUnit parameters are automatically generated and it is recommended to not modify them.

Any %env% or %system% can be used in the parameter field.

4. Visual Test Console

This type of runner can be used when your assemblies contain tests written with MS Test 2015 or 2017.

It is required to select one of the assemblies shown in the Assembly dropdown and click the “Use it” button. The VS Test Console parameters are automatically generated and it is recommended to not modify them.

Any %env% or %system% can be used in the parameter field.

Important: In order to use this type of runner, you must install the VS Test console plugin, from the Settings form. This plugin will show the test execution results in real time.

5.Text Replacer

This type of runner is useful for config file manipulations. For example, in general, is required to change a connection string before running tests. With this text replace runner type you can specify a pattern and a text for replacement.

The path of the file must be relative to the root of the package folder. The easiest way is to click the “Pick” button because it will generate automatically the folder alias and the relative path. Any %system% or %env% parameters are supported in the File field (except system.TestsFileList and TestsListSeparatedByComma)

In the image below, it is configured to replace the key dummy with the value of the %env.disk% parameter configured on the agent side. Also, a regex is used to replace all texts for value attribute with 1000

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.