Closed
Description
Describe the bug
Upgrading to version 7.2.0/7.2.1 breaks some of our existing scenarios where a docstring with content type is used but no custom DocStringType
is defined.
To Reproduce
Scenario:
Feature: test
@test
Scenario: test
Given I have some json docstring without DocStringType
"""json
{}
"""
Glue code:
@Given("I have some json docstring without DocStringType")
public void test(String str) {
assertEquals("{}", str);
}
Error:
io.cucumber.core.exception.CucumberException: Could not convert arguments for step [I have some json docstring without DocStringType] defined at 'features.steps.Steps.test(java.lang.String)'.
at io.cucumber.core.runner.PickleStepDefinitionMatch.couldNotConvertArguments(PickleStepDefinitionMatch.java:112)
at io.cucumber.core.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:56)
...
Caused by: io.cucumber.docstring.CucumberDocStringException: It appears you did not register docstring type for 'json' or java.lang.String
at io.cucumber.docstring.DocStringTypeRegistryDocStringConverter.convert(DocStringTypeRegistryDocStringConverter.java:36)
at io.cucumber.docstring.DocString.convert(DocString.java:55)
at io.cucumber.core.stepexpression.StepExpressionFactory.lambda$createExpression$1(StepExpressionFactory.java:72)
at io.cucumber.core.stepexpression.DocStringArgument.getValue(DocStringArgument.java:19)
at io.cucumber.core.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:47)
... 39 more
Expected behavior
I'm not sure if the usage we had until now was supposed to be working but it actually was, thus I would expect no change for a minor version upgrade.
Moreover I'd like to be able to define content type on docstring without having to explicitly define a DocStringType
if the step is expecting a String
. Shouldn't there be a default converter to String
?
Your Environment
- Versions used: 7.2.1
Metadata
Metadata
Assignees
Labels
No labels