我安装了以下NuGets : Specflow.Nunit、specflow、Specrun.Nunit和NUnit 2.6.3。我正在尝试执行runtests.cmd(由specrun.nunit自动生成),但是我得到了以下错误:
TechTalk.SpecRun.Framework.SpecRunException:至少有一个测试线程被中止。--> System.Reflection.TargetInvocationException:调用的目标引发了异常。-> System.MissingMethodException:方法未找到:'Void TechTalk.SpecRun.SpecRunner.Initialize()‘。我的default.srprofile包含:
<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specrun.com/schemas/2011/09/TestProfile">
<Settings projectName="<PROJECTNAME>" projectId="{------}" />
<Execution stopAfterFailures="3" testThreadCount="2" testSchedulingMode="Sequential" />
<!-- For collecting by a SpecRun server update and enable the following element. For using the
collected statistics, set testSchedulingMode="Adaptive" attribute on the <Execution> element.
<Server serverUrl="http://specrunserver:6365" publishResults="true" />
-->
<TestAssemblyPaths>
<TestAssemblyPath>projectname.dll</TestAssemblyPath>
</TestAssemblyPaths>
<DeploymentTransformation>
<Steps>`enter code here`
<!-- sample config transform to change the connection string-->
<!--<ConfigFileTransformation configFile="App.config">
<Transformation>
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDatabase" connectionString="Data Source=.;Initial Catalog=MyDatabaseForTesting;Integrated Security=True"
xdt:Locator="Match(name)" xdt:Transform="SetAttributes(connectionString)" />
</connectionStrings>
</configuration>
]]>
</Transformation>
</ConfigFileTransformation>-->
</Steps>
</DeploymentTransformation>
</TestProfile>同样在VS输出窗口上,我得到了这个错误:无法加载文件或程序集'TechTalk.SpecRun、Version=1.3.0.76、Culture=neutral、PublicKeyToken=d0fc5cc18b3b389b‘或其依赖项之一。系统找不到指定的文件。,有人能帮我一下吗?
发布于 2018-02-01 06:14:22
您将更改此字符串:
<RelocateConfigurationFile target="CustomConfig.{TestThreadId}.config" />
<ConfigFileTransformation configFile="App.config">https://stackoverflow.com/questions/40043161
复制相似问题