prashant-ramcharan / courgette-jvm

Multiprocess | Parallel Cucumber-JVM | Parallelize your Java Cucumber tests on a feature level or on a scenario level.
MIT License
132 stars 38 forks source link

Execute Scenarios in parallel but their Examples sequentially #372

Closed martinmineo closed 1 year ago

martinmineo commented 1 year ago

Hi! I have Feature file like this one

Feature: example feature

  Scenario Outline: My test
    Given step one
    When step two
        | data   |
        | <data> | 
   Then step three
    Examples:
      | data |
      | 1    |
      | 2    |
      | 3    |

  Scenario: Another test
    Given step 1
    When step 2
    Then step 3

and in my test runner file, where Courguette is configured, it's like this

@CourgetteOptions(
        threads = 10,
        runLevel = CourgetteRunLevel.SCENARIO,
        ... more options
)

But when I run these tests, the examples run all at the same time and I'd like to My test and Another test execute un parallel, but inside My test I would like the examples to execute sequentially

Is that possible?

prashant-ramcharan commented 1 year ago

Hello, this is not possible when using CourgetteRunLevel.SCENARIO as each scenario (including examples) will run as a standalone test.

You should use CourgetteRunLevel.FEATURE and move out the Scenario: Another test to its own feature file.

martinmineo commented 1 year ago

Thank you!!