You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When defining a behave step in python, we usually use f string to interpolate values. For example, we have: @behave.given(f'the {regex} is set to "(.*?)"') However, the autocomplete could not search for the the regex that expressed as a f string. It only shows the options that use string like this : @behave.given("regex is reset")
Describe the solution you'd like
Autocomplete pop up should show the regex expressed as f string in implementation.
Additional context
I suggest the implementation of stepsParser.ts could be the following:
replace
const stepFileStepRe = new RegExp(${stepFileStepStartStr}u?(?:"|')(.+)(?:"|').*\\).*$, "i");
with
const stepFileStepRe = new RegExp(${stepFileStepStartStr}u?(?:"|f?')(.+)(?:"|').*\\).*$, "i");
The text was updated successfully, but these errors were encountered:
I'm confused by your request.
I've not seen an example of using an f-string as a behave step.
An f-string suggests you are modifying the string in the python code itself, rather than passing something in from the feature file. Can you give an example of the full steps file and full feature file so I can see how this works?
Currently, parameters passed in from the feature file are supported without the "f":
@behave.given('the regex is set to "{value}"')
def a_step(context, value):
assert context.regex == value
and a feature like this:
Scenario: run a test
Given the regex is set to "(.*?)"
When we implement a successful test
Then we will see the result
Is your feature request related to a problem? Please describe.
When defining a behave step in python, we usually use f string to interpolate values. For example, we have:
@behave.given(f'the {regex} is set to "(.*?)"')
However, the autocomplete could not search for the the regex that expressed as a f string. It only shows the options that use string like this :@behave.given("regex is reset")
Describe the solution you'd like
Autocomplete pop up should show the regex expressed as f string in implementation.
Additional context
I suggest the implementation of
stepsParser.ts
could be the following:replace
const stepFileStepRe = new RegExp(
${stepFileStepStartStr}u?(?:"|')(.+)(?:"|').*\\).*$
, "i");with
const stepFileStepRe = new RegExp(
${stepFileStepStartStr}u?(?:"|f?')(.+)(?:"|').*\\).*$
, "i");The text was updated successfully, but these errors were encountered: