Associating TestArchitect and Team Foundation Server test cases in Visual Studio
To execute TestArchitect test cases from MTM or the Test Hub, an association between TestArchitect tests and Team Foundation Server tests must be created in the related Visual Studio project.
Ensure that you have already taken the following step(s):
- Created TA-TFS integration project.
Running TA tests from MTM requires two types of associations:
- the mappings of TA and TFS test cases in the two respective systems, discussed elsewhere; and
- a process of association in the related Visual Studio project. This process automatically generates C# code snippets in Microsoft Visual Studio to link the TA and TFS test cases.
Start Visual Studio.
Right-click a project, and then select Associate.
Fastpath: Alternatively, click the Associate button on the Visual Studio toolbar.
Notes:If the Associate button is not visible on the Visual Studio toolbar, enable the button by right-clicking on the toolbar and selecting TestArchitect from the context menu.In the Connect to Team Foundation Server dialog box, select the server to connect to from the Team Foundation Server drop-down box, and then choose the correct team project values for Team Project Collections and Team Projects. Click Connect to establish an association between TFS and TestArchitect.
In the Select Test Plan dialog box, choose a test plan, then click Select plan to proceed.
In the Associate Tests dialog box, select the test suites and test cases to associate with the tests. Tests which have been associated previously are selected automatically. After you finish selecting the desired tests, click Associate.
Tip:TFS test cases that have not been associated are indicated in GREEN. Whereas, TFS test cases that have been associated are indicated in BLUE. Note that, if you select associated TFS test cases, they will be re-associated.
Filtering TFS test cases:
In the Associate Tests dialog box, you can select the Filter button to narrow down the list of test cases displayed based on the selected conditions.
In the Advanced filter dialog box, by defining one or more clauses, you can filter from work items to return the set of work items that interest you. For more information about query fields, operators, and macros, see here.
To temporarily disable the specified filtering conditions, in the Associate Tests dialog box, clear the check box as follows.
To remove totally the specified filtering conditions, in the Associate Tests dialog box, click X as follows.
If the test association fails due to some reasons, you will see the following error dialog box. Click View Log File to troubleshoot, if needed.
If the test association succeeds, a confirmation dialog box appears.
Click OK to exit the confirmation dialog box.
Under the TestArchitect_Generated folder, test methods are generated in the project as follows:
In MTM, information on the association is added into test cases as follows:
Check in your test method on the TFS server.
Remember:For TFS 2017, you are required to explicitly check in the following DLL LogiGear.TestArchitect.TAIntegrationLoader.dll
Microsoft Visual Studio automatically generates C# code snippets which associate the TestArchitect test cases with the TFS test cases. You normally do not need to edit the generated snippets. However, you should verify that the test case IDs for each test method match the associated IDs.
In the above example, four C# test methods have been generated (one method for each test case) for the four TestArchitect test cases (TC01, TC02, TC03, and TC04). Each method consists of a call to RunTestCase, which starts the execution of the TestArchitect test case whose source field maps to the TFS test cases with identifiers 703, 704, 705, and 706 respectively.