how to get the assembly contains the feature file
AnsweredI have multiple projects contain feature files and one infrastructure contains the steps binding. Feature project is using specflow.json to call the steps in the infrastructure project.
When I was running one of the projects, how do I get the assembly name of the project assembly (contains the feature file)? Currently, I can only get the infrastructure dll as it contains the steps.
Thank you.
0
-
You can inject the ITestRunnerManager to your code and get the assembly containing the feature files from the TestAssembly property:
public sealed class Steps1
{
private readonly ITestRunnerManager _testRunnerManager;
public Steps1(ITestRunnerManager testRunnerManager)
{
_testRunnerManager = testRunnerManager;
}
[Given("the first number is (.*)")]
public void GivenTheFirstNumberIs(int number)
{
//access the TestAssembly
var assembly = _testRunnerManager.TestAssembly;
}
}1 -
Thank you Viktor.
0
Please sign in to leave a comment.
Comments
2 comments