JBehave
  1. JBehave
  2. JBEHAVE-789

Allow meta filters to ignore stories listed in GivenStories

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.7
    • Fix Version/s: 3.9.1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      mvn 3.0.4
      Java version: 1.6.0_26
    • Number of attachments :
      2

      Description

      Running tests with meta filtering exclude scenarios from GivenStories if they do not matches meta filters.

      It forces to put in dependent stories/scenarios the same meta words as in top level scenario. That causes double executions of those scenarios - first time because they are in GivenStories and second time because they march meta filter.

      Should be:
      GivenStories override meta filters

      Actual:
      Meta filters override GivenStories.

      How to reproduce:
      1. Create story file with some scenario without any meta words.
      2. Create another story file with some scenario. In GivenStories add dependency to story file from 1). Add some meta filter.
      3. Run test with meta filtering.

      Expected:
      Executed scenario from story file 1 and 2
      Actual:
      Executed scenario from story file 2 and skipped scenario from story file 2.

      In attachment I have putted example story files. Put them In jbehahve example eatsy-selenium/java-spring and run test with maven command:
      mvn3 clean install -Dmeta.filter="+givenstories"

      1. etsy_browse_with_givenStories.story
        0.4 kB
        Zbigniew Zabost
      2. etsy_browse.story
        0.4 kB
        Zbigniew Zabost

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Fix Version/s 3.7.6 [ 19035 ]
        Mauro Talevi made changes -
        Fix Version/s 3.8 [ 19104 ]
        Fix Version/s 3.7.6 [ 19035 ]
        Mauro Talevi made changes -
        Fix Version/s 3.x [ 16979 ]
        Fix Version/s 3.8 [ 19104 ]
        Hide
        Ahmed Zaidi added a comment - - edited

        This can be worked around by specifying the Main story name or story names comma separated. However for the number of stories I need to run this is not practical. As of jbehave-core 3.8 this is still broken.

        Can we please get a fix?

        Show
        Ahmed Zaidi added a comment - - edited This can be worked around by specifying the Main story name or story names comma separated. However for the number of stories I need to run this is not practical. As of jbehave-core 3.8 this is still broken. Can we please get a fix?
        Hide
        Stephen de Vries added a comment -

        I've had to add a nasty hack to our testing framework in order to work around this bug. We use meta tags extensively to allow users to run individual stories and scenarios, but this breaks completely if the givenstories don't inherit those meta tags.

        Show
        Stephen de Vries added a comment - I've had to add a nasty hack to our testing framework in order to work around this bug. We use meta tags extensively to allow users to run individual stories and scenarios, but this breaks completely if the givenstories don't inherit those meta tags.
        Mauro Talevi made changes -
        Fix Version/s 3.x [ 16979 ]
        Fix Version/s 3.9.1 [ 19830 ]
        Hide
        Mauro Talevi added a comment -

        The behaviour should be configurable.

        Show
        Mauro Talevi added a comment - The behaviour should be configurable.
        Hide
        Mauro Talevi added a comment -

        Made behaviour configurable via StoryControls:

        StoryControls.doIgnoreMetaFiltersIfGivenStory(true)

        Show
        Mauro Talevi added a comment - Made behaviour configurable via StoryControls: StoryControls.doIgnoreMetaFiltersIfGivenStory(true)
        Mauro Talevi made changes -
        Resolution Fixed [ 1 ]
        Assignee Mauro Talevi [ maurotalevi ]
        Status Open [ 1 ] Resolved [ 5 ]
        Mauro Talevi made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Summary Meta filters excludes stories listed in GivenStories Allow meta filters to ignore stories listed in GivenStories

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Zbigniew Zabost
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: