cabbage-ex / gherkin

A Gherkin file parser written in Elixir. Extracted from https://github.com/meadsteve/white-bread.
11 stars 8 forks source link

Languages feature #12

Open regnisolbap opened 5 years ago

regnisolbap commented 5 years ago

Hi there,

As I noticed in #11, I couldn't find how to use gherkin with some other languages than english. I'm just starting my Elixir journey so this PR is surely not perfect, at least the tests are passing and it seems to work well (I tested it only in french and spanish).

I've just created a Keywords module which holds a struct and some functions to interact with keywords loaded from a gherkin-languages.json file at the root of the project (a script to automatically download this file from the official gherkin repo everytime this project gets published could be a good thing to add). Then I updated the parsers to handle those keywords instead of just plain strings in english.

Anyway, let me know what you think about it !

revati commented 5 years ago

Nice work, there is more change than I anticipated tho Hope I will be able to look into this in weekend

revati commented 5 years ago

What we should do I think, is to create some base performance test suite. Which we can run, on the current implementation and yours and use it as a reference in future, to see how code changes impacts library performance

regnisolbap commented 5 years ago

Hey @revati, yes some performance tests might be nice but I really don't know where to start with it... if you have some guidelines I'll be glad to help on this !

revati commented 5 years ago

Yes, I joined the cucumber slack channel and they pointed out that there is https://github.com/cucumber/cucumber/tree/master/gherkin/testdata which can be used as

  1. test odd edge cases that are provided there (there is also expected json output to compare with)
  2. parse all those feature files and see how good this lib performs.

I will set up a seperate branch where will be benchee base, so you will just need to merge it in and run command