-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Steps highlighting shows "Undefined step" warning on Fedora Linux #120
Comments
From your use of Could you please share the expressions of your step definitions as well? |
I also see this error; here I have three uses of 'Given these books in the catalog': Feature: Library book searches and book delivery
Scenario: The catalog can be searched by author's name.
Given these books in the catalog
Scenario Outline: Author name searches match if the searched string appears anywhere in the author's name.
Given these books in the catalog
Examples:
Scenario: Author name searches are case insensitive.
Given these books in the catalog
Examples:
Here are my step definitions: @given(/these books in the catalog/)
public givenTheseBooksInTheCatalog(table: any) {
this._scenarioContext.catalog = new Catalog([]);
const creationHelperMethods = new CreationHelperMethods();
creationHelperMethods.ReadBooksAndAddToCatalog(this._scenarioContext.catalog, table);
} |
@Kolobamanacas, delimited parameters (
@Kolobamanacas, @The-BDD-Coach and @schwaerz, diagnostics (underlining) for undefined steps is currently unsupported with Scenario Outlines (see cucumber/language-service#149 for some of the challenges to resolve that). Thus, when the
@schwaerz, completions will appear for gherkin steps included in existing feature files, even if there is no matching step definition. However, would be interested to see an example where a step is marked 'undefined', but the 'go to step definition' functionality is working; would you be able to provide one? |
Original comment on In relation to
Issue will be reopened if further detail provided that necessitates a fix or feature. |
@kieran-ryan you said "subsequent comments relate to lack of support for highlighting undefined steps with Scenario Outlines"; all of my steps are defined. I can run the requirements - all of them - and they pass. I can do this with Behave and with Pytest-BDD-NG; I see the same behavior:
Or for Pytest-BDD-NG:
My VSCode 'about' shows: and the V1.8.1 Cucumber plugin. |
Yes, the comments on this issue relate to a lack of feature support by the Cucumber Language Service for highlighting whether a step is marked undefined with Scenario Outlines (contains The new and separate details relating to Python step definitions can occur for a number of reasons:
Your second pattern is detectable (see below) - but this can be impacted if some of the issues above are present elsewhere in that module or if the extension configuration settings are not checking the location in which you are storing step definitions. ![]() The earlier typescript example will fail as the Language Service looks for the capitalised variants of the decorators (
Doing what I can to find and fix these issues. PRs welcome. |
@The-BDD-Coach, with the latest release of the VSCode extension (v1.10.0), you may be interested in the following changes for Python support:
Looking forward to any feedback π |
@kieran-ryan I installed the 1.10.0 VSCode extension but am still seeing significant problems:
This is true for both Behave and Pytest-BDD-NG - and all of the Behave step definitions worked in the past. If you have any suggestions on the best way to troubleshoot this I would be glad hear them. |
@The-BDD-Coach, would it be possible to create a small minimal reproducible example with a repository containing the step definitions and environment setup? We can then analyse what might be causing the issue. What version of Visual Studio Code are you using? A copy of the extension output logs (
From 'Version History' in the Visual Studio Marketplace, if you install an older version of the extension, does the issue persist? |
That is a good suggestion; I will work on that. |
Please note that marking steps as 'undefined' within Scenario Outlines is presently unsupported. Therefore, rather than being considered 'defined', diagnostics (underlining) and matching the steps against definitions is disabled with Scenario Outlines at this time.
|
@kieran-ryan I created https://github.com/The-BDD-Coach/Step-Definition-Bug/tree/main, and will open a new defect for tracking this. |
@kieran-ryan I opened #226 and attached the Cucumber Language Server logs. The logs are interesting: |
π What did you see?
"Undefined step" error occurs when creating scenario with data tables for each step of given/when/then. Also params are not highlighted properly.
β What did you expect to see?
No error. All params to be highlighted.
π¦ Which tool/library version are you using?
Fedora Linux 36
Kernel Version 6.0.5-200.fc36.x86_64 (64-bit)
KDE Plasma 5.25.5
Visual Studio Code 1.73.0 | Dark+ (default dark)
Cucumber 1.5.1
TypeScript 4.6.2
jest 27.5.1
jest-cucumber 3.0.1
π¬ How could we reproduce it?
π Any additional context?
I've noticed that if I add "Examples:" section, then all errors are gone and params are highlighted correctly. Even when examples section is empty.
The text was updated successfully, but these errors were encountered: