stepdefinition

package
v0.0.0-...-3730569 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAPIKeyHeaderIfHas

func AddAPIKeyHeaderIfHas(hitEndpoint *http.Request)

func CloseResponseBody

func CloseResponseBody(response *http.Response)

func GetAPIKey

func GetAPIKey() string

func InitializeScenario

func InitializeScenario(sc *godog.ScenarioContext)

func NewHTTPClient

func NewHTTPClient() *http.Client

func ReaderResponseBody

func ReaderResponseBody(response *http.Response) ([]byte, error)

func SendHTTPRequest

func SendHTTPRequest(request *http.Request) (*http.Response, error)

Types

type Entity

type Entity struct {
	UrlEndpoint  string
	ResponseData *http.Response
	Cases        helper.Case
	ResponseBody []byte
	// contains filtered or unexported fields
}

func (*Entity) GivenEndpoint

func (e *Entity) GivenEndpoint(host string, endpoint string) error

func (*Entity) InitializeDB

func (e *Entity) InitializeDB() error

func (*Entity) SendDELETEEndpointWithParams

func (e *Entity) SendDELETEEndpointWithParams(params string) error

func (*Entity) SendGETEndpointWithParams

func (e *Entity) SendGETEndpointWithParams(params string) error

func (*Entity) SendGETEndpointWithoutBody

func (e *Entity) SendGETEndpointWithoutBody() error

func (*Entity) SendPOSTEndpointWithBodyFormUrlEncoded

func (e *Entity) SendPOSTEndpointWithBodyFormUrlEncoded(table *godog.Table) error

func (*Entity) SendPOSTEndpointWithBodyJSON

func (e *Entity) SendPOSTEndpointWithBodyJSON(requestBody *godog.DocString) error

func (*Entity) SendPUTEndpointWithBodyJSON

func (e *Entity) SendPUTEndpointWithBodyJSON(params string, requestBody *godog.DocString) error

func (*Entity) ValidateJSONSchema

func (t *Entity) ValidateJSONSchema(jsonSchemaPath string) error

func (*Entity) ValidateResponseBody

func (t *Entity) ValidateResponseBody(path, expected string) error

func (*Entity) ValidateStatusCode

func (t *Entity) ValidateStatusCode(expected string) error

func (*Entity) ValidateValueDB

func (t *Entity) ValidateValueDB(query, expected string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL