-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsimple.go
44 lines (37 loc) · 864 Bytes
/
simple.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package suite
import (
"context"
"net/http"
"net/url"
"time"
"github.com/ozontech/allure-go/pkg/framework/provider"
"github.com/ozontech/cute"
)
/*
Example simple request
Validate:
1) Execute time
2) Status code
*/
func (i *ExampleSuite) Test_Simple(t provider.T) {
var (
testMaker = cute.NewHTTPTestMaker()
testBuilder = testMaker.NewTestBuilder()
)
u, _ := url.Parse("https://jsonplaceholder.typicode.com/posts/1/comments")
testBuilder.
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(), t)
}