JBehave
  1. JBehave
  2. JBEHAVE-786

if include instruction are alone, then the included steps are ignored.

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.6
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows XP - Maven 2.2.1 - JDK 1.5 - JBehave with WebDriver - French
    • Number of attachments :
      0

      Description

      Hello,
      In my stories, some scenarios are factored in included files with no parameters. It is just a simple way to avoiding duplicates steps. Examples use case : share between 'create' and 'update' stories.

      When the include instruction are alone
      Then Jbehave doesnt execute the steps of included file

      When the include instruction is followed by simple a comment
      Then Jbehave execute the included steps

      Regards,
      Thomas Montembault

      Example :
      ---------

      Fail :
      Scénario: Tester les champs d'édition
      Etant donné les Histoires: stories/personne/include/personneEdit.include

      Succes :

      Scénario: Tester les champs d'édition
      Etant donné les Histoires: stories/personne/include/personneEdit.include
      !-- Un commentaire pour permettre prise en charge du scénario inclu

      personneEdit.include
      --------------------

      Scénario: Test Trigramme
      Quand l'utilisateur saisit '' dans le champ 'Trigramme'
      Quand l'utilisateur clique sur le bouton 'enregistrer'
      Alors la page doit afficher un message de validation '"Trigramme": Une donnée est requise.'
      Quand l'utilisateur saisit '_txt(2)' dans le champ 'Trigramme'
      Quand l'utilisateur clique sur le bouton 'enregistrer'
      Alors la page doit afficher un message de validation '"Trigramme": La donnée doit comporter au moins 3 caractères.'
      Quand l'utilisateur saisit '_txt(4)' dans le champ 'Trigramme'
      Quand l'utilisateur clique sur le bouton 'enregistrer'
      Alors la page doit afficher un message de validation '"Trigramme": La donnée a plus que les 3 caractères maximum autorisés.'
      Quand l'utilisateur saisit '_txt(3)' dans le champ 'Trigramme'

      ... idem pour tout les champs de saisies

        Activity

        Hide
        Mauro Talevi added a comment -

        GivenStories represent preconditions to a scenario, which is defined by its steps. If a scenario contains no steps then it's considered void and the given stories are not run.

        So, this is not a bug. If you want to run the given stories by themselves you can do directly.

        The workaround, as you've noted, is to use a comment as an ignorable step in the scenario to trigger the running of the given stories.

        Show
        Mauro Talevi added a comment - GivenStories represent preconditions to a scenario, which is defined by its steps. If a scenario contains no steps then it's considered void and the given stories are not run. So, this is not a bug. If you want to run the given stories by themselves you can do directly. The workaround, as you've noted, is to use a comment as an ignorable step in the scenario to trigger the running of the given stories.

          People

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

            Dates

            • Created:
              Updated: