cucumber / cucumber-jvm

Cucumber for the JVM
https://cucumber.io
MIT License
2.69k stars 2.02k forks source link

[Core] Allow feature with line syntax to target rules and examples #2884

Closed mpkorstanje closed 1 month ago

mpkorstanje commented 1 month ago

🤔 What's changed?

Given a feature file, it should be possible to provide the line of a Feature, Rule, Scenario, Example and Example. Cucumber should then run all pickles contained in these elements.

For example example.feature:5:13 should run the cucumber, gherkin and pickle pickles. While example.feature:10 runs the zukini and pickle pickles. And using either lines 1, 2 or 3 would run all pickles.

Feature: Example feature                      #  1
  Rule: Example rule                          #  2
    Scenario Outline: Example scenario        #  3
       Given I have 4 <thing> in my belly     #  4
       Examples: First                        #  5
         | thing    |                         #  6
         | cucumber |                         #  7
         | gherkin  |                         #  8
                                              #  9
       Examples: Second                       # 10
         | thing    |                         # 11
         | zukini   |                         # 12
         | pickle   |                         # 13

This should make it possible to target (groups of) pickles with a bit more flexibility. And also allow IDEA to select rules.

Note: Using the lines of backgrounds and steps will still not select any pickles.

⚡️ What's your motivation?

Provides the possibility for IDEA to fix #2882.

🏷️ What kind of change is this?

♻️ Anything particular you want feedback on?

📋 Checklist: