JBehave
  1. JBehave
  2. JBEHAVE-1067

it is not possible to comment a scenario with !--

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      If you write a scenario with parameter see example, and comment the next scenario with !--. Then the previous when doesn't work.

      Example: This will not work

      Scenario: example
      When using profiles

      profile
      WEBSOCKET 1

      !-- Scenario: xxx

      The scenario example will not work, because he think that !-- Scenario: xxx is a parameter.

      But if you comment something else like (!-- example comment) after the example scenario. It will work correct.

      Example: This will work

      Scenario: example
      When using profiles

      profile
      WEBSOCKET 1

      !-- example comment

        Activity

        Anil Rasouli made changes -
        Field Original Value New Value
        Description If you write a scenario with parameter see example, and comment the next scenario with !--. Then the previous when doesn't work.

        Example: This will not work

        Scenario: example
        When using profiles
        |profile|
        |WEBSOCKET 1 |

        !-- Scenario: xxx

        The scenario example will not work, because he think that Scenario is a parameter.

        But if you comment something else like (!-- example comment) after the example scenario. It will work correct.

        Example: This will work

        Scenario: example
        When using profiles
        |profile|
        |WEBSOCKET 1 |

        !-- example comment
        If you write a scenario with parameter see example, and comment the next scenario with !--. Then the previous when doesn't work.

        Example: This will not work

        Scenario: example
        When using profiles
        |profile|
        |WEBSOCKET 1 |

        !-- Scenario: xxx

        The scenario example will not work, because he think that !-- Scenario: xxx is a parameter.

        But if you comment something else like (!-- example comment) after the example scenario. It will work correct.

        Example: This will work

        Scenario: example
        When using profiles
        |profile|
        |WEBSOCKET 1 |

        !-- example comment
        Hide
        Brent Barker added a comment - - edited

        Does using the table comment work?

        Scenario: example
        When using profiles
        |profile|
        |WEBSOCKET 1|
        
        |-- Scenario: xxx
        
        |-- (pipe dash dash) instead of !--
        
        Show
        Brent Barker added a comment - - edited Does using the table comment work? Scenario: example When using profiles |profile| |WEBSOCKET 1| |-- Scenario: xxx |-- (pipe dash dash) instead of !--
        Hide
        Anil Rasouli added a comment -

        No it does not work. With |-- it marked as Pending.

        With !-- it is only a error after a When statement. After other statements it marked as pending.

        And only if the comment start with scenario:

        Show
        Anil Rasouli added a comment - No it does not work. With |-- it marked as Pending. With !-- it is only a error after a When statement. After other statements it marked as pending. And only if the comment start with scenario:
        Hide
        Mauro Talevi added a comment -

        No, it's not possible to comment a scenario with !--

        If you want to skip the execution of a scenario, you should annotated it with a meta property, e.g.:

        Scenario:
        Meta: @skip

        And use a filter "-skip" to avoid running the scenarios annotated with this property.

        Show
        Mauro Talevi added a comment - No, it's not possible to comment a scenario with !-- If you want to skip the execution of a scenario, you should annotated it with a meta property, e.g.: Scenario: Meta: @skip And use a filter "-skip" to avoid running the scenarios annotated with this property.
        Hide
        Anders Ekstrom added a comment -

        I would say this is definitely a bug.
        This behavior is not consistent with what, at least, I would expect.
        Show me where in the language specification this behavior is defined.

        The parsing of JBehave stories is a bit strange at some times to say the least.
        Maybe the JBehave parser could be revised to be more well defined, when time allows?

        If a rewrite will be considered, the Xtext project might be a good fit for the job:
        The Xtext project simplifies the creation of domain specific languages.
        Check this out:
        https://eclipse.org/Xtext/

        As a real bonus, when using Xtext to implement a language, an Eclipse plugin will also be generated for you, with syntax coloring, content assist, and more.

        Show
        Anders Ekstrom added a comment - I would say this is definitely a bug. This behavior is not consistent with what, at least, I would expect. Show me where in the language specification this behavior is defined. The parsing of JBehave stories is a bit strange at some times to say the least. Maybe the JBehave parser could be revised to be more well defined, when time allows? If a rewrite will be considered, the Xtext project might be a good fit for the job: The Xtext project simplifies the creation of domain specific languages. Check this out: https://eclipse.org/Xtext/ As a real bonus, when using Xtext to implement a language, an Eclipse plugin will also be generated for you, with syntax coloring, content assist, and more.

          People

          • Assignee:
            Unassigned
            Reporter:
            Anil Rasouli
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: