Omitting paramNameRegex and paramValueRegex results in error
delatrie opened this issue · 0 comments
delatrie commented
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?
Omitting paramNameRegex
and paramValueRegex
of specflow.stepArguments
in allureConfig.json
results in the following error if a step contains a two-column data table:
Message:
System.ArgumentNullException : Value cannot be null. (Parameter 'pattern')
Stack Trace:
ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)
RegexCache.GetOrAdd(String pattern)
Regex.IsMatch(String input, String pattern)
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.Then(String text, String multilineTextArg, Table tableArg, String keyword)
SelectiveRunTestRunner.CallStepOfSelectedScenario(Action`4 stepFn, String text, String multilineTextArg, Table tableArg, String keyword)
SelectiveRunTestRunner.Then(String text, String multilineTextArg, Table tableArg, String keyword)
MyFeatureFeature.MyScenario() line 8
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
allureConfig.json:
{
"specflow": {
"stepArguments": {
"convertToParameters": "true"
}
}
}
The feature file:
Feature: My feature
Scenario: My scenario
Then a step with a table
|a|b|
|1|2|
The step definition:
using Allure.Net.Commons;
using TechTalk.SpecFlow;
namespace ClassLibrary2;
[Binding]
public class Class1
{
[Then("a step with a table")]
public void MyStep(Table table)
{
}
}
What is the expected behavior?
Tables with two columns should be either skipped (i.e., converted to attachments) or, probably, converted to step parameters according to the rules for horizontal data tables.
What is the motivation / use case for changing the behavior?
Some users might want to convert one-row tables to parameters while skipping all two-column tables with more than one row entirely.
Currently, there is no way of doing this. Users are forced to make up name and value patterns that don't match enything.
Please tell us about your environment:
- Test framework: SpecFlow@3.9.74
- Runner: SpecFlow.NUnit@3.9.74
- Allure adapter: Allure.SpecFlow@2.11.0