我有一个Coded UI测试程序,在本地Visual Studio(2017)上运行时没有任何错误。程序中只有一种测试方法。它的一个功能是在Azure存储容器中保存文件。在构建测试运行过程中,构建消息说它无法找到任何测试。希望得到任何反馈,看看我是否在构建定义中犯了任何错误。
构建消息说:
D:\ a \ 3 \ s \ FullSite1 \ bin \ Debug \ FullSite1.dll D:\ a \ 3 \ s \ FullSite1 \ bin \ Debug \ Microsoft.Azure.KeyVault.Core.dll中没有可用的测试D:\ a \ 3 \ s \ FullSite1 \ bin \ Debug \ Microsoft.Data.Edm.dll D:\ a \ 3 \ s \ FullSite1 \ bin \ Debug \ Microsoft.Data.OData.dll D:\ a \ 3 \ s \ FullSite1 \ bin \ Debug \ Microsoft.Data.Services.Client.dll D:\ a \ 3 \ s \ FullSite1 \ bin \ Debug \ Microsoft.WindowsAzure.Storage.dll D:\ a \ 3 \ s \ FullSite1 \ bin \ Debug \ Newtonsoft.Json.dll D:\ a \ 3 \ s \ packages \ Microsoft.Azure.KeyVault.Core.1.0.0 \ lib \ net40 \ Microsoft.Azure.KeyVault.Core.dll D:\ a \ 3 \ s \ packages \ Microsoft.Azure.KeyVault.Core.1.0.0 \ lib \ portable-net45 + wp8 + wpa81 + win \ Microsoft.Azure.KeyVault.Core.dll D:\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ net20 \ Newtonsoft.Json.dll D:\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ net35 \ Newtonsoft.Json.dll D:\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ net40 \ Newtonsoft.Json.dll D:\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ net45 \ Newtonsoft.Json .dll D:\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ netstandard1.0 \ Newtonsoft.Json.dll D :\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ netstandard1.3 \ Newtonsoft.Json.dll D:\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ portable-net40 + sl5 + win8 + wpa81 + wp8 \ Newtonsoft.Json.dll D:\ a \ 3 \ s \ packages \ Newtonsoft.Json.10.0.2 \ lib \ portable-net45 + win8 + wpa81 + wp8 \ Newtonsoft。 Json.dll D:\ a \ 3 \ s \ packages \ WindowsAzure.Storage.9.1.1 \ lib \ net45 \ Microsoft.WindowsAzure.Storage.dll D:\ a \ 3 \ s \ packages \ WindowsAzure.Storage.9.1。 1 \ lib \ netstandard1.0 \ Microsoft.WindowsAzure.Storage.dll D:\ a \ 3 \ s \ packages \ WindowsAzure.Storage.9.1.1 \ lib \ netstandard1.3 \ Microsoft.WindowsAzure.Storage.dll D:\ a \ 3 \ s \ packages \ WindowsAzure.Storage.9.1.1 \ lib \ win8 \ Microsoft.WindowsAzure.Storage.dll D:\ a \ 3 \ s \ packages \ WindowsAzure.Storage.9.1.1 \ lib \ wp8 \ Microsoft.WindowsAzure.Storage.dll D:\ a \ 3 \ s \ packages \ WindowsAzure.Storage.9.1.1 \ lib \ wpa \ Microsoft.WindowsAzure.Storage.dll。确保测试发现者&执行人员已注册,平台和框架版本设置是合适的,然后再试一次。
我在构建定义中使用以下内容:
过程
Agent queue: Hosted VS2017
Get Sources
Select a Source: TFVC
第1阶段
Agent Queue: Hosted VS2017
Demands
Exists: msbuild, visualstudio, vstest
NuGet Restore
Version: 2
Command: restore
Path to solution, packages.config or project.json: **/*.sln
Use packages from NuGet.org
构建解决方案**。sln
Visual Studio Build
Build solution **\*.sln
Version = 1.*
Solution = **\*.sln
Visual Studio Version = Latest
测试运行(Visual Studio测试)
Version = 2.*
Select tests using = Test assemblies
Test Assemblies = **\*.dll
!**\*TestAdapter.dll
!**\obj\**
Search Folder = $(System.DefaultWorkingDirectory)
Test mix contains UI Tests
Select test platform using = Version
Update test attachments = Checked
Control Options = Enabled
答案 0 :(得分:0)
在将代码与另一个测试进行比较后,我发现原因是因为CodedUITest.cs文件在命名空间后缺少[CodedUITest]。我添加了它,VSTS现在可以找到测试方法。