Skip to content

Releases: go-bdd/gobdd

Changing the step func definiton

29 Sep 20:23
96e3b84
Compare
Choose a tag to compare

The main change is related to #34.
Now, every step function should accept the Context as the first parameter and returns an only error. It is explained in more details in the docs https://go-bdd.github.io/doc/creating-steps.html.

Adding predefined steps in testhttp package

16 Sep 07:42
2d470e3
Compare
Choose a tag to compare

Here's the full list:

_ = addStep.AddStep(`^I make a (GET|POST|PUT|DELETE|OPTIONS) request to "([^"]*)"$`, testHTTP.makeRequest)
_ = addStep.AddStep(`^the response code equals (\d+)$`, testHTTP.statusCodeEquals)
_ = addStep.AddStep(`^the response contains a valid JSON$`, testHTTP.validJSON)
_ = addStep.AddStep(`^the response is "(.*)"$`, testHTTP.theResponseIs)
_ = addStep.AddStep(`^the response header "(.*)" equals "(.*)"$`, testHTTP.responseHeaderEquals)
_ = addStep.AddStep(`^I have a (GET|POST|PUT|DELETE|OPTIONS) request "(.*)"$`, testHTTP.iHaveARequest)
_ = addStep.AddStep(`^I set request header "(.*)" to "(.*)"$`, testHTTP.iSetRequestSetTo)
_ = addStep.AddStep(`^I set request body to "([^"]*)"$`, testHTTP.iSetRequestBodyTo)
_ = addStep.AddStep(`^the request has body "(.*)"$`, testHTTP.theRequestHasBody)
_ = addStep.AddStep(`^I make the request$`, testHTTP.iMakeRequest)

What's more, I made RequestKey and ResponseKey so defining your custom steps should be easier.

Adding default values

28 Aug 06:50
1646f79
Compare
Choose a tag to compare

In this release, we added a default value to Get* functions in the context.

// will fail when the param is not defined
requiredParam := ctx.GetInt(something{})
def := 123
// will never panic
optionalParam := ctx.GetInt(something{}, def)

v0.2.0

21 Aug 10:58
Compare
Choose a tag to compare

Added two options WithBeforeScenario and WithAfterScenario option to give the possibility to execute a function before/after every scenario.

v0.1.0

19 Aug 14:22
134792c
Compare
Choose a tag to compare
use built in http.Request objects (#35)