SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.24k stars 754 forks source link

test framework error: Unable to load type TechTalk.SpecRun.Framework.Filtering.TagFilter required for deserialization #1872

Closed hussainsam closed 3 years ago

hussainsam commented 4 years ago

SpecFlow Version:

Used Test Runner

Version number: 1.8.5

Project Format of the SpecFlow project

.feature.cs files are generated using

Visual Studio Version

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

Are the latest Visual Studio updates installed?

.NET Framework:

Test Execution Method:

<SpecFlow> Section in app.config or content of specflow.json

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

  <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" /></configSections>
<appSettings>
xxx
</appsettings>

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="TechTalk.SpecRun" publicKeyToken="d0fc5cc18b3b389b" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.8.0.0" newVersion="1.8.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
      </dependentAssembly>   
    </assemblyBinding>
  </runtime>
<specFlow>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
  <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><unitTestProvider name="SpecRun" /><plugins>
      <add name="SpecRun" />
    </plugins></specFlow></configuration>

Repro Project

Issue Description

Local Scenario : I have 2 projects in a solution. After linking the required run settings file and build/rebuild the solution, test runner will not recognize the test cases defined in srs profile. If I rebuild just one project within the solution, test runner identifies the test cases and populates the scenarios in test explorer.

TFS Scenario: I attempted numerous ways to make the test cases recognized while CI build but unfortunately I couldnt do so. Here's my CI build tasks comprises of

Steps to Reproduce

Here's my package details

hussainsam commented 4 years ago
Here's my package details
<packages>
  <package id="log4net" version="2.0.5" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
  <package id="SpecFlow" version="2.4.1" targetFramework="net45" />
  <package id="SpecFlow.Tools.MsBuild.Generation" version="2.4.1" targetFramework="net45" />
  <package id="SpecRun.Runner" version="1.8.5" targetFramework="net45" />
  <package id="SpecRun.SpecFlow" version="1.3.0" targetFramework="net45" />
  <package id="SpecRun.SpecFlow.2-4-0" version="1.8.5" targetFramework="net45" />
  <package id="System.ValueTuple" version="4.3.0" targetFramework="net45" />
</packages>
SabotageAndi commented 4 years ago

@hussainsam What is the filter in the srProfile- Files?

hussainsam commented 4 years ago

@SabotageAndi Below is the Filter, the same tag has in the Feature file.

<TestAssemblyPath> AppFeatureTest.dll</TestAssemblyPath>
  <Filter>@sanity_workflow</Filter>
I also tried with
<Targets> 
      <Filter>@sanity_workflow</Filter>
   </Target> 
</Targets> 
SabotageAndi commented 4 years ago

@hussainsam Please post the whole srProfile or make no errors in copy & pasting parts of it. TestAssemblyPath and Filter can be on the same level.

for the filter you are missing a Target tag before.

I have no idea if your error is now because of an illegal srProfile or not.

SabotageAndi commented 3 years ago

Closed because of inactivity

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.