Search code examples
javatddjbehavethucydidesatdd

How to workaround jbehave bug when combining meta parameters and example table


I'm using project made from 0.9.229 thucydides-jbehave archetype. Here I have some jbehave story:

Narrative:
Some text
Meta:

@registrator1 666-126
@registrator2 666-127
@reg1 666126
@reg1 666127
@ip 172.16.1.2
@zone1 666-126-666-127

Scenario: A
Given the user is logged to zonemanager as 'admin' with password 'admin'

Scenario: B
Then user creates new registrator <registrator1> with IP <ip>
Then user creates new registrator <registrator2> with IP <ip>

Scenario: C
Then user creates new bunch with 'Тестовый участок'
And user creates new zone with 'Тестовая зона','Встречное', '60'
And user selects <registrator1> for first new point 'Тестовая 666126' with latitude '55.730229', longitude '48.921177'
And user selects <registrator2> for second new point 'Тестовая 666127' with latitude '55.710411', longitude '48.896223'
And user completes the zone creation

Scenario: D
Given the user is logged to adminconsole as 'admin' with password 'password'
And the user switches to zones
Then the user adds <registrator1> into adminconsole with region 'Татарстан', code <zone1>, location <zone1>, location code <zone1>
And the user switches to services
And the user adds service for <registrator1>
And the user exits adminconsole

Scenario: E
Given the ftp server is started

Scenario: F
Given the folder structure is created for <reg1>
And the folder structure is created for <reg2>
And the first registrator has number <reg1> name <registrator1> latitude '55.730229', longitude '48.921177' height '79.099998' deltafix '10' type 'TEXT' version '4.0'
And the second registrator has number <reg2> name <registrator2> latitude '55.710411', longitude '48.896223' height '79.090098' deltafix '10' type 'TEXT' version '4.0'
When the first registered number is <number> priority zone '1' lane number '1' lane type '2'  movement direction '1' light '1' valid time '1'
And car goes <speed> km/h from latitude '55.730229', longitude '48.921177' to latitude '55.710411', longitude '48.896223'
And the second registered number is <number> priority zone '1' lane number '1' lane type '2'  movement direction '1' light '1' valid time '1'
And the ftp server has sent packet for user <reg1>
And the ftp server has sent packet for user <reg2>
Then the search result brings us 'Х563ХВ' with fuzzy equals '0'
Given the 'https://172.16.1.1:8181/WebServices/ProcessingData' service consumer is logged as 'oper602' with password 'oper602'
And the marker value is taken from temprorary file
Then the received cars are <number> with speed <speed>
And the marker value is stored to temprorary file

Examples:
|number|speed|
|Е642РВ 116 RUS|182.0|
|С899КС 121 RUS|179.0|
|Е190АМ 21 RUS|176.0|
|Е190АМ 22 RUS|177.0|
|У183ХЕ 12 RUS|181.0|
|В958РС 02 RUS|177.0|
|Е190АМ 21 RUS|177.0|

The wrong thing occurs in step F when Example table coexists with meta. As debugger revealed, the values passed to the underlying methods in

And the first registrator has number <reg1> name <registrator1> latitude '55.730229', longitude '48.921177' height '79.099998' deltafix '10' type 'TEXT' version '4.0'

in <reg1> is not actually the @reg1 value in Meta, but... the Examples's 'number' value. And the value passed instead of <registrator1> is actually longitude value taken not clearly from. So, the question is how I can correctly combine Meta with Example in the same story and same scenario?


Solution

  • According to Bence's comment, just update thucydides to 0.9.273 is okay!