Documentation ¶
Overview ¶
package picker provided structures and method to manage injected variable system for Godog.
It allows an user to pick value into a store and inject them in steps through a variable replacement.
Index ¶
- Variables
- func Debug()
- func NoLog()
- func Reset() error
- func ResetLog()
- type Client
- type RequestPreparation
- func (request RequestPreparation) AddArgument(key, value string) RequestPreparation
- func (request RequestPreparation) AddCookie(key, val string, options *messages.PickleStepArgument_PickleTable) (RequestPreparation, error)
- func (request RequestPreparation) AddHeader(key, value string) RequestPreparation
- func (request RequestPreparation) AllowCookies(allow bool) RequestPreparation
- func (request RequestPreparation) Empty() bool
- func (request RequestPreparation) GenerateRequest(jar http.CookieJar) (*http.Request, error)
- func (request RequestPreparation) ResetArguments() RequestPreparation
- func (request RequestPreparation) ResetBody() RequestPreparation
- func (request RequestPreparation) ResetCookies() RequestPreparation
- func (request RequestPreparation) ResetHeader() RequestPreparation
- func (request RequestPreparation) SetEndpoint(endpoint string) RequestPreparation
- func (request RequestPreparation) SetFORMBody(body *godog.Table) RequestPreparation
- func (request RequestPreparation) SetJSONBody(body *godog.DocString) RequestPreparation
- func (request RequestPreparation) SetMethod(method string) RequestPreparation
- type Response
- func (r Response) GetCookie(cookieName string) *http.Cookie
- func (r Response) HTMLContain(expectedBody *godog.Table) error
- func (r Response) HTMLResemble(expectedBody *godog.DocString) error
- func (r Response) HasCookie(cookieName string) bool
- func (r Response) HasEmptyBody() bool
- func (r Response) HasStatus(status int) bool
- func (r Response) HeaderMatches(expected *godog.Table) error
- func (r Response) JSONContains(fully bool, expected *godog.Table) error
- func (r Response) JSONResemble(expectedBody *godog.DocString) error
- func (r Response) RetrieveHTMLAttribute(tag, attribute string, filters *godog.Table) (string, error)
- func (r Response) RetrieveHeader(key string) string
- func (r Response) RetrieveJSON(key string) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoMatch = errors.New("actual value does not match expected") ErrNoPath = errors.New("path does not exists in object") ErrNotFullyMatch = errors.New("expected values to be fully matched but it was not") )
View Source
var ( ErrNoBody = errors.New("impossible to retrieve data from empty response body") ErrUnknownKey = errors.New("unknown key") )
View Source
var ErrNoRequest = errors.New("trying to emit empty request")
Functions ¶
Types ¶
type Client ¶
type Client struct { Response *Response // contains filtered or unexported fields }
func (*Client) EmitRequest ¶
func (cli *Client) EmitRequest(req RequestPreparation) (err error)
func (*Client) SetFollowRedirection ¶
type RequestPreparation ¶
type RequestPreparation struct { AllowCookie bool JSONBody *string FORMBody map[string]formElement Headers *http.Header Cookies []*http.Cookie Arguments map[string]string Endpoint string Method string }
func PrepareRequest ¶
func PrepareRequest(withCookie bool) RequestPreparation
func (RequestPreparation) AddArgument ¶
func (request RequestPreparation) AddArgument(key, value string) RequestPreparation
func (RequestPreparation) AddCookie ¶
func (request RequestPreparation) AddCookie(key, val string, options *messages.PickleStepArgument_PickleTable) (RequestPreparation, error)
nolint: gocyclo
func (RequestPreparation) AddHeader ¶
func (request RequestPreparation) AddHeader(key, value string) RequestPreparation
func (RequestPreparation) AllowCookies ¶
func (request RequestPreparation) AllowCookies(allow bool) RequestPreparation
func (RequestPreparation) Empty ¶
func (request RequestPreparation) Empty() bool
func (RequestPreparation) GenerateRequest ¶
Generate request
func (RequestPreparation) ResetArguments ¶
func (request RequestPreparation) ResetArguments() RequestPreparation
func (RequestPreparation) ResetBody ¶
func (request RequestPreparation) ResetBody() RequestPreparation
func (RequestPreparation) ResetCookies ¶
func (request RequestPreparation) ResetCookies() RequestPreparation
func (RequestPreparation) ResetHeader ¶
func (request RequestPreparation) ResetHeader() RequestPreparation
func (RequestPreparation) SetEndpoint ¶
func (request RequestPreparation) SetEndpoint(endpoint string) RequestPreparation
func (RequestPreparation) SetFORMBody ¶
func (request RequestPreparation) SetFORMBody(body *godog.Table) RequestPreparation
func (RequestPreparation) SetJSONBody ¶
func (request RequestPreparation) SetJSONBody(body *godog.DocString) RequestPreparation
func (RequestPreparation) SetMethod ¶
func (request RequestPreparation) SetMethod(method string) RequestPreparation
type Response ¶
func NewResponse ¶
func (Response) HasEmptyBody ¶
func (Response) JSONContains ¶
func (Response) RetrieveHTMLAttribute ¶
func (Response) RetrieveHeader ¶
func (Response) RetrieveJSON ¶
Click to show internal directories.
Click to hide internal directories.