Skip to content
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

'And' keyword is not working, on commenting 'And' line the test works! #25

Open
ankitagarwalnagarro opened this issue Feb 12, 2022 · 5 comments

Comments

@ankitagarwalnagarro
Copy link

What did you see? 👀

And keyword is not working, on comment And line the test works!

What did you expect to see? 😎

And keyword should also work like other keywords

Which version are you using? 🎁

io.cucumber cucumber-java 7.2.3 test io.cucumber cucumber-core 7.2.3 io.cucumber cucumber-testng 7.2.3 ## How could we reproduce it? 🔬

Use cucumber with java and testng

image

@mpkorstanje
Copy link
Contributor

Impossible to say without the actual text of the feature file.

@mpkorstanje mpkorstanje transferred this issue from cucumber/cucumber-jvm Feb 12, 2022
@mpkorstanje
Copy link
Contributor

The actual text is:

And\t\tthe products api is called with <product> we have the list and fetch <product_id>

Because And isn't followed by a space ( ) Cucumber can't parse it.

@mpkorstanje
Copy link
Contributor

I would expect a parser to be lenient towards different space characters. However in this case the space is hardcoded into the keyword definition.

https://github.com/cucumber/common/blob/main/gherkin/gherkin-languages.json#L745

@jenisys
Copy link
Contributor

jenisys commented Feb 13, 2022

Maybe, a parser post-processing task that normalizes the step and removes/replaces the TABULATORs with SPACEs (and maybe removes duplicated SPACEs) would be a good idea !?

BUT: The question is how often does this syndrome occur ?

@ciaranmcnulty
Copy link
Contributor

ciaranmcnulty commented Feb 13, 2022

It is indeed weird; if we want to fix it I think we'd need to keep the whitespace (regex?) part of the Dialect/JSON rather than building it into the parser, as I'm not sure if all other languages use the same spacers to separate words:

(It may be an idea to make the keyword separator (:) part of the dialect too)

@mpkorstanje mpkorstanje transferred this issue from cucumber/common Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants