Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Overview A bug was introduced with the 4.0 release which effects scenario level metadata. If scenario level metadata is passed into steps as named parameters, then the wrong values are sometimes used. For example, the scenario 3 metadata is passed into the scenario 1 step.
Details It appears that the PerformableStory is constructed, a property map is passed into each PerformableScenario where it is flushed out with Story and Scenario level metadata and then stored with the PerformableScenario for named parameter matching when the scenario is run. However all PerformableScenarios are sharing the same NamedParameter map passed in from the PerformableStory. Therefore when each scenario is parsed and the PerformableScenario created, the map is updated which effects all the scenarios.
Impact Test suites that were written against 3.x and use scenario level metadata within their steps fail or report incorrect results when upgrading to JBehave 4.x.
Fix The PerformableScenarios need to create and store a separate copy of the NamedParameter map to that this overwriting does not occur.
Overview
A bug was introduced with the 4.0 release which effects scenario level metadata. If scenario level metadata is passed into steps as named parameters, then the wrong values are sometimes used. For example, the scenario 3 metadata is passed into the scenario 1 step.
Details
It appears that the PerformableStory is constructed, a property map is passed into each PerformableScenario where it is flushed out with Story and Scenario level metadata and then stored with the PerformableScenario for named parameter matching when the scenario is run. However all PerformableScenarios are sharing the same NamedParameter map passed in from the PerformableStory. Therefore when each scenario is parsed and the PerformableScenario created, the map is updated which effects all the scenarios.
Impact
Test suites that were written against 3.x and use scenario level metadata within their steps fail or report incorrect results when upgrading to JBehave 4.x.
Fix
The PerformableScenarios need to create and store a separate copy of the NamedParameter map to that this overwriting does not occur.