cucumber-api icon indicating copy to clipboard operation
cucumber-api copied to clipboard

When I grab the json result as a veriable in a Scenario,how can I use it in other Scenario

Open Donghaopeng opened this issue 5 years ago • 4 comments

When I grab the json result as a veriable in a Scenario,how can I use it in other Scenario.

Scenario: One
...
Then I grab wallet address "$..address" as "company_address"
...
Scenario: Two
...
When I set JSON request body to:
    """
      {
        "company_address": "{company_address}"
    """
When I send a POST request to "{url}"
...

But,in the Scenario Two, company_address'value is not what I want.

Donghaopeng avatar Jul 12 '18 09:07 Donghaopeng

Placeholders won't work inside triple quotes unfortunately.

hidroh avatar Jul 17 '18 13:07 hidroh

@hidroh ,in the same Scenario, I just use this method:resolve(), it worked. But in the same Feature, diffrent Scenario,it can't work.

Donghaopeng avatar Jul 19 '18 03:07 Donghaopeng

Placeholders won't work inside triple quotes unfortunately.

I have a quick and dirty version of this that I have been using which works for my needs. I'll put it in a PR to see if you think it might be worth adding.

biggianteye avatar Jul 23 '18 16:07 biggianteye

Thanks very much.

Donghaopeng avatar Sep 05 '18 06:09 Donghaopeng