-
-
Notifications
You must be signed in to change notification settings - Fork 27
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:
|
@kieran-ryan hello again, I'm sorry I haven't replied sooner. To answer your questions:
It fails because it tries to look for a fixture named I saw you created a PR for adding support to "parse" syntax. I can try to help test it, but I'm not a much of a TypeScript coder. |
Awesome @neskk 💪 Would definitely welcome any contributions if you want to open a PR to the branch of the existing PR? A good place to start would be to get the unit tests running locally (a note you may need node v18) and to replace step definitions with their pytest-bdd equivalent and see what works or breaks. Believe had something working but can’t fully recall status A note that the expression builder Test that reads that test data expects a specific set of step definition patterns, but you can extend that similar to what has been done with the JavaScript implementation. If you run into any issues I would be happy to help you contribute, feel free to open a draft PR early if something you want to look at and will help
|
Thank you for the feedback. |
NOTES:
SEE:
|
@kieran-ryan I posted some questions on language-service PR#206. If you can please take a look at it. |
👓 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: