Comments (6)
Do you get the error when you use it from NuGet? https://www.nuget.org/packages/SpecFlow.xUnitAdapter/
from specflow.xunitadapter.
@gasparnagy I have the same problem, If I use Bindings from a Nuget packages, it doesn't scan external dlls and then it gives same error.
from specflow.xunitadapter.
I have the same problem and it appears to be a long running, persistent issue for many. External assemblies containing step definitions are simply not found. This means that context highlighting in Visual Studio does not work.
from specflow.xunitadapter.
Not sure if the repo is still in active development or maybe being merged into the main SpecFlow repos?
from specflow.xunitadapter.
I found the solution, I had the same problem with .Net Core project, so I will explain it for .Net Core but you can modify it based on your need, of course.
1: You need to upgrade SpecFlow assemblies to newest version, I forked SpecFlow repository and made few changes to make it build for .Net Standard 2.0. Here is my branch; https://github.com/mtrcn/SpecFlow/tree/netstandard
2: Second, you need to create JSON config file in your SpecFlow project root, like following;
specflow.json
{
"specFlow": {
"stepAssemblies": [ { "assembly": "Mete.BDD.Bindings" } ]
}
}
3: Modify following lines;
with these;
var containerBuilder = new ContainerBuilder();
var objectContainer = containerBuilder.CreateGlobalContainer();
var configurationLoader = objectContainer.Resolve<IConfigurationLoader>();
var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.GetFullPath(TestCase.FeatureFile.SpecFlowProject.AssemblyPath));
var testRunnerManager = new TestRunnerManager(
objectContainer,
containerBuilder,
configurationLoader.Load(ConfigurationLoader.GetDefault()),
objectContainer.Resolve<IRuntimeBindingRegistryBuilder>()
);
testRunnerManager.Initialize(assembly);
testRunner = testRunnerManager.GetTestRunner(Thread.CurrentThread.ManagedThreadId);
This will help you load external bindings that are specified in json config.
Hope it helps!
from specflow.xunitadapter.
Any chance you can submit a PR (assuming you can make this work for good old VS2015)?
from specflow.xunitadapter.
Related Issues (19)
- [Feature] Test Attachments HOT 2
- error MSB4062: The "SpecFlow.xUnitAdapter.Build.SpecFlowSourceMapAppender" task could not be loaded from the assembly HOT 4
- "Property value is not valid" when setting Build Action to "SpecFlowFeature" HOT 4
- Deserialize Table to List<POCO> HOT 1
- "Could not find a source mapping" despite passing tests HOT 2
- Unable to select Build Action as per Readme HOT 3
- Source controller marked class files throw System.UnauthorizedAccessException during SourceMap HOT 1
- Scenarios don't show in resharper HOT 1
- Missing "Feature Execution Details" from test execution report HOT 1
- VS for Mac support HOT 1
- Tests not discovered after updating xunit package from 2.3.1 to 2.4.0 (new csproj) HOT 2
- Does not work with SpecFlow 2.4.0
- SpecFlow mutant architecture (noSpecFlow) based on targets (Web POM, APIs, Blockchain, and AI) HOT 1
- What about Specflow v3?
- [Discussion] MSBuild Integration HOT 1
- [Feature] Support standard xunit tests HOT 9
- Causes problem with ITestOutputHelper HOT 3
- Breakpoints in feature files ignored HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from specflow.xunitadapter.