JBehave
  1. JBehave
  2. JBEHAVE-528

Examples Table for subset of steps

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4
    • Fix Version/s: 3.x
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      http://jbehave.org/reference/stable/tabular-parameters.html is great, but pertains to a single step.

      Given I'm on the FooBar Page which is 20 mins of clicking through prelim pages
      When I enter <foo> in the foo field
      Then the bar field is auto-completed with <bar>

      Examples:

      foo bar
      eggs bacon
      toast marmite

      http://jbehave.org/reference/stable/parametrised-scenarios.html suggests that all the Given/When/Then steps are repeated.

      In the linked-to example, it is the only one given. What this change is about is the fact that only the When/Then steps need to be repeated. This is implicit because the Given line does not refer to any of the table params.

      If this needs to be explicit, it could be a team's choice to set this for the entire set of stories:

      configuration.setPartialExamplesTablesExpansionPerScenario(true);

      Or it could be specified in the story itself:

      Given I'm on the FooBar Page which is 20 mins of clicking through prelim pages
      When I enter <foo> in the foo field
      Then the bar field is auto-completed with <bar>

      Examples(1-2):

      foo bar
      eggs bacon
      toast marmite

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Description http://jbehave.org/reference/stable/tabular-parameters.html is great, but pertains to a single step.

        {quote}
        Given I'm on the FooBar Page which is 20 mins of clicking through prelim pages
        When I enter <foo> in the foo field
        Then the bar field is auto-completed with <bar>

        Examples:
        | foo | bar |
        | eggs | bacon |
        | toast | marmite |
        {quote}

        http://jbehave.org/reference/legacy/table-examples.html (note no /stable/ version of this page) gives the general theme, but suggests that all the Given/When/Then steps are repeated.

        In the linked-to example, it is the only one given. What this change is about is the fact that only the When/Then steps need to be repeated. This is implicit because the Given line does not refer to any of the table params.

        If this needs to be explicit, it could be a team's choice to set this for the entire set of stories:

        bq. configuration.setPartialExamplesTablesExpansionPerScenario(true);

        Or it could be specified in the story itself:

        {quote}
        Given I'm on the FooBar Page which is 20 mins of clicking through prelim pages
        When I enter <foo> in the foo field
        Then the bar field is auto-completed with <bar>

        Examples(1-2):
        | foo | bar |
        | eggs | bacon |
        | toast | marmite |
        {quote}
        http://jbehave.org/reference/stable/tabular-parameters.html is great, but pertains to a single step.

        {quote}
        Given I'm on the FooBar Page which is 20 mins of clicking through prelim pages
        When I enter <foo> in the foo field
        Then the bar field is auto-completed with <bar>

        Examples:
        | foo | bar |
        | eggs | bacon |
        | toast | marmite |
        {quote}

        http://jbehave.org/reference/stable/parametrised-scenarios.html suggests that all the Given/When/Then steps are repeated.

        In the linked-to example, it is the only one given. What this change is about is the fact that only the When/Then steps need to be repeated. This is implicit because the Given line does not refer to any of the table params.

        If this needs to be explicit, it could be a team's choice to set this for the entire set of stories:

        bq. configuration.setPartialExamplesTablesExpansionPerScenario(true);

        Or it could be specified in the story itself:

        {quote}
        Given I'm on the FooBar Page which is 20 mins of clicking through prelim pages
        When I enter <foo> in the foo field
        Then the bar field is auto-completed with <bar>

        Examples(1-2):
        | foo | bar |
        | eggs | bacon |
        | toast | marmite |
        {quote}
        Hide
        Mauro Talevi added a comment -

        Composite steps (http://jbehave.org/reference/stable/composite-steps.html) is one option that allows to group a subset of scenario steps.

        Another approach is to have the part that is not repeated contained in a GivenStory precondition, leaving the repeated steps in the parametrised scenario.

        Supporting the tabular parameters for arbitrary subset of steps is likely to be non trivial, and possibly confusing unless we can come up with a clear way to spell out which steps are executed in which order.

        Show
        Mauro Talevi added a comment - Composite steps ( http://jbehave.org/reference/stable/composite-steps.html ) is one option that allows to group a subset of scenario steps. Another approach is to have the part that is not repeated contained in a GivenStory precondition, leaving the repeated steps in the parametrised scenario. Supporting the tabular parameters for arbitrary subset of steps is likely to be non trivial, and possibly confusing unless we can come up with a clear way to spell out which steps are executed in which order.
        Hide
        Brian Repko added a comment -

        GivenStory was exactly what I was thinking. I'm concerned that we don't have a clear model of what can happen when during the execution of a story/scenario/step and having a clear definition of what is there might help us identify the gaps. That's where my head is at on this.

        Show
        Brian Repko added a comment - GivenStory was exactly what I was thinking. I'm concerned that we don't have a clear model of what can happen when during the execution of a story/scenario/step and having a clear definition of what is there might help us identify the gaps. That's where my head is at on this.
        Mauro Talevi made changes -
        Fix Version/s 3.x [ 16979 ]
        Fix Version/s 3.5 [ 17393 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Hammant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: