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

Make SpecFlow Plugins in same test assembly possible #1395

Closed stevozilik closed 3 years ago

stevozilik commented 5 years ago

SpecFlow Version:

Issue Description

I would like to create a new ITraceListener for MsTestV2 parallel test execution, the default behavior seems to be messed up. I'm reading in order to do that, I need to create a new plugin https://github.com/techtalk/SpecFlow/wiki/Configuration

How to create a plugin: https://github.com/techtalk/SpecFlow/wiki/Plugins

The steps to create a new plugin could not be more complicated, why not simply allow pointing to the plugin type, instead of having to create a new project with magic naming convention?

SabotageAndi commented 5 years ago

About the TraceListener: We implemented one for SpecFlow 3: https://github.com/techtalk/SpecFlow/blob/master/Plugins/TechTalk.SpecFlow.MSTest.SpecFlowPlugin/MSTestTraceListener.cs

About the plugin infrastructure: Yeah, in SpecFlow 2 it's a little bit too complicated. But there was no need to change it, as it is the same way as in SpecFlow 1.*. We changed it a little bit in SpecFlow 3. The naming convention is still there, but the configuration in the app.config is gone.

If you want to improve the runtime plugin loading, the code is here: https://github.com/techtalk/SpecFlow/tree/master/TechTalk.SpecFlow/Plugins I am happy to review your PR and give feedback on it.

SabotageAndi commented 5 years ago

btw, I took the liberty to rename the issue.

stevozilik commented 5 years ago

@SabotageAndi

thank you for quick response

About the TraceListener: We implemented one for SpecFlow 3: https://github.com/techtalk/SpecFlow/blob/master/Plugins/TechTalk.SpecFlow.MSTest.SpecFlowPlugin/MSTestTraceListener.cs

I've replicated the same plugin/trace listener config in my SpecFlow 2.4.1 project, including how it's registered with the plugin using CustomnizeScenarioDependencies ObjectContainer (breakpoint hit), but my ITraceListener is never constructed/used, the tests are still writing to 'StandardOutput'

Any ideas?

SabotageAndi commented 3 years ago

Todo: Search for runtime plugins in the test assembly Generator plugins are not possible to have in the test assembly, because it is needed before the test assembly is compiled.

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.