pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

Multi language support

Open santunioni opened this issue 3 years ago • 7 comments

As we known, BDD tests are much better if written in domain language. This means multi-language gherkin support is a top feature.

I coudn´t find pytest-bdd documentation about support to languages other than english.

  • Is there any support at all?
    • If yes, did you document it?
    • If no, is there a roadmap for the next features in the project?

Do you need help in the project? I would love to contribute.

santunioni avatar Feb 17 '22 22:02 santunioni

Hi, unfortunately it's not supported yet. Help is always appreciated, if you want to contribute I'd ask you to try to explain how you would implement it before spending too much time on it. I think it's worth it in order to not waste your time.

youtux avatar Feb 24 '22 12:02 youtux

Hi @youtux

I could help here as we use language overwriting on my current project to write Gherkin in danish.

You can see the clone I used for this here https://github.com/TheoAndersen/pytest-bdd/commits/languages.

It pulls out the localizations from parser.py to a separate languages.py file, working further on @metalkopf's example.

What do you think of that way of doing it?

I could rebase it off the current pytest-bdd version and create a pull request for you to review, it you think that design is okay.

/Theo

TheoAndersen avatar Apr 24 '22 07:04 TheoAndersen

I am sorry for not answering, @youtux. I was going to research how to implement, but I am not having much time lately. If you both @youtux and @TheoAndersen wants to close this issue it is fine for me.

santunioni avatar Apr 29 '22 13:04 santunioni

This is definitely something we want to support, so the ticket should stay open, but I don't have much time lately to focus on this, hopefully in the next few weeks.

youtux avatar May 04 '22 07:05 youtux

Of course.

When you have the time - then maybe look at my clone and tell me the way you would want this implemented. I would gladly do the lifting/coding if it makes sense to you.

TheoAndersen avatar May 04 '22 07:05 TheoAndersen

@TheoAndersen Could you please check https://github.com/elchupanebrej/pytest-bdd-ng latest release? It has to support Danish localization because official gherkin does. As example, https://github.com/elchupanebrej/pytest-bdd-ng/commit/3a54130c4fa4c5f5c4820333c144dd794610a1be could be used

elchupanebrej avatar Jul 18 '22 22:07 elchupanebrej

Duplicates #397 #179

elchupanebrej avatar Jul 24 '22 00:07 elchupanebrej