Skip to content

Releases: ozontech/allure-go

Release v0.6.16

22 Aug 19:43
4be753f
Compare
Choose a tag to compare

Release Notes:

Features

  • add faker to dependencies (for examples)
  • add table test example
  • Readme updates

pkg/allure (v0.6.3)

Features

  • Add ToJSON() ([]byte, error) method to the Result object. It marshall Result to the JSON and returns error if any.
  • Add ToJSON() ([]byte, error) method to the Container object. It marshall Container to the JSON and returns error if any.
  • Add Done() error method to the Container object. It works same as Result.Done method.
  • Now Result.Done() returns error if any.

pkg/framework (v0.6.16)

Features

Major:

Parametrized tests

Now you can run your parametrized tests in new way at GO

  • ❓ How to use it?
  1. You need extend your suite struct with array of parameters. Its name MUST be like ParamTestNameWithoutPrefix.
    i.e. if your test named like TableTestCities so param should have name ParamCities
  2. You need to create test method that will take your parameter as second argument after provider.T. Test name **
    MUST** have prefix TableTest instead of just Test. i.e. TableTestCities.

Simple example:

package suite_demo

import (
	"testing"

	"github.com/jackc/fake"
	"github.com/ozontech/allure-go/pkg/framework/provider"
	"github.com/ozontech/allure-go/pkg/framework/suite"
)

type ParametrizedSuite struct {
	suite.Suite
	// ParamCities param has name as expected test but has prefix Param instead of TableTest
	ParamCities []string
}

func (s *ParametrizedSuite) BeforeAll(t provider.T) {
	for i := 0; i < 10; i++ {
		s.ParamCities = append(s.ParamCities, fake.City())
	}
}

// TableTestCities is parametrized test has name prefix TableTest instead of Test
func (s *ParametrizedSuite) TableTestCities(t provider.T, city string) {
	t.Parallel()
	t.Require().NotEmpty(city)
}

func TestNewParametrizedDemo(t *testing.T) {
	suite.RunSuite(t, new(ParametrizedSuite))
}

Allure Output:
example_table_test

runner.RunTests and suite.RunSuites ouput:

Now runner.RunTests and suite.RunSuites returns interface SuiteResult. It contains all information about tests that you can use to customize your allure integrations

Minor:

  • reworked test collecting
  • now errors in file creations will be logging as t.Error
  • provider.T.Run now returns allure.Result pointer

pkg/framework Release v0.6.16

22 Aug 19:42
4be753f
Compare
Choose a tag to compare

Release notes

Features

Major:

Parametrized tests

Now you can run your parametrized tests in new way at GO

  • ❓ How to use it?
  1. You need extend your suite struct with array of parameters. Its name MUST be like ParamTestNameWithoutPrefix.
    i.e. if your test named like TableTestCities so param should have name ParamCities
  2. You need to create test method that will take your parameter as second argument after provider.T. Test name **
    MUST** have prefix TableTest instead of just Test. i.e. TableTestCities.

Simple example:

package suite_demo

import (
	"testing"

	"github.com/jackc/fake"
	"github.com/ozontech/allure-go/pkg/framework/provider"
	"github.com/ozontech/allure-go/pkg/framework/suite"
)

type ParametrizedSuite struct {
	suite.Suite
	// ParamCities param has name as expected test but has prefix Param instead of TableTest
	ParamCities []string
}

func (s *ParametrizedSuite) BeforeAll(t provider.T) {
	for i := 0; i < 10; i++ {
		s.ParamCities = append(s.ParamCities, fake.City())
	}
}

// TableTestCities is parametrized test has name prefix TableTest instead of Test
func (s *ParametrizedSuite) TableTestCities(t provider.T, city string) {
	t.Parallel()
	t.Require().NotEmpty(city)
}

func TestNewParametrizedDemo(t *testing.T) {
	suite.RunSuite(t, new(ParametrizedSuite))
}

Allure Output:
example_table_test

runner.RunTests and suite.RunSuites ouput:

Now runner.RunTests and suite.RunSuites returns interface SuiteResult. It contains all information about tests that you can use to customize your allure integrations

Minor:

  • reworked test collecting
  • now errors in file creations will be logging as t.Error
  • provider.T.Run now returns allure.Result pointer

pkg/allure Release v0.6.3

20 Aug 21:11
Compare
Choose a tag to compare

Release Notes

Features

  • Add ToJSON() ([]byte, error) method to the Result object. It marshall Result to the JSON and returns error if any.
  • Add ToJSON() ([]byte, error) method to the Container object. It marshall Container to the JSON and returns error if any.
  • Add Done() error method to the Container object. It works same as Result.Done method.
  • Now Result.Done() returns error if any.

Release v0.6.15

16 Aug 09:21
Compare
Choose a tag to compare

Release Notes v0.6.15

pkg/framework

Features

Add following asserts:

  • Exactly
  • Same
  • NotSame
  • EqualValues
  • NotEqualValues
  • EqualError
  • ErrorIs
  • ErrorAs
  • ElementsMatch
  • DirExists
  • Condition
  • Zero
  • NotZero

Add features:

  • LogStep(args ...interface{}) for provider.T and provider.StepCtx interfaces
    Works as t.Log(args ...interface{}), but also creates allure.Step at report

  • LogfStep(format string, args ...interface{}) for provider.T and provider.StepCtx interfaces
    Works as t.Logf(format string, args ...interface{}) but also creates allure.Step at report

Bugfixes

  • Wrong parent suite setting for no-suite tests
  • Duplicate test's name in FullName field at report
  • Fixed error displaying while before hook fails

pkg/framework Release v0.6.15

16 Aug 09:18
fae7aee
Compare
Choose a tag to compare

Release Notes v0.6.15

Features

Add following asserts:

  • Exactly
  • Same
  • NotSame
  • EqualValues
  • NotEqualValues
  • EqualError
  • ErrorIs
  • ErrorAs
  • ElementsMatch
  • DirExists
  • Condition
  • Zero
  • NotZero

Add features:

  • LogStep(args ...interface{}) for provider.T and provider.StepCtx interfaces
    Works as t.Log(args ...interface{}), but also creates allure.Step at report

  • LogfStep(format string, args ...interface{}) for provider.T and provider.StepCtx interfaces
    Works as t.Logf(format string, args ...interface{}) but also creates allure.Step at report

Bugfixes

  • Wrong paren suite setting for no-suite tests
  • Duplicate test's name in FullName field at report
  • Fixed error displaying while before hook fails

Release v0.6.14

28 Jul 17:04
Compare
Choose a tag to compare

Release Notes

pkg/allure

Features

  • Add Parameter field (type []allure.Parameter) to allure.Result object

pkg/framework

Features

  • Add T.WithParameters method. It adds array of allure.Parameter to the test body
  • Add T.WithNewParameters method. It creates new Allure.Parameters and attach them to the report body.

Release v0.6.14

28 Jul 17:01
Compare
Choose a tag to compare

Release Notes

Features

  • Add T.WithParameters method. It adds array of allure.Parameter to the test body
  • Add T.WithNewParameters method. It creates new Allure.Parameters and attach them to the report body.

Release v0.6.2

28 Jul 16:53
8f4ddb6
Compare
Choose a tag to compare

Release Notes

Features

  • Add Parameter field to Result model

Release v0.6.13

26 Jul 12:10
Compare
Choose a tag to compare

Release v0.6.13

pkg/framework

Features:

  • add JSONContains assert
    • JSONContains verifies if passed "actual" json contains passed "expected" json

Example:

         exp1 := `{"key1": 123, "key3": ["foo", "bar"]}`
         exp2 := `{"key1": 321, "key3": ["foobar", "bar"]}`
	 actual := `{"key1": 123, "key2": "foobar", "key3": ["foo", "bar"]}`

	JSONContains(mockT, expValid, actual) // passed cause "actual" contains exp1 json
	JSONContains(mockT, expNotValid, actual) // failed cause "actual" does not contain exp2 json
  • add Regexp assert
    • Regexp assert verifies if passed string is valid for passed regexp

Example:

	rx := `^start`
	str1 := "start of the line"
        str2 := "of the line"

	Regexp(mockT, rx, str1) // passed cause str1 matches regexp (rx)
	Regexp(mockT, rx, str2) // failed cause str2 does not match regexp (rx)

NOTE: new asserts available from require/assert packages and from t.Require()/t.Assert() methods

Release v0.6.13

26 Jul 12:05
1fbbf8d
Compare
Choose a tag to compare

Release v0.6.13

Features:

  • add JSONContains assert
    • JSONContains verifies if passed "actual" json contains passed "expected" json

Example:

         exp1 := `{"key1": 123, "key3": ["foo", "bar"]}`
         exp2 := `{"key1": 321, "key3": ["foobar", "bar"]}`
	 actual := `{"key1": 123, "key2": "foobar", "key3": ["foo", "bar"]}`

	JSONContains(mockT, expValid, actual) // passed cause "actual" contains exp1 json
	JSONContains(mockT, expNotValid, actual) // failed cause "actual" does not contain exp2 json
  • add Regexp assert
    • Regexp assert verifies if passed string is valid for passed regexp

Example:

	rx := `^start`
	str1 := "start of the line"
        str2 := "of the line"

	Regexp(mockT, rx, str1) // passed cause str1 matches regexp (rx)
	Regexp(mockT, rx, str2) // failed cause str2 does not match regexp (rx)

NOTE: new asserts available from require/assert packages and from t.Require()/t.Assert() methods