Studio:Linking Test Plan with results

From STRIDE Wiki
Revision as of 19:40, 8 December 2008 by Timd (talk | contribs)
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

It's very helpful to provide a link with each suite to the relevant test plan section.

Top-level suite links to the overall test plan, and subsuites link to relevant sections.

The method used depends on the type of testing done.

Set the relevant suite's Description field value to the URL of the linked document.

Script-Based Tests

Here, we assume that script-based tests will be run as part of a workspace whether within STRIDE Studio or from the command line.

For script-based tests, the preferred method of adding links is by setting each suite's Description property from the Properties window within STRIDE Studio. This has the benefit ***.

Set the testplan link at the top-level test suite (Script Files) and then set a link for each subfolder that contains tests that produce reporter output.

The suite description field recognizes special formatting that indicates a hyperlink. Link formatting is just like wiki:

[URL label]

Enclose URL in square brackets to indicate a link, provide optional label separated by a space within the brackets.

Put the link in each suite's Description field within the properties window.

frame
frame


Setting Links From a Script

  • 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

For Test Unit-based tests, you must set the test suite description 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:

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);

    ...
}

Example

The source code included in the Test Class Sample implements linking of each test class with its description in the support wiki.