Scenario metadata overwrite

Description

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.

Attachments

4
  • 20 Nov 2015, 06:33 PM
  • 20 Nov 2015, 06:33 PM
  • 26 Oct 2015, 06:55 PM
  • 26 Oct 2015, 06:54 PM

Activity

Show:

Kobi Gana December 10, 2015 at 9:54 AM

Mauro Talevi December 1, 2015 at 5:35 PM

PR has been applied. Could you please also provide as a PR the executable example story to verify this issue?

Brian Saylor November 20, 2015 at 6:34 PM

Pull request #104 has a fix for this issue.

Brian Saylor November 20, 2015 at 6:34 PM

Adding specific Story and steps which can be executed to view the issue and fix.

Brian Saylor October 26, 2015 at 6:56 PM

I have attached a sample Story and Steps files. The expected and actual output for the attached story/steps is below.

=== Expected Output ===
Brand: ONE: /page1
Brand: TWO : /page2
Brand: THREE : /page3

=== Actual Output ===
Brand: THREE : /page1
Brand: THREE : /page2
Brand: THREE : /page3

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created October 16, 2015 at 4:48 PM
Updated February 6, 2016 at 3:42 PM
Resolved February 6, 2016 at 3:42 PM

Flag notifications