【问题标题】:I am unable to see my tests in Test Explorer VS 2015 when creating CodedUI SpecFlow Tests创建 CodedUI SpecFlow 测试时,我无法在 Test Explorer VS 2015 中看到我的测试
【发布时间】:2016-04-10 14:10:25
【问题描述】:

在创建 CodedUI SpecFlow 测试时,我无法在 Test Explorer VS 2015 中看到我的测试。

我有一个 CodedUI 项目,我已将 SpecFlow 添加到其中,与使用 SpecFlow 项目不同的是,我无法在测试资源管理器中看到要运行的 SpecFlow 测试。

这一切都在 Windows 7 VS2015 终极版环境中。

我已按照 2013 年的建议创建了一个 .runsettings 文件。

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<configuration>
  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework"
      type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      requirePermission="false"/>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <specFlow>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
    <unitTestProvider name="MsTest" generatorProvider="Specflow.CodedUI.MsTestCodedUiGeneratorProvider, Specflow.CodedUI" runtimeProvider="TechTalk.SpecFlow.UnitTestProvider.MsTest2010RuntimeProvider, TechTalk.SpecFlow" />
    <!--  <unitTestProvider name="SpecRun" />-->
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
    <plugins>
    </plugins>
  </specFlow>
  <runtime>
    <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentassembly>
        <assemblyidentity culture="neutral" name="Microsoft.VisualStudio.QualityTools.CodedUITestFramework" publickeytoken="b03f5f7f11d50a3a">
          <bindingredirect newversion="14.0.0.0" oldversion="10.0.0.0"></bindingredirect>
        </assemblyidentity>
      </dependentassembly>
      <dependentassembly>
        <assemblyidentity culture="neutral" name="Microsoft.VisualStudio.TestTools.UITest.Common" publickeytoken="b03f5f7f11d50a3a">
          <bindingredirect newversion="14.0.0.0" oldversion="10.0.0.0"></bindingredirect>
        </assemblyidentity>
      </dependentassembly>
      <dependentassembly>
        <assemblyidentity culture="neutral" name="Microsoft.VisualStudio.TestTools.UITest.Extension" publickeytoken="b03f5f7f11d50a3a">
          <bindingredirect newversion="14.0.0.0" oldversion="10.0.0.0"></bindingredirect>
        </assemblyidentity>
      </dependentassembly>
      <dependentassembly>
        <assemblyidentity culture="neutral" name="Microsoft.VisualStudio.TestTools.UITesting" publickeytoken="b03f5f7f11d50a3a">
          <bindingredirect newversion="14.0.0.0" oldversion="10.0.0.0"></bindingredirect>
        </assemblyidentity>
      </dependentassembly>
      <dependentassembly>
        <assemblyidentity culture="neutral" name="Microsoft.VisualStudio.QualityTools.CodedUITestFramework" publickeytoken="b03f5f7f11d50a3a">
          <bindingredirect newversion="14.0.0.0" oldversion="10.0.0.0"></bindingredirect>
        </assemblyidentity>
      </dependentassembly>
      <dependentassembly>
        <assemblyidentity culture="neutral" name="Microsoft.Services.TestTools.UITesting.Html" publickeytoken="b03f5f7f11d50a3a">
          <bindingredirect newversion="14.0.0.0" oldversion="10.0.0.0"></bindingredirect>
        </assemblyidentity>
      </dependentassembly>
    </assemblybinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb"/>
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>
    </providers>
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite.EF6"/>
      <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6"
        description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6"/>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite"
      description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
    </DbProviderFactories>
  </system.data>
</configuration>
  </RunSettings>

我已选择测试设置文件指向此文件。

当我在本地构建解决方案时仍然碰壁。

【问题讨论】:

  • 我现在已经创建了一个 CodedUI 项目并成功地从头开始添加 SpecFlow,但是我仍然没有看到我在测试资源管理器中创建的 SpecFlow 测试。测试本身正在构建并且在本地看起来一切都很好,但没有出现。任何帮助都会很棒!

标签: coded-ui-tests specflow test-explorer


【解决方案1】:

现在解决了这个问题 如果您将项目设置保存到网络文件夹而不是本地文件夹,则测试资源管理器不信任/识别项目在构建时创建的 DLL,因此不会显示测试。

如果您将项目保存到本地驱动器(C 或 D),或者让网络驱动器被识别为受信任。

【讨论】:

    猜你喜欢
    • 2020-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-03
    • 1970-01-01
    • 2017-03-11
    • 1970-01-01
    相关资源
    最近更新 更多