Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How do I convert a parameter in an example table to an integer in a Cucumber feature?

$
0
0

If I have a feature that has a line like this:

Then I get the status code "<Status Code">.

and an example table with like this:

Examples:   | StatusCode |   |        200 |

and a step definition like this:

@Then("I get the status code {int}.")

Cucumber complains and says that the step is undefined, because it's expecting the type to be {string}. Is there a way to specify the type in the feature or the example table? I've looked into the TypeRegistryConfiguration but I can't work out how to make it work with feature files.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>