[英]Is it possible to associate automatd cases in Specflow and Selenium to Microsoft Test Manager?
I have some test scenarios and cases written in Specflow/Selenium in Visual Studio, usin MsTest.我有一些在 Visual Studio 中用 Specflow/Selenium 编写的测试场景和案例,使用 MsTest。 I just want to associate them to Microsoft Test Manager, so a test case written there is associated to an automated test.
我只想将它们与 Microsoft 测试管理器相关联,因此在那里编写的测试用例与自动化测试相关联。
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.您可以将测试用例与 TFS/MTM 中的工作项相关联,但我们发现这样做很麻烦:这是 MTM 中按名称引用
TestMethod
的手动操作。 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:但是因为
TestMethod
是specflow通过结合Scenario Outline
的标题和你的Examples
表的第一列来生成的,所以很难维护:
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 workitemsScenario Outline
标题改变,或在实施例表的第一列术语改变时,你必须重新联接TestMethods
的工作项Examples
or Scenarios
to your feature, you have to remember to link them to the workitem, one-by-oneExamples
或Scenarios
添加到您的功能时,您必须记住将它们一一链接到工作项TestMethod
in the dll is nearly undoable when you approach the thousandish scenarios.TestMethod
几乎是无法撤消的。 What we did was using the WorkItem
attribute in the Feature
to connect (parts of) the feature to a workitem like @Workitem:42
.我们所做的是使用功能中的
WorkItem
属性将Feature
(部分)连接到像@Workitem:42
这样的工作项。 This is a little unnoticed feature in SpecFlow:这是 SpecFlow 中一个 未被注意到的特性:
MsTest: Support for MSTest's [Owner] and [WorkItem] attributes with tags like @owner:foo @workitem:123 (Issue 162, Pull 161)
MsTest:支持 MSTest 的 [Owner] 和 [WorkItem] 属性,带有 @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
.并创建一个
WorkItemAttribute
附加到连接到该标记的Scenario (Outline)
或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
.然后,我们使用测试用例管理工具将所有测试用例导入 MTM 并运行一个定制工具(利用TeamFoundation 命名空间以及TestManagement和WorkItemTracking Client)将每个导入的
testcase
连接到正确的workitem
。 Whenever a test did run we could see the results in MTM, but also from the perspective of the connected workitem.每当测试运行时,我们都可以在 MTM 中看到结果,而且还可以从连接的工作项的角度看到结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.