Scripting for Issues

You can use the following scripting-features to control the issue-detection and -creation features of BiG EVAL.

Please note:

  • The following commands have only an effect when a testcase failes and when it creates a new issue. That means that the issue-creation must be activated first in the testcase-editor.
  • If an issue already exists, the testresult will only be appended to the issue. Title, description, responsible user and assigned user will not be changed. In this case, the commands have no effect.

Setting the Issue-Identifier

Every issue created in BiG EVAL is identified by a unique character-string. Usually the identifier corresponds with the ID of the failed testcase. But it could also be the ID of a erroneous record identified by a testcase. This allows to group testresults together.

Usually you setup this behavior in the testeditor. But you can also overwrite the behavior in the control-script of the testcase by setting up a userdefined character-string as the identifier.

Overwriting the identifier makes sense in the example of iterating through a list of records. For example a list of sales-territories. In this case you want an issue for each of them. So you can add the ID or name of the sales-territory to the identifier.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SetIssueIdentifier("example-identifier");
SetIssueIdentifier("example-identifier");
SetIssueIdentifier("example-identifier");

Setting the Title and Description

Use the following methods to set the title and the description of an issue that may get created when the testcase fails.

Setting the Title:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SetIssueTitle("My Title");
SetIssueTitle("My Title");
SetIssueTitle("My Title");

Setting the Description:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SetIssueDescription("This is my very long description...");
SetIssueDescription("This is my very long description...");
SetIssueDescription("This is my very long description...");

Setting responsible Person

Use the following methods to set the responsible person of an issue. You can either use the BiG EVAL ID, the Email-Address or the username of the person.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SetIssueOwnedBy("e0c67a85-e967-4a16-b88f-36419111f3d8");
SetIssueOwnedBy("e0c67a85-e967-4a16-b88f-36419111f3d8");
SetIssueOwnedBy("e0c67a85-e967-4a16-b88f-36419111f3d8");

or:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SetIssueOwnedBy("user@domain.com");
SetIssueOwnedBy("user@domain.com");
SetIssueOwnedBy("user@domain.com");

Assigning issue to a Person

Use the following methods to assign an issue to a specific person. You can either use the BiG EVAL ID, the Email-Address or the username of the person.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SetIssueAssignedTo("e0c67a85-e967-4a16-b88f-36419111f3d8");
SetIssueAssignedTo("e0c67a85-e967-4a16-b88f-36419111f3d8");
SetIssueAssignedTo("e0c67a85-e967-4a16-b88f-36419111f3d8");

or:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SetIssueAssignedTo("user@domain.com");
SetIssueAssignedTo("user@domain.com");
SetIssueAssignedTo("user@domain.com");

Full Example

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
// Query the available sales stores from the ERP.
var stores = QueryTable("AW ERP", "SELECT Name, ManagerEmail FROM Sales.Store");
// Loop through all the stores and execute the testcase for each of them.
foreach(DataRow storeRow in stores.Rows)
{
// Extract ID and Name of the current sales territory.
var storeName = storeRow["Name"].ToString();
var managerEmail = storeRow["ManagerEmail"].ToString();
// Write a comment to the test-result to show the current store.
SetComment($"Store: {storeName}");
// Configure the issue-tracking
SetIssueIdentifier($"{Test.TestId}-{storeName}");
SetIssueTitle($"Customer count test failed for store {storeName}");
SetIssueDescription("The test failed because customer-count couldn't be resolved correctly.");
SetIssueOwnedBy(managerEmail);
SetIssueAssignedTo(managerEmail);
// Set the name of the store as a parameter
SetParameter("StoreName", storeName);
// Execute the test.
await ExecuteAsync();
}
// Query the available sales stores from the ERP. var stores = QueryTable("AW ERP", "SELECT Name, ManagerEmail FROM Sales.Store"); // Loop through all the stores and execute the testcase for each of them. foreach(DataRow storeRow in stores.Rows) { // Extract ID and Name of the current sales territory. var storeName = storeRow["Name"].ToString(); var managerEmail = storeRow["ManagerEmail"].ToString(); // Write a comment to the test-result to show the current store. SetComment($"Store: {storeName}"); // Configure the issue-tracking SetIssueIdentifier($"{Test.TestId}-{storeName}"); SetIssueTitle($"Customer count test failed for store {storeName}"); SetIssueDescription("The test failed because customer-count couldn't be resolved correctly."); SetIssueOwnedBy(managerEmail); SetIssueAssignedTo(managerEmail); // Set the name of the store as a parameter SetParameter("StoreName", storeName); // Execute the test. await ExecuteAsync(); }
// Query the available sales stores from the ERP.
var stores = QueryTable("AW ERP", "SELECT Name, ManagerEmail FROM Sales.Store");

// Loop through all the stores and execute the testcase for each of them.
foreach(DataRow storeRow in stores.Rows)
{
    // Extract ID and Name of the current sales territory.
    var storeName = storeRow["Name"].ToString();
    var managerEmail = storeRow["ManagerEmail"].ToString();

    // Write a comment to the test-result to show the current store.
    SetComment($"Store: {storeName}");

    // Configure the issue-tracking
    SetIssueIdentifier($"{Test.TestId}-{storeName}");
    SetIssueTitle($"Customer count test failed for store {storeName}");
    SetIssueDescription("The test failed because customer-count couldn't be resolved correctly.");
    SetIssueOwnedBy(managerEmail);
    SetIssueAssignedTo(managerEmail);

    // Set the name of the store as a parameter
    SetParameter("StoreName", storeName);

    // Execute the test.
    await ExecuteAsync();
}
comment_count comments
Top rated
Newest
Oldest
Top rated

Comment as a guest:

Table of Contents