JBehave
  1. JBehave
  2. JBEHAVE-801

Not expected behavior of parametrised tables

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.6.3
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      I tested it on 3.6.3 and 3.6.8 versions.
    • Testcase included:
      yes
    • Number of attachments :
      3

      Description

      I try to use parametrised tables in similar way that described here:
      http://jbehave.org/reference/stable/tabular-parameters.html

      I wrote following story:

      Scenario: test

      Given parameters:

      column1 column2
      value1 <values>

      Examples:

      <values>
      value1
      value2

      Also i tried this version:

      Scenario: test

      Given parameters:

      column1 column2
      value1 <values>

      Examples:

      values
      value1
      value2

      And this is my step:

      @Given("parameters: $table")
      public void readParameters(ExamplesTable table) {
      for (Map<String, String> row : table.getRows())

      { System.out.println(row.get("column1")+" "+row.get("column2")); }

      }

      Expected result:
      Output is:
      key value1
      key value2

      Actually result:
      Output is:
      key <values>
      key <values>

      Also, you can find story and tests in attachments.

      1. ParameterTest.java
        2 kB
        Eugeny Batov
      2. ParameterTestSteps.java
        0.5 kB
        Eugeny Batov
      3. Test.story
        0.1 kB
        Eugeny Batov

        Activity

        Hide
        Mauro Talevi added a comment -
        Show
        Mauro Talevi added a comment - This scenario is already verified in https://github.com/jbehave/jbehave-core/blob/master/examples/trader/src/main/java/org/jbehave/examples/trader/stories/parametrised_table.story See if you can run it and get the expected behaviour.
        Hide
        Eugeny Batov added a comment -

        I deleted all <> from my story file, but it didn't give any effect.
        I am still have output:
        value1 values
        value1 values

        Show
        Eugeny Batov added a comment - I deleted all <> from my story file, but it didn't give any effect. I am still have output: value1 values value1 values
        Hide
        Mauro Talevi added a comment -

        That's not what I meant. The parametrised_table.story shows that your behaviour is verified and working.

        So, please try running it from the examples http://jbehave.org/reference/stable/running-examples.html and if it works (as it should) model your configuration on it.

        Show
        Mauro Talevi added a comment - That's not what I meant. The parametrised_table.story shows that your behaviour is verified and working. So, please try running it from the examples http://jbehave.org/reference/stable/running-examples.html and if it works (as it should) model your configuration on it.
        Hide
        Eugeny Batov added a comment -

        I made minor changes accordingly example.
        I replaced
        for (Map<String, String> row : table.getRows())
        on
        for (Parameters row : table.getRowsAsParameters(true))
        in my steps and now it works.
        Thank you for support.

        Show
        Eugeny Batov added a comment - I made minor changes accordingly example. I replaced for (Map<String, String> row : table.getRows()) on for (Parameters row : table.getRowsAsParameters(true)) in my steps and now it works. Thank you for support.
        Eugeny Batov made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Eugeny Batov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: