go-bdd / gobdd

BDD framework
https://go-bdd.github.io/gobdd/
MIT License
115 stars 20 forks source link

Create code based API #58

Closed bkielbasa closed 4 years ago

bkielbasa commented 4 years ago

Is your feature request related to a problem? Please describe. Using gherkin files can be just one of the options to write tests. There are people who don't like gherkin but are interested in BDD. What I can suggest is create an API where we'll have the same functionality as in Gherkin files but be able to create without them.

One of the drafts of the API can be:

scenario := gobdd.NewScenario("name of it", func(s gobdd.Scenario){
    s.AddFeature("some feature", func(f gobdd.Feature){
        f.AddStep("step 1", "", stepFunc)
    })
})

I'm opened for discussions and suggestions.

mirogta commented 4 years ago

I'm hesitating to give this 👎 so it doesn't sound negative and any idea in this project at this stage is a good idea... but, we've moved to BDD with Cucumber and away from code based tests to get the full benefits of BDD/Cucumber and test cases in plain English and we can finally get rid of nested functions. To me this would sound like a step back, diluting focus, and competing with other libraries that use just this approach.

bkielbasa commented 4 years ago

Thanks for your feedback! I'm suggesting it because there are some people who prefers such an approach. But I think I see your point.

bkielbasa commented 4 years ago

Closing due to no interest in this feature