Releases: ozontech/cute
Releases · ozontech/cute
v0.1.21
What's Changed
- [ISSUE-73] fix error check in http do by @siller174 in #74
Full Changelog: v0.1.20...v0.1.21
v0.1.20
Refactored Request Repeat Politic Builder
New methods
// RequestRepeatDelay set delay for request repeat.
// if response.Code != Expect.Code, than request will repeat counts with delay.
// Default delay is 1 second.
RequestRepeatDelay(delay time.Duration) RequestHTTPBuilder
// RequestRepeatPolitic is a politic for repeat request.
// if response.Code != Expect.Code, than request will repeat counts with delay.
// if Optional is true and request is failed, than test step allure will be skipped, and t.Fail() will not execute.
// If Broken is true and request is failed, than test step allure will be broken, and t.Fail() will execute.
RequestRepeatPolitic(politic *RequestRepeatPolitic) RequestHTTPBuilder
// RequestRepeatOptional is a option politic for repeat request.
// if Optional is true and request is failed, than test step allure will be skipped, and t.Fail() will not execute.
RequestRepeatOptional(optional bool) RequestHTTPBuilder
// RequestRepeatBroken is a broken politic for repeat request.
// If Broken is true and request is failed, than test step allure will be broken, and t.Fail() will execute.
RequestRepeatBroken(broken bool) RequestHTTPBuilder
What's Changed
- [ISSUE-70] Possibility to not fail the test during retries by @siller174 and @samybenatt in #72
Full Changelog: v0.1.19...v0.1.20
v0.1.19
What's Changed
- improve logs #63
- create common error type #34
- fix wrong library by @denisqsound in #68
New Contributors
- @denisqsound made their first contribution in #68
Full Changelog: v0.1.18...v0.1.19
What's Changed
- fix wrong library by @denisqsound in #68
- [ISSUE-35] add internal log management by @siller174 in #69
New Contributors
- @denisqsound made their first contribution in #68
Full Changelog: v0.1.18...v0.1.19
v0.1.18
v0.1.17
New type of error:
BrokenError is an interface for set errors like Broken errors.
If the function returns an error, which implements this interface, the allure step will has a broken status
type BrokenError interface {
IsBroken() bool
SetBroken(bool)
Error() string
}
New methods for errors:
// WrapOptionalError returns error with an Optional tag for Allure
func WrapOptionalError(err error) error
// WrapBrokenError returns error with a Broken tag for Allure
func WrapBrokenError(err error) error
// WrapRequireError returns error with flag for execute t.FailNow() and finish test after this error
func WrapRequireError(err error) error {
Add state in Result of test
Replacement for IsFailed()
(deprecated)
ResultStateSuccess
ResultStateBroken
ResultStateFail
func (r *testResults) GetResultState() ResultState
What's Changed
- [ISSUE-44] add broken validation by @siller174 in #61
Full Changelog: v0.1.16...v0.1.17
v0.1.16
What's Changed
- patch-ojg: fix invalid version - unknown revision by @KaymeKaydex in #57
- [ISSUE-59] update libs by @siller174 in #60
Thank you a lot @KaymeKaydex @Bernigend
Full Changelog: v0.1.15...v0.1.16
v0.1.15
v0.1.14
v0.1.13 - hotfix
- Hot fix json asserts.
- Log request from response.
v0.1.12
So.... Time to change something.
- Update linter
- Update allure-go
- Support new allure labels
func (it *cute) Titlef(format string, args ...interface{}) AllureBuilder
func (it *cute) Descriptionf(format string, args ...interface{}) AllureBuilder
func (it *cute) Stage(stage string) AllureBuilder
func (it *cute) Stagef(format string, args ...interface{}) AllureBuilder
func (it *cute) Layer(value string) AllureBuilder
func (it *cute) TmsLink(tmsLink string) AllureBuilder
func (it *cute) TmsLinks(tmsLinks ...string) AllureBuilder
- Support
provider.StepCtx
func TestInsideStep(t *testing.T) {
runner.Run(t, "Single test with allure-go Runner", func(t provider.T) {
t.WithNewStep("First step", func(sCtx provider.StepCtx) {
sCtx.NewStep("Inside first step")
})
t.WithNewStep("Step name", func(sCtx provider.StepCtx) {
u, _ := url.Parse("https://jsonplaceholder.typicode.com/posts/1/comments")
cute.NewTestBuilder().
Title("Super simple test").
Tags("simple", "suite", "some_local_tag", "json").
Parallel().
Create().
RequestBuilder(
cute.WithHeaders(map[string][]string{
"some_header": []string{"something"},
}),
cute.WithURL(u),
cute.WithMethod(http.MethodPost),
).
ExpectExecuteTimeout(10*time.Second).
ExpectStatus(http.StatusCreated).
ExecuteTest(context.Background(), sCtx) // <---- Execute test with provider.StepCtx
})
})
}
- Remove
EnableHardValidation
- Fix bug with custom
http.Client
- Implement new library for
jsonPath
- New assert. JSON diff
AssertBody(json.Diff("{\"aaa\":\"bb\"}")).