我从SpecFlow开始测试我的Azure Data Factory管道。我正在使用VS 2019和.NET Framework 4.7.2。当我尝试运行测试时,它开始执行,然后立即完成。我还观察到它并没有达到我在feature file
和binding
中放置的断点。这是我的packages.config
文件:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.Management.DataFactory" version="4.8.0" targetFramework="net472" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.7" targetFramework="net472" />
<package id="Microsoft.NET.Test.Sdk" version="15.0.0" targetFramework="net472" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.20" targetFramework="net472" />
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.19" targetFramework="net472" />
<package id="Microsoft.TestPlatform.TestHost" version="15.0.0" targetFramework="net472" />
<package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" />
<package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net472" />
<package id="SpecFlow" version="2.4.0" targetFramework="net472" />
<package id="SpecRun.Runner" version="3.2.22" targetFramework="net472" />
<package id="SpecRun.SpecFlow.2-4-0" version="3.2.22" targetFramework="net472" />
<package id="System.IO" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net472" />
<package id="System.Runtime" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net472" />
<package id="System.ValueTuple" version="4.3.0" targetFramework="net472" />
</packages>
当我检查日志文件时,可以在生成的日志文件中找到以下行:No tests executed (activation needed)
。有人可以告诉我我在哪里错吗?请注意,我的解决方案正在正确构建。
PFB整个日志供您参考:
2020-04-21T23:25:19.8268118+05:30;VSTestExecutionThread;Info;SpecFlow+Runner execution started
2020-04-21T23:25:19.8268118+05:30;VSTestExecutionThread;Info;SpecFlow+Runner 3.2.22 in Framework clr40 in x86 mode execution started
2020-04-21T23:25:19.8268118+05:30;VSTestExecutionThread;Info;TestAdapter Location: C:\Users\ddc\source\repos\ADF.UnitTest\packages\SpecRun.Runner.3.2.22\tools\net45\TechTalk.SpecRun.VisualStudio.TestAdapter.dll
2020-04-21T23:25:20.0532065+05:30;VSTestExecutionThread;Info;SpecRun: running tests in C:\Users\ddc\source\repos\ADF.UnitTest\ADF.UnitTest\bin\Debug\ADF.UnitTest.dll
2020-04-21T23:25:20.0532065+05:30;VSTestExecutionThread;Info;Output folder configured to "C:\Users\ddc\source\repos\ADF.UnitTest\TestResults" (default)
2020-04-21T23:25:20.0542043+05:30;VSTestExecutionThread;Info;Profile: ADF.UnitTest
2020-04-21T23:25:20.1309989+05:30;VSTestExecutionThread;Info;Log file path: C:\Users\ddc\source\repos\ADF.UnitTest\TestResults\ADF.UnitTest_ADF.UnitTest_2020-04-21T232520.log
2020-04-21T23:25:20.1429665+05:30;Thread#14;Info;Checking activation
2020-04-21T23:25:21.6090483+05:30;Thread#14;Error;No tests executed (activation needed)
2020-04-21T23:25:21.6339842+05:30:Total: 0
2020-04-21T23:25:21.6369734+05:30:Succeeded: 0
2020-04-21T23:25:21.6369734+05:30:Ignored: 0
2020-04-21T23:25:21.6369734+05:30:Pending: 0
2020-04-21T23:25:21.6379706+05:30:Skipped: 0
2020-04-21T23:25:21.6379706+05:30:Failed: 0
2020-04-21T23:25:21.6449520+05:30;VSTestExecutionThread;Info;Adding attachments to VSTest
========== End of log file ==========
答案 0 :(得分:0)
更新我的SpecFlow NuGet软件包时,会弹出相同的问题。 SpecFlow现在要求您通过Microsoft帐户设置一个帐户。
从Visual Studio中的测试中检查输出,并且应该有一个激活帐户的链接。请参阅此处的文档:https://specflow.org/2020/introducing-the-specflow-account/