I have some test scenarios and cases written in Specflow/Selenium in Visual Studio, usin MsTest. I just want to associate them to Microsoft Test Manager, so a test case written there is associated to an automated test.
Is that possible? How?
More Data: test were created by using Scenario Outline with some lines of examples.
You can associate testcases to a workitem in TFS/MTM, but we found it to cumbersome to do: It is a manual action in MTM that references the TestMethod
by name. But because the TestMethod
is generated by specflow by combining the title of the Scenario Outline
and the first column of your Examples
table, it is difficult to maintain:
Scenario Outline
title is changed, or the term in the first column of the examples table is changed, you have to re-couple the TestMethods
to the workitemsExamples
or Scenarios
to your feature, you have to remember to link them to the workitem, one-by-oneTestMethod
in the dll is nearly undoable when you approach the thousandish scenarios. What we did was using the WorkItem
attribute in the Feature
to connect (parts of) the feature to a workitem like @Workitem:42
. This is a little unnoticed feature in SpecFlow:
MsTest: Support for MSTest's [Owner] and [WorkItem] attributes with tags like @owner:foo @workitem:123 (Issue 162, Pull 161)
and it creates a WorkItemAttribute
attached to the method that is connected to that tagged Scenario (Outline)
or Feature
.
Then, we imported all testcases into MTM with the Test Case Management tool and ran a custom made tool (making use of the TeamFoundation namespace and the TestManagement and WorkItemTracking Client) that connected each imported testcase
to the correct workitem
. Whenever a test did run we could see the results in MTM, but also from the perspective of the connected workitem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.