allure-framework / allure-framework/allure-csharp
SpecFlow: More informative error message if Allure.SpecFlowPlugin entry is missing in specflow.json
- Dominant language
- C#
- Stars
- 125
- Forks
- 76
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 18
Description
#### I'm submitting a ...
- [ ] bug report
- [x] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.
#### What is the current behavior?
Example of the error that is thrown if `Allure.SpecFlowPlugin` is missing in `specflow.json`:
```
Message:
System.InvalidOperationException : No fixture, test, or step context is active.
Stack Trace:
AllureContext.get_CurrentStepContainer()
AllureLifecycle.StartStep(StepResult result)
AllureTestTracerWrapper.StartStep(StepInstance stepInstance)
ITestTracer.TraceStep(StepInstance stepInstance, Boolean showAdditionalArguments)
TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance)
TestExecutionEngine.Step(StepDefinitionKeyword stepDefinitionKeyword, String keyword, String text, String multilineTextArg, Table tableArg)
TestRunner.Given(String text, String multilineTextArg, Table tableArg, String keyword)
SelectiveRunTestRunner.CallStepOfSelectedScenario(Action`4 stepFn, String text, String multilineTextArg, Table tableArg, String keyword)
SelectiveRunTestRunner.Given(String text, String multilineTextArg, Table tableArg, String keyword)
ScenarioAndStepOutcomesFeature.AllStepsPassed() line 5
```
#### What is the expected behavior?
A clear message instructing the user to add the missing entry.
#### What is the motivation / use case for changing the behavior?
It would help newcomers to setup Allure for their SpecFlow projects.
#### Please tell us about your environment:
- Test framework: SpecFlow@3.9.74
- Runner: Specflow.NUnit@3.9.74
- Allure adaptor: Allure.SpecFlow@2.10.0
Contributor guide
Research direction
Start from the SpecFlow setup that reads specflow.json and the AllureContext.CurrentStepContainer failure shown in the stack trace. Reproduce the issue with Allure.SpecFlow 2.10.0, SpecFlow 3.9.74, and Specflow.NUnit 3.9.74 while omitting Allure.SpecFlowPlugin. Done means the failure clearly instructs users to add the missing entry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100