cucumber-rs / cucumber

Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.
https://cucumber-rs.github.io/cucumber/main
Apache License 2.0
579 stars 70 forks source link

Prevent parallel execution of examples #340

Open erichstuder opened 4 months ago

erichstuder commented 4 months ago

I have a feature file like this:

# language: en

Feature: Persistency

    Scenario Outline: Persisted Parameters
        Given the communication to the device over RS232
        When the command is sent: 'store <parameter_name> <value_example>\n'
        And the command is sent: 'read <parameter_name>\n'
        Then the answer is: '<value_example>\n'

        Examples:
        | parameter            | parameter_name       | value_example   |
        | Wi-Fi SSID           | wifi_ssid            | this_is_an_ssid |
        | Wi-Fi Password       | wifi_password        | wifi_password   |

I found out that the different examples run in parallel. So step one runs twice, then step two runs twice, ... As I have a shared resource (UART) this causes strange behavior.

I would expect that for every example all steps are executed and then the next example is executed. Interestingly in cucumber-cpp I never had this problem. (Note: If I have only one example, everything works fine.)

Questions: