radish-bdd / radish

Behavior Driven Development tooling for Python. The root from red to green.
https://radish-bdd.github.io
MIT License
180 stars 49 forks source link

the steps matching is not accurate #431

Closed h4kim-dyze closed 2 years ago

h4kim-dyze commented 2 years ago

Describe the bug radish do not check the whole step from feature file, if we define the step @given("I run the app") not only this exact step can be used but also Given I run the app some text here

Environment and Version

To Reproduce

Expected behavior the step shouldn't be matched because it create some misconceptions if we have some similar steps we can end by executing a different step

fliiiix commented 2 years ago

What is the problem with this behavior?

It is a pattern matching, if you want to disallow extra things, you could use a regex and fail if there are extra things matched.

timofurrer commented 2 years ago

As @fliiiix suggested, the way to go here is to use a regex to properly match full steps:

@given(re.compile("I run the app$"))
def given_run_app(step):
    ...
fliiiix commented 2 years ago

seems to be solved feel free to reopen