Contributions
Re: Scenario Outline: parameters are converted to string when the feature is uploaded to cucumberStudio
Hello, Finally your R&D show me a better solution: In CucumberStudio set 0 as default value for numeric parameter (add = 0) and the following step implementation can be used: @Given("a price of "(.*)"$") public void a_price_of(double price) { //.... } The deal is that numeric types can't be used in annotations but it is acceptable4 years agoPlace CucumberStudioCucumberStudio4.6KViews2likes1CommentRe: Scenario Outline: parameters are converted to string when the feature is uploaded to cucumberStudio
Hello, R&D replied me that they won't be able to fix it quickly. For the time being here the workaround that I suggested to our dev team: 1/ use string parameter in feature files such as: Feature: numeric arguments are lost Scenario Outline: show loss of numeric types Given a price of "<price>" And the price parameter is an int in step implementation When the scenario is uploaded to cucumberStudio Then the price parameter becomes a string Examples: | price | | 30 | | 40 | 2/ Parse strings in step's implementation: @Given("a price of {string}") public void a_price_of(String sInt1) { int int1 = Integer.parseInt(sInt1); //.... }4 years agoPlace CucumberStudioCucumberStudio4.4KViews0likes2CommentsScenario Outline: parameters are converted to string when the feature is uploaded to cucumberStudio
Hello, Given the following feature file: Feature: numeric arguments are lost Scenario Outline: show loss of numeric types Given a price of <price> And the price parameter is an int in step implementation When the scenario is uploaded to cucumberStudio Then the price parameter becomes a string Examples: | price | | 30 | | 40 | And a java step definition such as: @Given("a price of {int}") public void a_price_of(Integer int1) { // } When the feature file is uploaded to cucumberStudio And the feature file is generated for a given test run Then the step become "Given a price of "<price>"" (additional quotes around the parameter) And cucumber expect this definition: @Given("a price of {String}") public void a_price_of(String price) { // } How to keep numeric types for step parameters? Note the feature file generated by hiptest-publisher is: Feature: numeric arguments are lost Scenario Outline: show loss of numeric types (<hiptest-uid>) Given a price of "<price>" And the price parameter is an int in step implementation When the scenario is uploaded to cucumberStudio Then the price parameter becomes a string Examples: | price | hiptest-uid | | 30 | uid:61e34ec9-130f-49de-b8ab-8a007c11d1ce | | 40 | uid:ecc15e25-fc84-48cc-a79c-1092df7d44ce |Solved4 years agoPlace CucumberStudioCucumberStudio4.6KViews0likes4Comments