Open Cavaler opened 2 months ago
Alternatively, when trying to generate steps from VS Code, this is what we get:
@then('Declaration for {string} contains {string}')
def step_then(context, string, string2):
pass
And it is not recognized by Behave as a valid step because of parameter name mismatch. Declaration for {string} contains {string2}
works in Behave, but not in VS Code.
@Cavaler
behave
βs parse expressions
instead of cucumber-expressions
cucumber language-service
supports cucumber-expressions (and regexp for cucumber
) only AFAIKbehave
version has support for cucumber-expressions
build in: v1.2.7.dev5
(and v1.2.7.dev4
). Otherwise, you need to use the cucumber-expressions
package directly.PROCEDURE:
behave
HEAD from the Git repository of install behave
via Git repo tag v1.2.7.dev5
(or newer)behave
or use the feature-file for cucumber-expressions
belowcucumber language-server
is working for you or notSEE ALSO:
OK, this seems to be a duplicate for https://github.com/cucumber/language-service/issues/205 then
π What did you see?
The way the service parses Behave step definitions is in total disagreement with how Behave itself does.
In Behave tutorial, parameters in e.g. @then have the same name as the actual function parameter, and that is the way Behave later calls the step.
Example feature file:
and steps file:
Runs OK with Behave, but gives parsing errors in VS Code:
β What did you expect to see?
Expected to properly parse the feature and steps files
π¦ Which tool/library version are you using?
behave 1.2.6 VS Code 1.92.2 Cucumber extension 1.10
π¬ How could we reproduce it?
π Any additional context?
No response