common icon indicating copy to clipboard operation
common copied to clipboard

General/Dotnet: Tag support on Rules

Open ron-myers opened this issue 6 years ago • 5 comments

Summary

Currently, on the dotnet implementation Rule does not support Tags. Is this by design or missing functionality?

I searched for a discussion on this topic and did not find anything (but may have missed it).

If this is missing functionally, I am happy to submit a PR with this and some associated tests.

Expected Behavior

Expect that gherkin such as:

@example
Feature: an example of a feature file

Functional requirement, user story, or job to be done.

# General comment

Background:
    Given an input that applies to all rules, scenarios, and examples

@work-in-progress @wip
Rule: a group of related scenarios

    Background:
        Given an input for all scenarios of this rule

    Scenario: we give an example
        # this keyword can be: Scenario, Example
        Given another input
        When I do an action
        Then I expect this output

    Scenario Template: we give another example, with many examples
        # this keyword can be: scenario, scenario template, scenario outline
        Given another <input>
        When I do an <action>
        Then I expect this <output>

        Examples: unique examples of this scenario

        | input | action | output |
        | 1     | 2      | 3      |
        | 2     | 3      | 4      |

Rule: another group of related scenarios

    Scenario: an example with doc strings and data tables
        Given a markdown input with the following content:
        """
            **Hello world**
        """ 
        When I edit the markdown,
        Then I expect the editor to have dispatched one of the following:
        | Action    |
        | bold      |
        | type      |
        | backspace |

is valid.

After reviewing the docs, it does not appear to be explicit to if this is something that should be supported or not.

Current Behavior

Parse errors:

12:1 InvalidGherkin - Expected keyword or gherkin property not found. Make sure you are following proper Gherkin syntax. Details are: Parser errors:
(12:1): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Rule: a group of related scenarios'
(14:5): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Background:'
(15:9): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Given an input for all scenarios of this rule'
 14:5 InvalidGherkin - Expected keyword or gherkin property not found. Make sure you are following proper Gherkin syntax. Details are: Parser errors:
(12:1): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Rule: a group of related scenarios'
(14:5): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Background:'
(15:9): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Given an input for all scenarios of this rule'
 15:9 InvalidGherkin - Expected keyword or gherkin property not found. Make sure you are following proper Gherkin syntax. Details are: Parser errors:
(12:1): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Rule: a group of related scenarios'
(14:5): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Background:'
(15:9): expected: #TagLine, #ScenarioLine, #Comment, #Empty, got 'Given an input for all scenarios of this rule'```

Which makes sense since the tags are not supported in the current version, but as a user is quite confusing.

Possible Solution

Add support for tags on Rule.

The expected behaviour would be that tags on Rules would cascade for Scenarios/Scenario Outlines/ Rules below them.

Context & Motivation

As our projects grow and our users take advantage of Rule tag more and more - this is expected behaviour from them.

For what it is worth, I agree with them that if Feature, Scenario, Scenario Outline and Example support tags - it feels natural to add tags to Rule tags.

ron-myers avatar Jun 27 '20 12:06 ron-myers

I would love to see this functionality!

KosayJabre avatar Jul 02 '20 23:07 KosayJabre

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

stale[bot] avatar Oct 11 '20 23:10 stale[bot]

Superseded by #1123

aslakhellesoy avatar Feb 03 '21 11:02 aslakhellesoy

Why this issue has been closed ?

It makes sense and it will be very useful to have tags on rules...

fabien7474 avatar Jul 26 '22 09:07 fabien7474

We can have tags on rules. It was superseded by a different item. This was merged in and fixed later on in some flavours by myself.

Given this was on the dotNET functionality. I would first advise you to check your versions of all affected packages. If you find this is still broken can you make a new case outlining specifically which version/s you are using.

luke-hill avatar Jul 26 '22 09:07 luke-hill