MSbuild Tasks for Running Tests

Official Content

Running test cases in a batch mode is easy using MSBuild tasks. There are 2 specific tasks* used for this purpose: RunTests and RunTestsList.

* Note: Instead of using these tasks isolated, we recommend to start using the GXtest.msbuild file that should be present on your GeneXus installation root folder, and modify it at your own needs. You will see an example in the next article. 

1 - RunTests (MSBuild Task)

This task runs all the test cases (Unit, UI or both) in a specific Knowledge Base. 
The sequence/order of execution is alphabetically grouped by folders.

Parameters:
Type: {Unit, UI, All} 
Specifies the type of test to run:
Unit: Will run all Unit tests inside the KB.
UI:  Will run all UI tests inside the KB.
All:  Will run all Unit tests first and then all UI test that is inside the KB.


DetailedResults (optional): bool
A boolean parameter to set verbosity. 
If true, detailed results will be displayed on the console output.
If false, only a summary is shown.

Examples of use in an MSBuild file:

<RunTests Type="All" />
<RunTests Type="Unit" DetailedResults="true"/>
<RunTests Type="UI" />

2 - RunTestsList (MSBuild Task)

This task runs a list of test cases defined by you (in a JSON file). The sequence/order of execution will depend on the ordered written in that file. You can see JSON file examples below this section.

Parameters:
ExecutionDataFilePath: string
An absolute path to the JSON file containing test cases and options.

DetailedResults (optional): bool
A boolean parameter to set verbosity. 
If true, detailed results will be displayed on the console output.
If false, only a summary is shown.

Examples of use in a msbuild file:

<RunTestsList ExecutionDataFilePath="MyPath/ExecData.json" DetailedResults=”true”/>

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.