简体   繁体   English

无法将自动化测试与测试用例关联

[英]Unable To Associate Automated Tests with Test Cases

I'm automating tests by means of CodedUI in VS2015 Enterprice(.NET4.7.2) and running them from Azure DevOps.我通过 VS2015 Enterprice(.NET4.7.2) 中的 CodedUI 自动化测试并从 Azure DevOps 运行它们。 I need to associate manual test with automated test case via Work Item, but I don't see my test case (checked into tfs) in "Automated test name"-List (but older tests are listed.) Even so this test case runs succesfully in Azure Pipeline with "Automation State"= planned.我需要通过工作项将手动测试与自动化测试用例相关联,但我没有在“自动测试名称”列表中看到我的测试用例(签入到 tfs)(但列出了较旧的测试。)即使这样这个测试用例运行在“自动化状态”= 计划的 Azure 管道中成功。 Why can test case not be listed in "Automated test name" and how can I add it and change "automation state" to automated?为什么测试用例不能在“自动化测试名称”中列出,如何添加它并将“自动化状态”更改为自动化? Thanks谢谢

The process to associate an automated test with a test case is:将自动化测试与测试用例相关联的过程是:

  1. Create a test project containing your automated test.创建一个包含自动化测试的测试项目。
  2. Check your test project into an Azure DevOps or Team Foundation Server (TFS) repository.将您的测试项目签入 Azure DevOps 或 Team Foundation Server (TFS) 存储库。
  3. Create a build pipeline for your project, ensuring that it contains the automated test.为您的项目创建构建管道,确保它包含自动化测试。
  4. Use Visual Studio Enterprise or Professional 2017 or a later version to associate the automated test with a test case as shown below.使用 Visual Studio Enterprise 或 Professional 2017或更高版本将自动化测试与测试用例相关联,如下所示。 The test case must have been added to a test plan that uses the build you just defined.测试用例必须已添加到使用您刚刚定义的构建的测试计划中。

Q: What types of tests are supported?问:支持哪些类型的测试?

A: These are the limitations for each type of test:答:这些是每种测试类型的限制:

  • Coded UI test, Selenium tests, and unit tests written using Version 1 of the MSTest framework can be associated with a test case.编码的 UI 测试、Selenium 测试和使用 MSTest 框架版本 1 编写的单元测试可以与测试用例相关联。
  • Tests that use MSTest v2 , NUnit, and xUnit frameworks can be associated with a test case workitem when using Visual Studio 15.9 Preview 2 or later .在使用Visual Studio 15.9 Preview 2 或更高版本时,使用MSTest v2 、NUnit 和 xUnit 框架的测试可以与测试用例工作项相关联。 However, these tests cannot be run using Microsoft Test Manager and XAML builds.但是,这些测试无法使用 Microsoft 测试管理器和 XAML 版本运行。

More details please kindly refer our official doc: Associate automated tests with test cases更多细节请参考我们的官方文档: Associateautomated testing with test case

If you are unable to see the Automated Option in the dropdown there are only 2 options available in the dropdown - 'Not Automated' and Planned .如果您无法在下拉列表中看到自动选项,则下拉列表中只有 2 个选项可用 - 'Not Automated' 和Planned

This is caused you didn't associate automated tests successfully.这是因为您没有成功关联自动化测试。 To display the Automated option, you need to Associate automated tests with test cases.要显示Automated选项,您需要将自动化测试与测试用例关联。

Take a look at this similar issue: 'Automated' option not shown in 'Automation Status' dropdown in Testcase work Item看看这个类似的问题: 测试用例工作项的“自动化状态”下拉菜单中未显示“自动化”选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM