JBehave
  1. JBehave
  2. JBEHAVE-837

Step parameters incorrectly marked in the reports

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7
    • Fix Version/s: 3.7.1, 3.8
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Win XP, Java 1.6
    • Number of attachments :
      0

      Description

      The issue occurs only when a step has more than one parameter, and the value of at least one of those parameters is found as a part of another parameter (a parameter value is a substring of another parameter value).

      E.g.
      Step:
      Given a stock of symbol $symbol and a threshold of $threshold
      Step usage:
      Given a stock of symbol ABC13DEF and a threshold of 13
      In the report:
      Given a stock of symbol ABC13 DEF and a threshold of 13

      The issue is due to a flawed implementation in StepCreator class, method replaceParameterValue(). We need a more elaborated replace algorithm in order to take into account this kind of special cases.
      Once a parameter is replaced with the value bearing the start/end placeholders, it should become "locked"; we don't want the next parameter value replacement to replace values into the previous ones.

      Also the replacement of parameters values in step should be driven by parameters values length not by position to avoid partial replacements. (see parametrisedStep() method)

        Activity

        Hide
        Mauro Talevi added a comment -

        Improved parameter value identification by space delimiters.

        Added unit-level verification and scenario to parameter_delimiters.story.

        Show
        Mauro Talevi added a comment - Improved parameter value identification by space delimiters. Added unit-level verification and scenario to parameter_delimiters.story.
        Mauro Talevi made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.7.1 [ 18790 ]
        Resolution Fixed [ 1 ]
        Mauro Talevi made changes -
        Fix Version/s 3.8 [ 19104 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Catalin Sandila
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: