Skip to content

Releases: ozontech/cute

v0.1.21

17 May 08:07
0205bc3
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.1.20...v0.1.21

v0.1.20

22 Apr 11:00
b0638c3
Compare
Choose a tag to compare

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

Full Changelog: v0.1.19...v0.1.20

v0.1.19

30 Mar 23:02
9389b60
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.1.18...v0.1.19

What's Changed

New Contributors

Full Changelog: v0.1.18...v0.1.19

v0.1.18

26 Feb 16:42
43d0b43
Compare
Choose a tag to compare

What's Changed

  • fixed propagation of httpClient and jsonMarshaller for TableTests by @Apologiz in #66

New Contributors

Full Changelog: v0.1.17...v0.1.18

v0.1.17

12 Feb 11:22
9c6558e
Compare
Choose a tag to compare

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

Full Changelog: v0.1.16...v0.1.17

v0.1.16

05 Feb 12:34
97a43ec
Compare
Choose a tag to compare

What's Changed

Thank you a lot @KaymeKaydex @Bernigend

Full Changelog: v0.1.15...v0.1.16

v0.1.15

18 Jan 10:34
c94d785
Compare
Choose a tag to compare

Create new asserts for JSON

  • EqualJSON(expression string, expect []byte)
  • NotEqualJSON(expression string, expect []byte)

Thank you, @JeJutic!

v0.1.14

23 Nov 13:43
df2546e
Compare
Choose a tag to compare
  1. Fix empty body in logs and curls
  2. Refactoring methods
  3. Add docs for some private methods

v0.1.13 - hotfix

21 Nov 21:05
0c74c67
Compare
Choose a tag to compare
  1. Hot fix json asserts.
  2. Log request from response.

v0.1.12

20 Nov 11:43
8b574b1
Compare
Choose a tag to compare

So.... Time to change something.

  1. Update linter
  2. Update allure-go
  3. 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
  1. 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
		})
	})

}
  1. Remove EnableHardValidation
  2. Fix bug with custom http.Client
  3. Implement new library for jsonPath
  4. New assert. JSON diff
		AssertBody(json.Diff("{\"aaa\":\"bb\"}")).