Test Run Properties

These properties are available as global variables. Here is the list of variable names:

  • g_spiraTestSetId
  • g_spiraTestCaseId
  • g_spiraReleaseId
  • g_spiraTestRunId
  • g_spiraProjectId
  • g_spiraAutomationHostId

Test Set Custom Properties

Values of custom test set properties are passed via JSON file. The name of the JSON file is stored in g_spiraTestSetCustomProperties global variable. Contents of the JSON file looks like this:

[
  {
    "PropertyNumber": 1,
    "StringValue": "BRMF",
    "IntegerValue": 31,
    "BooleanValue": null,
    "DateTimeValue": null,
    "DecimalValue": null,
    "IntegerListValue": null,
    "ListValuesWithLookups": null,
    "Definition": {
      "CustomPropertyId": 36,
      "ProjectId": 40,
      "ArtifactTypeId": 8,
      "Name": "Company",
      "CustomPropertyFieldName": "Custom_01",
      "CustomPropertyTypeId": 6,
      "CustomPropertyTypeName": "List",
      "IsDeleted": false,
      "PropertyNumber": 1,
      "SystemDataType": "System.Int32"
    }
  },
  {
    "PropertyNumber": 2,
    "StringValue": null,
    "IntegerValue": 7,
    "BooleanValue": null,
    "DateTimeValue": null,
    "DecimalValue": null,
    "IntegerListValue": null,
    "ListValuesWithLookups": null,
    "Definition": {
      "CustomPropertyId": 37,
      "ProjectId": 40,
      "ArtifactTypeId": 8,
      "Name": "MaxValue",
      "CustomPropertyFieldName": "Custom_02",
      "CustomPropertyTypeId": 2,
      "CustomPropertyTypeName": "Integer",
      "IsDeleted": false,
      "PropertyNumber": 2,
      "SystemDataType": "System.Int32"
    }
  }
]

To get the value of a property you may use the following function (feel free to modify it if needed):

function GetCustomProperty(/**string*/ name, /**string*/ defaultValue)
{
    if (g_spiraTestSetCustomProperties)
    {
        var propsJson = File.Read(g_spiraTestSetCustomProperties);
        var customProps = JSON.parse(propsJson);
        for(var i = 0; i < customProps.length; i++)
        {
            var prop = customProps[i];
            var propName = prop.Definition.Name;
            if (propName == name)
            {
                if (prop.StringValue != null)
                {
                    return prop.StringValue;
                }
                else if (prop.DateTimeValue != null)
                {
                    return prop.DateTimeValue;
                }
                else if (prop.DecimalValue != null)
                {
                    return prop.DecimalValue;
                }
                else if (prop.BooleanValue != null)
                {
                    return prop.BooleanValue;
                }
                else if (prop.IntegerValue != null)
                {
                    return prop.IntegerValue;
                }
            }
        }
    }
    return defaultValue;
}

Test Case Parameters

Test Case parameters are available via names of the parameters you defined. These parameters are available in older versions of Rapise too and described in the docs.

https://rapisedoc.inflectra.com/Guide/spiratest_integration/#using-parameterized-test-cases