How to: Create and Manage Test Suites
You can create test suites in your test plan by selecting the test cases that you want to add to a test suite from a list of all the test cases in your team project. You can also add new test cases as necessary.
By grouping your test cases, when you want to run all these tests, you can select this test suite. For more information about how to run the tests in your suite, see Running Tests.
The test suites in your test plan are added and managed as part of a hierarchy that includes a root node. The root node test suite has the same name as the test plan. It contains all other test suites. Test suites that are not query-based or created from a requirement can contain other test suites in addition to test cases. The following illustration shows the test suite hierarchy.
Poznámka
Query-based test suites or suites created from a requirement cannot contain any other test suites.
You can use the following procedures to add and manage test suites in a test plan:
Add a test suite and test cases to a test plan
Remove a test case from a test suite
Move a test suite
Rename a test suite
Delete a test suite
Create a copy of a test suite
Add a test suite and test cases to a test plan
To add a test suite and test cases to a test plan
Open Microsoft Test Manager.
Poznámka
To display the Microsoft Test Manager window, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Test Manager 2010.
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
Select the location in the test suite hierarchy pane where you want to create this test suite and then click New in the pane that shows the test suite hierarchy.
Poznámka
The test suite hierarchy has a root node that has the same name as the test plan. You can add test cases or test suites to this test suite root node, but you cannot rename it.
Type the name for your new test suite.
The name will also be displayed in the test suite details pane.
(Optional) Click State and select from the list of states based on the following table:
State
When to use it
In Planning
If you are not yet ready to run the tests in this test suite.
In Progress
When you are ready to run the tests in this test suite.
Completed
When you have finished running the tests in this test suite and the quality level reached meets your goals.
Důležité
To run tests, you must set the status of a test suite to In Progress.
To change the default configurations for the test suite you created, if you want them to differ from the default settings for the plan, click the drop-down arrow at the end of the list of configurations.
The dialog box is displayed that shows all the configurations for your team project and the current default configurations for your test plan.
You must first clear Use configurations from parent test suite, and then select the default configurations that you want to add and any that you want to remove.
Poznámka
Changing the default configurations only affects new test cases or test suites that are added to this test suite. For more information about how to change the pairings of tests and configurations that are already in your test plan, see the procedure about how to update configurations for specific test cases.
(Optional) To add a new configuration or manage existing configurations, click Manage.
The Test Configuration Manager activity is displayed. For more information about creating configurations using the test configuration manager, see How to: Create Test Configurations.
To save your changes to the default configurations, click Save.
To add an existing test case to this test suite, click Add.
The Add test cases to suite dialog box is displayed. All available test cases are shown in the list of tests.
Poznámka
Tests that have already been added to the test suite are not shown in the list of tests.
(Optional) If there are several test cases listed, you can narrow your test case search by changing the query for test cases as shown in the following steps.
To add a new clause to your query, select Click here to add a clause.
Click each column in the query clause to fill in the clause. If a column has a list of accepted values, a drop-down arrow appears when the column is selected. Click the drop-down arrow to select a value from the list. The following columns are available:
Query Column
How to complete
And/Or
Select And if this clause and the previous clause must be true to match a result. Select Or if either this clause or the previous clause must be true to match a result.
Field
The list for this field contains all the searchable work item fields used in the current Team Foundation Server. Use as many clauses and fields as you want to get useful results. Press ALT+DOWN ARROW or type the field name that you want to select.
Operator
Examples of operator choices are = (equal), <> (not equal to), > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), In, Was Ever, Was Never, and Contains.
Value
Specifies the value that you are looking for in the specified field. If there is a list of values to select from, click the drop-down arrow to select the one that you want. Team Foundation work item tracking includes some query variables to dynamically add values to your query. For more information, see Query Variables.
Repeat the previous two steps to add all the values for which you want to search.
To see the results of your query, click Run to run the query.
Select the tests that you want to add, and then click Add test cases.
The test cases that you selected are now displayed in the test suite details pane.
Poznámka
To add a copy of an existing test case to the test suite, right-click a test case and point to Create copy and add to suite. The new test case dialog box is displayed so that you can edit the test case as necessary.
To create a test case and add it to this test suite, click New.
The New Test Case dialog box is displayed.
Enter the details for your new test case including the actions and expected results for each test step, and then click Save and Close.
The new test case is now displayed in the test suite details pane.
Poznámka
For more information about how to create new test cases, see How to: Create a Manual Test Case.
Repeat the previous two steps to add more test cases.
Poznámka
All the existing test cases that you add, or new test cases that you create, are paired with each default configuration to define what tests must be run on which configurations for the test plan. To see these pairings, select the test suite and click Configurations.
The changes that you have made to the test plan are automatically saved.
Remove a test case from a test suite
To remove a test case from a test suite
Open Microsoft Test Manager.
Poznámka
To display the Microsoft Test Manager window, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Test Manager 2010.
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To select a test suite, click the test suite in the test suite hierarchy.
The test cases in the test suite are displayed in the test suite details pane.
To remove a test case from the test suite, select the test case in the test suite details pane and then click Remove in the toolbar**.**
Poznámka
The test case is only removed from the test suite. It can be added again later if you need it.
The test case is no longer displayed in the test suite details pane.
Move a test suite
Test suites can be moved to a different location in the test suite hierarchy.
To move a test suite
Open Microsoft Test Manager.
Poznámka
To display the Microsoft Test Manager window, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Test Manager 2010.
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To move an existing test suite, click the test suite and drag it to the node that you want to be the new parent for this test suite. Or right-click the test suite and point to Cut and then right-click the node to be the new parent and point to Paste.
The test suite is now a child of that node and it is displayed in the new location in the test suite hierarchy.
Poznámka
If you move a test suite, all child test suites will be moved with it. You cannot move any test suite to be a child of a query-based test suite or a test suite created by adding a requirement to the test plan.
Rename a test suite
To rename a test suite
Open Microsoft Test Manager.
Poznámka
To display the Microsoft Test Manager window, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Test Manager 2010.
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To rename an existing test suite, right-click the test suite in the tree view of all the test suites and then click Rename.
Poznámka
You can also press F2 to rename a test suite.
Type the new name for the test suite.
The test suite is now displayed with the new name in the test suite hierarchy.
Delete a test suite
To delete a test suite
Open Microsoft Test Manager.
Poznámka
To display the Microsoft Test Manager window, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Test Manager 2010.
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To delete an existing test suite, right-click the test suite in the tree view of all the test suites and then click Delete.
A confirmation dialog box is displayed.
Důležité
You will no longer be able to view the test results for the test cases or test suites in this test suite. Also, any test suites that are children of this test suite are permanently deleted.
To confirm deletion of the test suite, click Delete test suite.
The test suite is no longer displayed in the test suite hierarchy for this plan.
Create a copy of a test suite
Test suites can be moved to a different location in the test suite hierarchy.
To create a copy of a test suite
Open Microsoft Test Manager.
Poznámka
To display the Microsoft Test Manager window, click Start, and then click All Programs. Point to Microsoft Visual Studio 2010 and then click Microsoft Test Manager 2010.
From the Testing Center, click Plan and then click Contents.
The Contents pane is displayed.
To copy an existing test suite, right-click the test suite, point to Copy, and then right-click the node to be the parent for the copy of the test suite. Then point to Paste.
The test suite is now a child of that node and it is displayed in the new location in the test suite hierarchy.
Poznámka
If you copy a test suite, all child test suites will be copied with it. You cannot copy any test suite to be a child of a query-based test suite or a test suite created by adding a requirement to the test plan.
See Also
Tasks
How to: Create and Manage Query-Based Test Suites
How to: Copy Test Suites from Another Test Plan
Concepts
Organizing Test Cases Using Test Suites
Other Resources
How to: Create Test Suites from Requirements or User Stories