cute icon indicating copy to clipboard operation
cute copied to clipboard

Not correct allure report in multi step tests

Open siller174 opened this issue 3 years ago • 0 comments

If use multi step feature in Suite:


func (i *ExampleSuite) TestExample_TwoSteps(t provider.T) {
	var (
		testBuilder = i.testMaker.NewTestBuilder()
	)

	testBuilder.
		Title("TestExample_TwoSteps").
		Tags("TestExample_TwoSteps", "some_tag").
		Parallel().
		CreateWithStep().

		// CreateWithStep first step

		StepName("Creat entry /posts/1").
		Request(req).
		ExpectExecuteTimeout(10*time.Second).
		ExpectStatus(http.StatusCreated).
		AssertBody(
			// Custom assert body
			examples.CustomAssertBody(),
		).
		ExecuteTest(context.Background(), t).

		// CreateWithStep second step for delete

		NextTestWithStep().
		StepName("Delete entry").
		RequestBuilder(
			cute.WithURL(u),
			cute.WithMethod(http.MethodDelete),
			cute.WithHeaders(map[string][]string{
				"some_auth_token": []string{fmt.Sprint(11111)},
			}),
		).
		ExecuteTest(context.Background(), t)
}

Result: image

But if create test is't in suite


func TestExampleSingleTes_Witouttitle(t *testing.T) {
	cute.NewTestBuilder().
		Title("TestExample123123123132112313").
		Tags("TestExample_TwoSteps", "some_tag").
		CreateWithStep().
		StepName("Create entry"). // Создание 1 шага
		RequestBuilder(
			cute.WithURI("https://jsonplaceholder.typicode.com/posts/1/comments"),
			cute.WithMethod(http.MethodPost),
		).
		ExpectStatus(http.StatusMultiStatus).
		AssertBody(
			// Custom assert body
			CustomAssertBody(),
		).
		ExecuteTest(context.Background(), t).
		NextTestWithStep().
		StepName("Delete entry"). // Создание 2 шага
		RequestBuilder(
			cute.WithURI("https://jsonplaceholder.typicode.com/posts/1/comments"),
			cute.WithMethod(http.MethodDelete),
		).
		ExecuteTest(context.Background(), t)
}

First step will not create in allure report.

image

siller174 avatar Jul 02 '22 07:07 siller174