Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate step argument transformations created for external assemblies #1004

Open
6 of 17 tasks
jtdubya opened this issue Jan 11, 2018 · 1 comment
Open
6 of 17 tasks

Comments

@jtdubya
Copy link

jtdubya commented Jan 11, 2018

Duplicate step argument transformations created for external assemblies and causing false "Multiple step transformation matches to the input" warning

SpecFlow Version:

  • 2.2
  • 2.1
  • 2.0
  • 1.9

Used Test Runner

  • [X ] SpecFlow+Runner
  • MSTest
  • NUnit
  • Xunit

Version number:
1.6.3

Visual Studio Version

  • VS 2017
  • VS 2015
  • VS 2013

Are the latest Visual Studio updates installed?

  • Yes
  • No

.NET Framework:

  • >= .NET 4
  • before .NET 4

Test Execution Method:

  • Visual Studio Test Explorer
  • TFS/VSTS – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • Command line – PLEASE SPECIFY THE FULL COMMAND LINE

<SpecFlow> Section in app.config

  <specFlow>
        <stepAssemblies>
            <stepAssembly assembly="CalculatorSteps" />
        </stepAssemblies>

        <!-- 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 --><unitTestProvider name="SpecRun" />
        <plugins>
            <add name="SpecRun" />
        </plugins>
</specFlow>

Repro Project

https://github.com/jtdubya/SpecFlowTransformIssueExample

Issue Description

Duplicate step argument transformations are being created for steps in external assemblies which give the false "warning: Multiple step transformation matches to the input" in the output. The step argument transformations, identified by the [StepArgumentTransformation] annotation, that are referenced from external assemblies are duplicated in the binding registry.

Steps to Reproduce

Create step argument transformations is a separate project from the test project and reference them in the specflow>stepAssemblies section of the app.config

@nikoudel
Copy link

nikoudel commented Nov 15, 2018

The bug is here.

AppConfigConfigurationLoader.LoadAppConfig is run multiple times (which also feels flawed btw) and each time it copies previous specFlowConfiguration.AdditionalStepAssemblies list only to add configSection.StepAssemblies once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants