-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Wrong step definition created when having "(" #1291
Comments
As of 3.0.0.pre.2, cucumber-ruby supports both Cucumber Expressions and Regular Expressions. Generated snippets use Cucumber Expressions, not Regular Expressions. I think you may have stumbled upon #333 which should have been fixed by #334, but it looks like there might still be a bug with it. This needs more investigation.... |
@christianbaumann here is a workaround for you. The generated snippet currently is: Given("the room information \(room code and availability) is correct") do
pending # Write code here that turns the phrase above into concrete actions
end Either change double quotes to single quotes: Given('the room information \(room code and availability) is correct') do
pending # Write code here that turns the phrase above into concrete actions
end Or double-escape the opening parenthesis: Given("the room information \\(room code and availability) is correct") do
pending # Write code here that turns the phrase above into concrete actions
end The bug is in cucumber-ruby, and not in cucumber-expressions. We should change the snippet generator to use single quotes rather than double quotes, and only escape single quotes in the expressions itself. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
I'm keeping this open for now but may close it soon and create another PR that uses the double escape instead of single quotes. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
Bumping to remove the tag. :) |
Sorry for the delay on this! It's still on my radar but I'm in the process of moving to Australia so things are particularly hectic atm. |
Awesome! All the best with the move! :) |
Question on this @aslakhellesoy (then I'll stop tagging you in stuff for now!): Do we want to accommodate curly braces in step definitions? We could implement this such that Cucumber first looks for a param type with the name in the curly braces and, if it doesn't find one, assumes the curly braces are part of the step. I can think of good reasons for or against this, so I thought I'd ask for your input. @brasmusson, @mattwynne, @tooky - maybe you guys have thoughts on this as well? |
@danascheider I think this bug was (incidentally?) fixed by @acant in #1323. No need to handle curly braces in a special way - cucumber-expressions handles escaping. |
Sweet! |
Sorry - should have been more explicit. This bug will be fixed when #1323 is merged. |
Fixed by #1323 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
From @christianbaumann on April 19, 2018 9:43
Summary
I have a step definition which contains "(" and ")", eg.
Expected Behavior
When I run cucumber and have no step definition defined, I would expect a matching step definition to be defined
Current Behavior
Instead, following step definition is created:
Your Environment
cucumber (3.1.0)
cucumber-core (3.1.0)
cucumber-expressions (5.0.17, 5.0.15)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
Copied from original issue: cucumber/common#364
The text was updated successfully, but these errors were encountered: