diff --git a/src/com/qmetry/qaf/automation/step/client/gherkin/GherkinFileParser.java b/src/com/qmetry/qaf/automation/step/client/gherkin/GherkinFileParser.java index 35e7b22c..8ccdf18a 100644 --- a/src/com/qmetry/qaf/automation/step/client/gherkin/GherkinFileParser.java +++ b/src/com/qmetry/qaf/automation/step/client/gherkin/GherkinFileParser.java @@ -34,6 +34,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.json.JSONObject; import com.qmetry.qaf.automation.core.AutomationError; import com.qmetry.qaf.automation.step.client.AbstractScenarioFileParser; @@ -258,7 +259,7 @@ private void setExamples(Object[] cols, ArrayList> examplesTable) { Map map = new LinkedHashMap(); for (int k = 0; k < keys.size(); k++) { Object val = examplesTable.get(i).get(k); - map.put(keys.get(k), null!=val?val.toString().trim():null); + map.put(keys.get(k), val); } dataMapList.add(map); } diff --git a/src/com/qmetry/qaf/automation/step/client/text/BDDFileParser2.java b/src/com/qmetry/qaf/automation/step/client/text/BDDFileParser2.java index d274effb..afa1975c 100644 --- a/src/com/qmetry/qaf/automation/step/client/text/BDDFileParser2.java +++ b/src/com/qmetry/qaf/automation/step/client/text/BDDFileParser2.java @@ -37,6 +37,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.json.JSONObject; import com.qmetry.qaf.automation.core.AutomationError; import com.qmetry.qaf.automation.step.client.AbstractScenarioFileParser; @@ -299,7 +300,7 @@ private void setExamples(Object[] cols, ArrayList> examplesTable) { Map map = new LinkedHashMap(); for (int k = 0; k < keys.size(); k++) { Object val = examplesTable.get(i).get(k); - map.put(keys.get(k), null!=val?val.toString().trim():null); + map.put(keys.get(k), val); } dataMapList.add(map); } diff --git a/src/com/qmetry/qaf/automation/util/StringUtil.java b/src/com/qmetry/qaf/automation/util/StringUtil.java index 20a5d068..b84b2ad5 100644 --- a/src/com/qmetry/qaf/automation/util/StringUtil.java +++ b/src/com/qmetry/qaf/automation/util/StringUtil.java @@ -526,10 +526,14 @@ public static T eval(String expression, Map" status "" of "" +Examples: + + | description| name | married | age | + | go right | uname | true | 5 | + | go right | "uname "| false | 0 | + | check null | null | null | null | + | check null | "null" | "null" | "null" | + | check empty | | | | + | check number | " 12345" | true | 0 | + + + @dataFile:resources/testdata2.txt + Scenario: External test data step call + Then it can have "" status "" of "" + + #empty or null not allowed for Primitive types step argument + Scenario: Embedded Examples step call primptive + And it should have status "" of "" +Examples: + + | description| name | married | age | + | go right | uname | true | 5 | + | go right | uname | false | 0 | + | empty string | | false | 0 | + | null string | null | false | 0 | + + + + diff --git a/test/resources/testdata2.txt b/test/resources/testdata2.txt new file mode 100644 index 00000000..decd05db --- /dev/null +++ b/test/resources/testdata2.txt @@ -0,0 +1,8 @@ +#empty or null not allowed for Primitive types step argument +description, name , married , age +csv go right , uname , true , 5 +csv go right , "uname ", false , 0 +csv check null , null , null , null + csv check null , "null" , "null" , "null" + csv check empty , , , + diff --git a/test/src/com/qmetry/qaf/automation/impl/step/qaf/QAFTestStepImpl.java b/test/src/com/qmetry/qaf/automation/impl/step/qaf/QAFTestStepImpl.java index 10780360..7f3d2dc5 100644 --- a/test/src/com/qmetry/qaf/automation/impl/step/qaf/QAFTestStepImpl.java +++ b/test/src/com/qmetry/qaf/automation/impl/step/qaf/QAFTestStepImpl.java @@ -149,4 +149,16 @@ public void itShouldHaveEntriesInData(Map entries, Map