-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pytest-BDD parse matcher step definitions #205
Comments
@kieran-ryan sorry to bother you again but my questions kinda remain unanswered.
Thank you for your time. |
No worries @neskk
Correct. As such have listed this issue as an 'enhancement' - will need to assess effort to support and get back to you
Assuming you are referring to including step definitions stored in an external library into your repository either via a submodule or a package (such as through 'pip'). If so, it should be possible by configuring the Cucumber extension or language server to point to where those step definitions are stored in order to scan them e.g. referencing inside a virtual environment could look like |
@neskk, interesting to observe some of the design choices with With pytest-bdd: Given a stub exists with:
one
two
When creating a stub with:
| sample | With the gherkin parser: Given a stub exists with:
"""
one
two
"""
When creating a stub with:
| sample | With Behave, we would include only the first portion of the expression; and would access the table via the @given("a stub exists with:")
def step_impl(context):
for row in context.table:
model.add_user(name=row['name'], department=row['department']) This creates a challenge to handle it appropriately with pytest-bdd, as the table is included in the match itself. To support, will likely need to find a pattern that ignores the additional lines to match only the step portion. Thinking about what would need to be matched:
|
👓 What did you see?
I've configured the cucumber plugin to look for step defs in the right paths, but it's not matching the step-defs.
It finds and parses the files but does not recognize the step-defs:
Example step-def:
We implemented most of the step-defs like this, using pytest_bdd parsers.
Is this "parsers" format compatible with the cucumber plugin?
Another question I have is in regards to external libraries with step definitions.
Currently at my company we're using a shared library that implements the most common step-defs we use in our tests.
Will the vscode cucumber plugin also pick these definitions as well from imports?
Thank you!
I can try to setup a full example if needed.
✅ What did you expect to see?
I expected step definitions to be recognized and be able to use the plugin tools.
📦 Which tool/library version are you using?
cucumber plugin v1.10
vscode 1.88.1
🔬 How could we reproduce it?
No response
📚 Any additional context?
No response
The text was updated successfully, but these errors were encountered: