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

Can't execute multiple specific scenarios in the same feature file #188

Closed
ghost opened this issue Aug 2, 2019 · 1 comment · Fixed by #414
Closed

Can't execute multiple specific scenarios in the same feature file #188

ghost opened this issue Aug 2, 2019 · 1 comment · Fixed by #414
Labels
🐛 bug Defect / Bug
Milestone

Comments

@ghost
Copy link

ghost commented Aug 2, 2019

yes, call godog this way:

godog F1.feature:5 F2.feature:5 F1.feature:13

# example from godog package
godog features/load.feature:6 features/multistep.feature:6 features/load.feature:23 features/multistep.feature:23

All godog arguments are feature file paths, you may specify separate scenarios at specific lines to be run in specific order. Note, that if you have a hook like BeforeFeature then it will be run separately for every specified feature in argument.

Originally posted by @l3pp4rd in #99 (comment)

Question

I tried your suggestion and it seems something broke down the way. I was expecting scenarios to be run, but only the first one for each feature file is executed.

godog features/load.feature:6 features/multistep.feature:6 features/load.feature:23 features/multistep.feature:23

Feature: load features
  In order to run features
  As a test suite
  I need to be able to load features

  Scenario: load features within path    # features/load.feature:6
    Given a feature path "features"      # suite_context.go:324 -> *suiteContext
    When I parse features                # suite_context.go:329 -> *suiteContext
    Then I should have 11 feature files: # suite_context.go:348 -> *suiteContext
      """
      features/background.feature
      features/events.feature
      features/formatter/cucumber.feature
      features/formatter/events.feature
      features/lang.feature
      features/load.feature
      features/multistep.feature
      features/outline.feature
      features/run.feature
      features/snippets.feature
      features/tags.feature
      """

Feature: run features with nested steps
  In order to test multisteps
  As a test suite
  I need to be able to execute multisteps

  Scenario: should run passing multistep successfully # features/multistep.feature:6
    Given a feature "normal.feature" file:            # suite_context.go:318 -> *suiteContext
      """
      Feature: normal feature

        Scenario: run passing multistep
          Given passing step
          Then passing multistep
      """
    When I run feature suite                          # suite_context.go:379 -> *suiteContext
    Then the suite should have passed                 # suite_context.go:338 -> *suiteContext
    And the following steps should be passed:         # suite_context.go:191 -> *suiteContext
      """
      passing step
      passing multistep
      """

2 scenarios (2 passed)
7 steps (7 passed)
@l3pp4rd
Copy link
Member

l3pp4rd commented Aug 3, 2019

yes, seems like it got broken at some point, thanks for the details

@l3pp4rd l3pp4rd added the P2 label Aug 3, 2019
@lonnblad lonnblad added 🐛 bug Defect / Bug and removed P2 labels Jun 21, 2020
@lonnblad lonnblad changed the title [Question] Multiple Scenario in same feature file Issue when selecting sultiple Scenario in same feature file Jun 23, 2020
@lonnblad lonnblad changed the title Issue when selecting sultiple Scenario in same feature file Can't execute multiple specific scenarios in the same feature file Jun 23, 2020
@lonnblad lonnblad added this to the v0.12.0 milestone Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants