Documentation ¶
Index ¶
- func EnableWebTestUtil() fx.Option
- func RequireFxApp(options ...fx.Option) *fx.App
- func RequireFxAppT(tb testing.TB, options ...fx.Option) *fx.App
- func StartFxApp(options ...fx.Option) (*fx.App, error)
- func StartFxAppT(tb testing.TB, options ...fx.Option) (*fx.App, error)
- func WaitUntil(cb func() bool, timeout time.Duration)
- func WaitUntilT(t testing.TB, cb func() bool, timeout time.Duration)
- func WrapTestingLoggerOpt(tb testing.TB) fx.Option
- type FxTestSuite
- func (s *FxTestSuite) Config(opts ...TsConfig)
- func (s *FxTestSuite) Decorate(decorators ...interface{})
- func (s *FxTestSuite) Invoke(funcs ...interface{})
- func (s *FxTestSuite) Option(opts ...fx.Option)
- func (s *FxTestSuite) Options(opts []fx.Option)
- func (s *FxTestSuite) Populate(targets ...interface{})
- func (s *FxTestSuite) Profile(profiles ...string)
- func (s *FxTestSuite) ProfilePath(paths ...string)
- func (s *FxTestSuite) Provide(constructors ...interface{})
- func (s *FxTestSuite) StartApp()
- type JsonAssured
- type RequestBuilder
- func (r *RequestBuilder) BasicAuth(username string, password string) *RequestBuilder
- func (r *RequestBuilder) BearerToken(token string) *RequestBuilder
- func (r *RequestBuilder) Body(body string) *RequestBuilder
- func (r *RequestBuilder) Build() *http.Request
- func (r *RequestBuilder) Delete(url string) *RequestBuilder
- func (r *RequestBuilder) Get(url string) *RequestBuilder
- func (r *RequestBuilder) Header(key string, value string) *RequestBuilder
- func (r *RequestBuilder) Method(method string) *RequestBuilder
- func (r *RequestBuilder) Patch(url string) *RequestBuilder
- func (r *RequestBuilder) Post(url string) *RequestBuilder
- func (r *RequestBuilder) Put(url string) *RequestBuilder
- func (r *RequestBuilder) Then() *RestAssured
- func (r *RequestBuilder) URL(url string) *RequestBuilder
- type RestAssured
- func (r *RestAssured) Body(key string, expected interface{}) *RestAssured
- func (r *RestAssured) BodyCb(key string, expectedFn func(value interface{})) *RestAssured
- func (r *RestAssured) Header(key string, expected interface{}) *RestAssured
- func (r *RestAssured) Status(expected int) *RestAssured
- func (r *RestAssured) When() *RequestBuilder
- type TsConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableWebTestUtil ¶
Types ¶
type FxTestSuite ¶
func (*FxTestSuite) Config ¶
func (s *FxTestSuite) Config(opts ...TsConfig)
func (*FxTestSuite) Decorate ¶
func (s *FxTestSuite) Decorate(decorators ...interface{})
func (*FxTestSuite) Invoke ¶
func (s *FxTestSuite) Invoke(funcs ...interface{})
func (*FxTestSuite) Option ¶
func (s *FxTestSuite) Option(opts ...fx.Option)
func (*FxTestSuite) Options ¶
func (s *FxTestSuite) Options(opts []fx.Option)
func (*FxTestSuite) Populate ¶
func (s *FxTestSuite) Populate(targets ...interface{})
func (*FxTestSuite) Profile ¶
func (s *FxTestSuite) Profile(profiles ...string)
func (*FxTestSuite) ProfilePath ¶
func (s *FxTestSuite) ProfilePath(paths ...string)
func (*FxTestSuite) Provide ¶
func (s *FxTestSuite) Provide(constructors ...interface{})
func (*FxTestSuite) StartApp ¶
func (s *FxTestSuite) StartApp()
type JsonAssured ¶
type JsonAssured struct {
// contains filtered or unexported fields
}
JsonAssured ...
func NewJsonAssured ¶
func NewJsonAssured(t *testing.T, message string) *JsonAssured
NewJsonAssured ...
func (*JsonAssured) Get ¶
func (k *JsonAssured) Get(key string) interface{}
func (*JsonAssured) Has ¶
func (k *JsonAssured) Has(key string, expected interface{}) *JsonAssured
Has ...
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder represent http request builder for test
func NewRequestBuilder ¶
func NewRequestBuilder(restAssured *RestAssured) *RequestBuilder
NewRequestBuilder return a new instance of RequestBuilder
func (*RequestBuilder) BasicAuth ¶
func (r *RequestBuilder) BasicAuth(username string, password string) *RequestBuilder
BasicAuth set basic auth credentials to request builder
func (*RequestBuilder) BearerToken ¶
func (r *RequestBuilder) BearerToken(token string) *RequestBuilder
BearerToken set bearer token to request builder
func (*RequestBuilder) Body ¶
func (r *RequestBuilder) Body(body string) *RequestBuilder
Body set request body
func (*RequestBuilder) Build ¶
func (r *RequestBuilder) Build() *http.Request
Build create request from request builder
func (*RequestBuilder) Delete ¶
func (r *RequestBuilder) Delete(url string) *RequestBuilder
Delete set delete method and url to request builder
func (*RequestBuilder) Get ¶
func (r *RequestBuilder) Get(url string) *RequestBuilder
Get set get method and url to request builder
func (*RequestBuilder) Header ¶
func (r *RequestBuilder) Header(key string, value string) *RequestBuilder
func (*RequestBuilder) Method ¶
func (r *RequestBuilder) Method(method string) *RequestBuilder
Method set http method
func (*RequestBuilder) Patch ¶
func (r *RequestBuilder) Patch(url string) *RequestBuilder
Patch set patch method and url to request builder
func (*RequestBuilder) Post ¶
func (r *RequestBuilder) Post(url string) *RequestBuilder
Post set post method and url to request builder
func (*RequestBuilder) Put ¶
func (r *RequestBuilder) Put(url string) *RequestBuilder
Put set post method and url to request builder
func (*RequestBuilder) URL ¶
func (r *RequestBuilder) URL(url string) *RequestBuilder
URL set url method
type RestAssured ¶
type RestAssured struct {
// contains filtered or unexported fields
}
RestAssured represent rest assertion
func NewRestAssured ¶
func NewRestAssured(t *testing.T) *RestAssured
NewRestAssured return a new instance of RestAssured
func NewRestAssuredSuite ¶
func NewRestAssuredSuite(t suite.TestingSuite) *RestAssured
func (*RestAssured) Body ¶
func (r *RestAssured) Body(key string, expected interface{}) *RestAssured
Body assert json body in response Read https://github.com/tidwall/gjson for more information about path syntax
func (*RestAssured) BodyCb ¶
func (r *RestAssured) BodyCb(key string, expectedFn func(value interface{})) *RestAssured
func (*RestAssured) Header ¶
func (r *RestAssured) Header(key string, expected interface{}) *RestAssured
Header assert http header
func (*RestAssured) Status ¶
func (r *RestAssured) Status(expected int) *RestAssured
Status assert http status code
func (*RestAssured) When ¶
func (r *RestAssured) When() *RequestBuilder
When create a new request builder