-
Notifications
You must be signed in to change notification settings - Fork 80
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
CucumberJS v2.X regex syntax {.*} not being detected #99
Comments
Hi. Thank you for your feedback!! Regarding your issue, I have one question. Should any regexp be using with "{}" symbols (ex. "{.+}" or "{value1|value2}") due to CucumberJS 2.X regex syntax? |
Sorry @alexkrechik, I was mistaken. AFAIK, this has more to do with Cucumber Expressions. In the example above, if you change {.*} to {zzz} CucumberJS 2.X still recognizes that step definition. So I guess the change would be to handle any unmatched custom parameter types to a word boundary regex. Does that make sense? |
Eventually the extension could scan directory for custom parameter types and use its regex pattern. For now any other terms found inside step = step.replace(/{(.*)}/g, '.*'); I tried this locally and it works with one or more cucumber expressions. I'll submit a pull request shortly. |
Pull request #103 created. |
HI!
Also, there are some tests, that should be filled and passed for the such changes (I'm trying to do this for all the cases) So, could you please do the next things (otherwise I can do this when will have some free time, likely next week):
|
Hi @alexkrechik, I finally got around to improving the cucumber expression logic and writing those test cases as you suggested. Thanks for pointing me on the right direction! Only problem I keep running into is with the backslashed case. There must be a function that removes the backslashes. Can you take a look at it?
|
Hi! Finally I've up the tests (they were failed due to new TypeScript issue), so will be able to look into this. |
Fixed backslashes case and merged it. |
Thanks @alexkrechik. Looks great! Any idea when the next update will be for the plugin? Also, should I go ahead and close the issue? |
Hi! I should close at least one more issue - #102. After this I'll test the extension, and, if no additional regressions found, will release the path version. |
Also, lets close this issue after extension release |
Should be fixed in 2.3.1 |
Hi @alexkrechik,
I am a great fan of your extension. GREAT WORK! And thanks to the latest formatting functionality added in v2.3.0, I no longer have to spend time arranging those data tables. 👍
I am running into the following issue and was wondering if you could help me (solution provided below).
Given step definition:
And I should delete test data for: UI
When using CucumberJS 2.X regex syntax:
Then CucumberJS recognizes step definition, but Extension does not:
When I use CucumberJS 1.X regex syntax:
Then Extension recognizes step definition, but CucumberJS does not:
Unless I am using CucumberJS 2.X regex syntax improperly, would you consider adding the following line of code to step_handlers?
Thanks again for the awesome extension!
The text was updated successfully, but these errors were encountered: