Studio:Linking Test Plan with results

From STRIDE Wiki
Jump to navigation Jump to search

This article describes the standard method for adding a link to the test plan on a STRIDE report

Overview

Test Report Showing Standard Portal Links

When reviewing test output reports it's very helpful to have links from each test suite to its relevant test plan or test spec in the project portal wiki.

Standard practice dictates that these links be added to all customer test reports in the suites' Description field. Further, the report's top-level suite contains a link to the overall test plan, and each of its subsuites link to the suite's corresponding test spec (or other relevant section). (See screenshot at right.)

The method used to add these links varies between script-based and test unit-based test reports. In all cases, though, the description field link is indicated in the same way; special formatting indicates to the reporter that the string should be interpreted as a hyperlink.

Link Formatting

To have the reporter interpret your description string as a hyperlink, follow this pattern:

    [URL label]
  • The hyperlink information must be enclosed in square brackets
  • The URL may be any valid http or https url
  • The label is optional and will be used as the link text if present
  • The label is separated from the URL by one or more space characters
  • The label may contain spaces
  • Note that this formatting identical to that used by the wiki for external links


Script-Based Tests

Setting the Test Plan Link Using STRIDE Studio Properties
Setting a Test Spec Link Using STRIDE Studio Properties

These tests comprise one or more scripts that define an run tests and are designated in a STRIDE Studio Workspace (.ssw) file. These tests may be run from within STRIDE Studio or from a command line.

Setting Links From STRIDE Studio

The preferred method of adding links to script-based test suites is by setting each suite's Description property using the Properties window within STRIDE Studio. (Examples are shown at right).

Set the overall test plan link at the top-level test suite (this suite corresponds to the Script Files workspace node). Then for each subfolder that contains tests that produce reporter output, add a link to a test spec or other relevant document.

Example

Reporting Sample
Shows a complete implementation of this style of linking.

Setting Links From a Script

If is also possible to set suite Descriptions from your test scripts.

Examples

  • Linking Test Plan to Workspace Description
  
my $ScriptFiles = $main::studio->Workspace->Folders->Item('Script Files');
ScriptFiles->{Description} = '[http://my-portal.s2technologies.com Test Plan]';
  • Linking Test Spec to a Suite
  
$main::testSuite->{Description} = '[http://my-portal.s2technologies.com#relevant_section Test Spec]';

Test Unit-Based Tests

Test Unit-based tests create "virtual" suites where each test class creates a suite at runtime. Therefore, you must set the test suite Descriptions explicitly in your test unit code.

The most convenient place to add this code is in the test class' constructor. Assuming that szLINK_TO_TEST_SPEC evaluates to the intended description string, the code to add is as follows:

Examples

For classes that derive from srTest

class_constructor()
{
    ...

    // set suite description to link pointing to test spec
    testSuite.SetDescription(szLINK_TO_TEST_SPEC);

    ...
}

For classes that do not derive from srTest

class_constructor()
{
    ...
    // set suite description to link pointing to test spec
    srTestSuiteSetDescription(srTEST_SUITE_DEFAULT, szLINK_TO_TEST_SPEC);

    ...
}
Test Class Samples
show a complete implementation linking each test class with its description in the support wiki.