SpecFlow: Context error when using the SpecFlow.xUnit runner
delatrie opened this issue · 8 comments
I'm submitting a ...
- bug report
- feature request
- support request => Please do not submit support request here, see note at the top of this template.
What is the current behavior?
When using SpecFlow.xUnit, running any scenario results in the following error:
Message:
System.InvalidOperationException : No test context is active.
Stack Trace:
AllureContext.get_CurrentTest()
AllureLifecycle.UpdateTestCase(Action`1 update)
lambda_method47(Closure , IContextManager )
TestExecutionEngine.FireEvents(HookType hookType)
TestExecutionEngine.FireScenarioEvents(HookType bindingEvent)
TestExecutionEngine.OnScenarioEnd()
TestRunner.OnScenarioEnd()
SelectiveRunTestRunner.OnScenarioEnd()
ScenarioAndStepOutcomesFeature.TestTearDown()
IDisposable.Dispose()
ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) line 79
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Just setup the project with the SpecFlow.xUnit runner.
What is the expected behavior?
No error is thrown, the scenarios are executed in the same way as they do with SpecFlow.NUnit.
Please tell us about your environment:
- Test framework: SpecFlow@3.9.74
- Runner: SpecFlow.xUnit@3.9.74
- Allure adaptor: Allure.SpecFlowPlugin@2.10.0
- Generate report using: allure-maven@2.18
Other information
I have the same problem - is there any news or workaround to solve it?
@delatrie have you found any solution?
@exceptioncpp are you using SpecFlow or Reqnroll?
@delatrie we are still using SpecFlow, but are considering moving to Reqnroll.
Maybe you have ideas - how to bypass or fix this issue on the SpecFlow/Reqnroll side?
I checked previous versions - the last working one is release 2.9.5-preview.1, after that there was a deep refactoring with the introduction of AllureContext which originally didn't work with Specflow.xUnit
I suggest moving to Reqnroll. The issue with the Xunit runner will be fixed with a new adapter that will be released soon (ETA next week; see #453).
Allure.Reqnroll is available now
Hello,
I just installed the latest Allure.Specflow 2.12.0, but got the same error as with 2.11.0:
Error Message:
System.InvalidOperationException : No test context is active.
Stack Trace:
at Allure.Net.Commons.AllureContext.get_CurrentTest()
at Allure.Net.Commons.AllureLifecycle.UpdateTestCase(Action`1 update)
at lambda_method396(Closure, IContextManager)
at InvokeStub_Action`1.Invoke(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType hookType)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireScenarioEvents(HookType bindingEvent)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioEnd()
at TechTalk.SpecFlow.TestRunner.OnScenarioEnd()
at Allure.SpecFlowPlugin.SelectiveRun.SelectiveRunTestRunner.OnScenarioEnd()
I have the following dependencies in my test project:
<PackageReference Include="Allure.SpecFlow" Version="2.12.0" />
<PackageReference Include="Allure.Xunit" Version="2.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.9.57" />
<PackageReference Include="SpecFlow.xUnit" Version="3.9.74" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
Is SpecFlow with xUnit still supposed to work or migration to Regnroll is the only option?
Is SpecFlow with xUnit still supposed to work or migration to Regnroll is the only option?
SpecFlow with xUnit is not supported. Is there any reason you don't want to migrate to Regnroll?
Is SpecFlow with xUnit still supposed to work or migration to Regnroll is the only option?
SpecFlow with xUnit is not supported. Is there any reason you don't want to migrate to Regnroll?
We use SpecFlow because we get used to it and we built a custom integration with Zephyr. But I will give a try to Regnroll. Thank you.