SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

Specflow.Autofac nuget package search scope?

Open Kanwar27 opened this issue 4 years ago • 0 comments

SpecFlow Version

3.5.14

Which test runner are you using?

MSTest

Test Runner Version Number

3.5.14

.NET Implementation

equal or greater .NET Framework 4.6.1

Project Format of the SpecFlow project

Classic project format using packages.config

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Visual Studio Test Explorer

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

Issue Description

This question is related to the Specflow.Autofac nuget package.

After compilation we place all the binaries of our test projects (~30) within a shared bin folder (this cannot change unfortunately). After installing specflow.autofac nuget package in a single project a binary SpecFlow.Autofac.SpecFlowPlugin was placed in the shared bin folder as well (no problem until here).

Since the package was only installed in 1 project hence I provided the [ScenarioDependencies] function within this single project as well. But all other projects now have failing tests. Reason is Specflow.Autofac is expecting all the projects to have a function with [ScenarioDependencies] attribute (this is normally the entry point for specflow.autufac).

Why does it try to find the ScenarioDependencies function in all the projects when the nuget package was only installed in a single project? Any leads would be appreciated. Thanks

Steps to Reproduce

  1. Create multiple projects.
  2. Ensure that binaries are placed within same shared bin folder after both projects are compiled.
  3. Install Specflow.autofac in one of them.
  4. Provide [ScenarioDependencies] in the project where you installed the nuget package.
  5. Try running test from the other project.

Link to Repro Project

No response

Kanwar27 avatar Jun 05 '21 00:06 Kanwar27