Loading data dynamically from a properties file in jbehave story

How can I dynamically load data from a .properties file into a jBehave history file? I used $ in my history file, for example:

When the stock is traded at price : $<price>
Then the alert status should be $<status>

I am trying to get values ​​from both the properties file located in my src / test / resources folder and have included my .properties file in pom.xml for example

    <testResource>
<directory>${basedir}/src/test/resources</directory>
<filtering>false</filtering>
<includes>
include>**/*.properties</include>
</includes>
    </testResource>

But still it doesn’t work. When I try to run "mvn integration-test" on my cmd. It throws me this exception

org.json.JSONException: A JSONObject text must begin with '{' at character 1
    at org.json.JSONTokener.syntaxError(JSONTokener.java:410)
    at org.json.JSONObject.<init>(JSONObject.java:179)
    at org.json.JSONObject.<init>(JSONObject.java:402)....

I am not sure where I will be wrong. Please help me. Waiting for an answer !! -Tester

+4
source share
2 answers

. , , :

When the stock is traded at price : <price>
Then the alert status should be <status>
Examples:
|price|status|
|10.00|low|
|20.00|medium|
|50.00|high|

, $ < > . < > $, , JBehave .

, ( ) , , .

Examples:
TableFiles/storystats.table

, , .

0

enviornment (, QA, UAT Prod), ?

,
:
/$ {}/testdata.table

0

Source: https://habr.com/ru/post/1533546/


All Articles