Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
May 16, 2024

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented May 16, 2024

🤔 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?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

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
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.
@mpkorstanje mpkorstanje marked this pull request as ready for review May 16, 2024 19:06
@mpkorstanje mpkorstanje merged commit dc62378 into main May 16, 2024
6 checks passed
@mpkorstanje mpkorstanje deleted the match-feature-with-line-against-rules branch May 16, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

running rules from the feature file causes the whole feature file to be run if the rule has no tag on it
1 participant