models

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseCheck

type DatabaseCheck interface {
	DbQueryString() string
	DbResponseJson() []string

	SetDbQueryString(string)
	SetDbResponseJson([]string)
}

type DatabaseResult

type DatabaseResult struct {
	Query    string
	Response []string
}

type Form

type Form struct {
	Files map[string]string `json:"files" yaml:"files"`
}

TODO: add support for form fields

type Result

type Result struct {
	Path                string // TODO: remove
	Query               string // TODO: remove
	RequestBody         string
	ResponseStatusCode  int
	ResponseStatus      string
	ResponseContentType string
	ResponseBody        string
	ResponseHeaders     map[string][]string
	Errors              []error
	Test                TestInterface
	DatabaseResult      []DatabaseResult
}

Result of test execution

func (*Result) AllureStatus

func (r *Result) AllureStatus() (string, error)

func (*Result) Passed

func (r *Result) Passed() bool

Passed returns true if test passed (false otherwise)

type Summary

type Summary struct {
	Success bool
	Failed  int
	Skipped int
	Broken  int
	Total   int
}

type TestInterface

type TestInterface interface {
	ToQuery() string
	GetRequest() string
	ToJSON() ([]byte, error)
	GetMethod() string
	Path() string
	GetResponses() map[int]string
	GetResponse(code int) (string, bool)
	GetResponseHeaders(code int) (map[string]string, bool)
	GetName() string
	GetDescription() string
	GetStatus() string
	SetStatus(string)
	Fixtures() []string
	ServiceMocks() map[string]interface{}
	Pause() int
	BeforeScriptPath() string
	BeforeScriptTimeout() int
	AfterRequestScriptPath() string
	AfterRequestScriptTimeout() int
	Cookies() map[string]string
	Headers() map[string]string
	ContentType() string
	GetForm() *Form
	DbQueryString() string
	DbResponseJson() []string
	GetVariables() map[string]string
	GetCombinedVariables() map[string]string
	GetVariablesToSet() map[int]map[string]string
	GetDatabaseChecks() []DatabaseCheck
	SetDatabaseChecks([]DatabaseCheck)

	GetFileName() string

	// setters
	SetQuery(string)
	SetMethod(string)
	SetPath(string)
	SetRequest(string)
	SetForm(form *Form)
	SetResponses(map[int]string)
	SetHeaders(map[string]string)
	SetDbQueryString(string)
	SetDbResponseJson([]string)

	// comparison properties
	NeedsCheckingValues() bool
	IgnoreArraysOrdering() bool
	DisallowExtraFields() bool
	IgnoreDbOrdering() bool

	// Clone returns copy of current object
	Clone() TestInterface
}

Common Test interface

Jump to

Keyboard shortcuts

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