定义测试管理器的初始配置

使用 Microsoft 测试管理器的插件,可以定义项目的初始测试管理设置的团队。可以定义设置 (如测试变量和组合测试变量的配置。例如,可以定义硬件平台、操作系统、浏览器版本或用于测试或软件要使用的其他类型的硬件,然后可以定义组合这些变量的测试配置。此外,可以自定义默认测试设置,有效测试解决状态的列表。在创建团队项目后,可以修改每个通过 Microsoft 测试管理器 测试配置除测试解决状态。

测试管理插件文件随 Microsoft solutions framework 的过程模板提供。 (MSF)Microsoft 测试管理器 到最终的 Visual Studio 和 Visual Studio 专业测试工具版可用。有关更多信息,请参见 测试应用程序

说明说明

可以自定义的初始安全配置。通过将这些测试活动在 GroupsandPermissions.xml 插件文件。有关更多信息,请参见 配置初始组、团队、成员和权限

下表总结了文件、文件夹名称和插件 MSF 过程模板的。

文件名:

testmanagement.xml

文件夹名称:

测试管理

插件名称:

Microsoft.ProjectCreationWizard.TestManagement

说明说明

可以更改 XML 文件和文件夹的名称,但不能更改插件名称。Team Foundation Server 不包含客户端插件、策略,或其他修改的部署的框架。如果要部署插件、策略或其他修改,对 团队资源管理器,则必须使用您的分发和安装程序。

本主题

  • 测试管理任务和依赖项

  • 定义测试环境

  • 定义测试配置

  • 定义测试解决状态

  • 定义默认测试设置

测试管理任务和依赖项

在 testmanagement.xml 文件中,指定一个或多个任务以及它们的依赖项。插件文件指定四个任务和每个任务上载的测试管理文件。testconfiguration.xml 文件取决于 testvariable.xml 文件中指定的信息。有关 task的更多信息, taskXmldependency 元素,请参见 定义用于处理插件的任务在插件文件中定义任务组和任务的依赖项

以下代码表示为 MSF 过程模板定义的默认 testmanagement.xml 文件:

<?xml version="1.0" encoding="utf-8"?>
<tasks>
  <task id="TestVariable" name="Default test variables" plugin="Microsoft.ProjectCreationWizard.TestManagement" completionMessage="Default test variables created">
    <taskXml>
      <TestVariables fileName="Test Management\TestVariable.xml" />
    </taskXml>
  </task>
  <task id="TestConfiguration" name="Default test configurations" plugin="Microsoft.ProjectCreationWizard.TestManagement" completionMessage="Default test configurations created">
    <dependencies>
      <dependency taskId="TestVariable" />
    </dependencies>
    <taskXml>
      <TestConfigurations fileName="Test Management\TestConfiguration.xml" />
    </taskXml>
  </task>
  <task id="TestSettings" name="Default test settings" plugin="Microsoft.ProjectCreationWizard.TestManagement" completionMessage="Default test settings created">
    <taskXml>
      <TestSettings fileName="Test Management\TestSettings.xml" />
    </taskXml>
  </task>
  <task id="TestResolutionState" name="Default test resolution states" plugin="Microsoft.ProjectCreationWizard.TestManagement" completionMessage="Default test resolution states created">
    <taskXml>
      <TestResolutionStates fileName="Test Management\TestResolutionState.xml" />
    </taskXml>
  </task>
</tasks>

定义测试配置变量

使用 TestVariable ,并定义的 AllowedValue 元素测试配置变量。可以定义任意数量的测试配置变量及其有效值。下面的值是在 MSF 的 testvariable.xml 文件中定义过程模板:

  • 操作系统:

    • Windows Vista

    • Windows XP

  • 默认浏览器:

    • Internet Explorer 7.0

    • Internet Explorer 8.0

    • Firefox 3.0

在创建项目之后,可以修改这些变量并创建其他变量。有关更多信息,请参见 测试配置 - 指定测试平台

必须在其对应的容器元素中封装 TestVariable 元素: TestVariables。对这些元素使用以下语法结构:

<TestVariables>
   <TestVariable name="VariableName" name="Operating System" description="Description of VariableName">
        <AllowedValue value ="Name of Allowed Value"/>
    </TestVariable>
</TestVariables>

对 MSF 过程模板中定义的测试变量使用以下语法:

<?xml version="1.0" encoding="utf-8" ?>
<TestVariables>
    <TestVariable name="Operating System" description="Default operating systems">
        <AllowedValue value ="Vista" />
        <AllowedValue value ="XP" />
    </TestVariable>
    <TestVariable name="Browser" description="Default browsers">
        <AllowedValue value ="Internet Explorer 7.0" />
        <AllowedValue value ="Internet Explorer 8.0" />
        <AllowedValue value ="FireFox 3.0" />
    </TestVariable>
</TestVariables>

定义测试配置

使用 TestConfiguration ,并定义的 TestVariable 元素可将一个或多个测试配置变量的配置。默认配置是在 MSF 的 testconfiguration.xml 文件中定义过程模板: Windows Vista 和 Internet Explorer 7.0。在创建项目之后,可以删除这些配置并创建其他配置。有关更多信息,请参见 如何:创建测试配置

必须将元素封装在其对应的容器元素内 TestConfiguration 元素: TestConfigurations。对这些元素使用以下语法结构:

<TestConfigurations>
    <TestConfiguration name="Test Configuration Name" description=" Test Configuration Description " state="active" isdefault="true | false">
        <TestVariable name="VariableName" value="Variable Value" />
        <TestVariable name="VariableName" value="Variable Value" />
    </TestConfiguration>
</TestConfigurations>

下表描述 TestConfiguration 元素的属性。

特性

说明

状态

将测试配置标识为活动或非活动。

isdefault

将测试配置标识为默认配置。

对 MSF 过程模板中定义的测试配置使用以下语法。

<?xml version="1.0" encoding="utf-8" ?>
<TestConfigurations>
   <TestConfiguration name="Vista and IE 7" description="Default operating system and browser for testing" state="active" isdefault="true">
        <TestVariable name="Operating System" value="Vista" />
        <TestVariable name="Browser" value="Internet Explorer 7.0" />
   </TestConfiguration>
</TestConfigurations>

定义测试解决状态

使用 TestResolutionState 元素指定测试失败的原因。下面的状态是在 MSF 的 testresolutionstate.xml 文件中定义过程模板:需要调查,测试问题,产品问题,并且,配置问题。

说明说明

,在创建团队项目之后,不能更改或添加状态。

必须将元素封装在其对应的容器元素内 TestResolutionState 元素: TestResolutionStates

对这些元素使用以下语法结构:

<TestResolutionStates>
    <TestResolutionState name="ResolutionName" />
</TestResolutionStates>

对 MSF 过程模板中定义的解决状态使用以下语法。

<?xml version="1.0" encoding="utf-8" ?>
<TestResolutionStates>
    <TestResolutionState name="Needs investigation" />
    <TestResolutionState name="Test issue" />
    <TestResolutionState name="Product issue" />
    <TestResolutionState name="Configuration issue" />
</TestResolutionStates>

定义默认测试本地的测试设置运行

使用 TestSetting 元素指定文件的名称使用运行测试时以下文件是在 MSF 过程模板中的 testsettings.xml 中定义:localrun.testsettings.有关更多信息,请参见 设置测试计算机以运行测试或收集数据

必须将元素封装在其对应的容器元素内 TestSetting 元素: TestSettings。对这些元素使用以下语法结构:

<TestSettings>
    <TestSetting name="Name of Test Setting " filename="FileName" />
</TestSettings>

对 MSF 过程模板中定义的 testsettings.xml 文件使用以下语法。

<?xml version="1.0" encoding="utf-8" ?>
<TestSettings>
    <TestSetting name="Local Test Run" filename="localrun.testsettings" />
</TestSettings>

请参见

概念

测试应用程序

在过程模板中自定义功能区域