Behat / Gherkin

Gherkin parser, written in PHP for Behat project
MIT License
1.05k stars 91 forks source link

Add support for multiple Example Tables with tags #161

Closed dpakach closed 3 years ago

dpakach commented 4 years ago

Description

Add support for multiple example table with tags on scenario outlines

This is a PR is addition to https://github.com/Behat/Gherkin/pull/119 Related Issue #117

Example:

Scenario Outline: Test scenario outline
    When I do some thing
     And I use <data> from table
     Then I should get the <result>

     @smokeTest
     Examples:
      | data     | result |
      | simple   | data   |

     Examples:
      | data       |  result |
      | all        | kinds   |
      | of         | data    |

Context

Having this allows us to use tags to run only small set of examples from the table on a big test suite. for eg. in above example we can use @smokeTest tag filter to run only a basic example of the scenario. but If we want to run all the examples we can basically run it without any tags.

phil-davis commented 4 years ago

LGTM @stukalin @stof @everzet review/comments?

phil-davis commented 4 years ago

ping @stukalin @stof @everzet or anyone review/comments?

stukalin commented 4 years ago

@phil-davis LGTM

phil-davis commented 4 years ago

This looks like the place that shows this is supported in Cucumber-Gherkin https://github.com/cucumber/cucumber-js/blob/master/features/target_specific_scenarios_by_tag.feature It processes a feature file:

      Feature: some feature
        @a
        Scenario: first scenario
          Given a step

        @b
        Scenario Outline: second scenario - <ID>
          Given a step

          @c
          Examples:
            | ID |
            | X  |
            | Y  |

          @d
          Examples:
            | ID |
            | Z  |

and selects various combinations of the tagged examples tables. Commit was https://github.com/cucumber/cucumber-js/commit/95c6f29cc4c85d02d042ed5b3f9ff270eee88b89

So this Behat/Gherkin PR is implementing an existing feature of the Cucumber-Gherkin implementation.

phil-davis commented 4 years ago

@ciaranmcnulty I don't know who to ping for review (and hopefully approval) of this. IMO it is "a good thing" (tm) and actually adds to compatibility with Cucumber Gherkin.

ciaranmcnulty commented 4 years ago

Feature sounds correct to me; will review the code when I get a chance

phil-davis commented 4 years ago

@ciaranmcnulty any chance to progress this? What can I do to help?

phil-davis commented 4 years ago

@ciaranmcnulty @stof @everzet any chance for someone to review this?

phil-davis commented 4 years ago

@ciaranmcnulty @stof @everzet any chance for someone to review this? Sorry, I don't know what else to do except ping every 2 weeks. Please let me know if there is something else that I can do to help this progress.

phil-davis commented 4 years ago

@ciaranmcnulty @stof @everzet any chance for someone to review this? Sorry, I don't know what else to do except ping every 2 ~weeks~ months. Please let me know if there is something else that I can do to help this progress.

phil-davis commented 4 years ago

I see some activity in Behat/Behat with release of 3.7.0

@ciaranmcnulty @stof @everzet can anyone progress this? Or tell us that it is not going to be accepted? Or give any feedback please.

phil-davis commented 4 years ago

@ciaranmcnulty @stof @everzet pinging again.

We had a situation today where this would be useful - putting different tags on each example.

phil-davis commented 4 years ago

I rebased just now to get fresh CI against current master.

@ciaranmcnulty @stof I see that a PR was merged 2 days ago. Any chance to review this one?

phil-davis commented 4 years ago

@ciaranmcnulty @stof is there any chance that this will be accepted?

We would like to be able to use this functionality, and it seems to be part of "Gherkin standard" (if that is a thing!)

weph commented 4 years ago

@phil-davis Afaik @pamil took over maintenance of Behat recently. I have already pointed out this PR to him, but I guess he's still in the middle of getting an overview of all the open tasks.

phil-davis commented 4 years ago

I rebased this just now to get fresh CI. It would be really nice if we could get a release of this, and whatever else is waiting in master, before bumping to require PHP 7.2 minimum. That will help make sure that it can be used with the current Behat/Behat without getting mixed up in which repos are waiting for releases that change PHP versions...

phil-davis commented 4 years ago

@ciaranmcnulty and whoever else is managing this repo.

Is there any chance that this will ever be merged and released?

It would be nice to have. We want to be able to tag Scenario Examples - e.g. see my comment https://github.com/owncloud/ocis-reva/issues/282#issuecomment-675328860

Please be honest and say if it will never be merged. Then we can close it and stop hoping.

phil-davis commented 3 years ago

@stof I see that you have merged some things last month.

Any chance for this to be looked at?

stof commented 3 years ago

/cc @pamil as you announced you are taking over the maintenance of Behat.

phil-davis commented 3 years ago

@pamil (cc @stof ) friendly ping for 2021. Is there any Behat and Gherkin maintenance any more? Or is it now unmaintained and "somebody" needs to start the process of forking all the relevant repos of the Behat organisation...?

ciaranmcnulty commented 3 years ago

Thanks @dpakach, sorry it took >1yr!

dpakach commented 3 years ago

Thank you very much @ciaranmcnulty Finally!!!