Documentation ¶
Index ¶
- Constants
- Variables
- func ResetEnvironment(ctx context.Context)
- func WithEnvironment(ctx context.Context, env map[string]string) context.Context
- func WithRequestRunner(ctx context.Context, runner RequestRunner) context.Context
- func WithRuntime(ctx context.Context, rt *Runtime) context.Context
- type Assertion
- type Header
- type Headers
- type Request
- type RequestRunner
- type Response
- type Runtime
Constants ¶
View Source
const (
RequestSeparator = "###"
)
Variables ¶
View Source
var ( ErrInvalidRequest = errors.New("invalid request") ErrSkipped = errors.New("request skipped") )
Functions ¶
func ResetEnvironment ¶
func WithEnvironment ¶
func WithRequestRunner ¶
func WithRequestRunner(ctx context.Context, runner RequestRunner) context.Context
Types ¶
type Request ¶
type Request struct { // The name of the request // Example: Get User Name string // PreRequestScript is a piece of JavaScript code that executes before the request is sent. // Example: var token = req.environment.get("token"); PreRequestScript string // PreRequestAssertions is a list resulting from the assertions that were executed before the request is sent. PreRequestAssertions []Assertion // PostRequestScript is a piece of JavaScript code that executes after the request is sent. PostRequestScript string // The HTTP method used (GET, POST, PUT, DELETE, etc.) Method string // The URL of the request URL string // The HTTP body // Note: The body is not parsed. // Example: {"foo":"bar"} // Example: <xml><foo>bar</foo></xml> // Example: foo=bar&baz=qux Body string // The http Headers Headers Headers // Skip is a flag that indicates if the request should be skipped Skip bool // Logs is a list of logs generated by any scripts in the request Logs []string }
Request is a struct that holds the HTTP request data.
func ParseFromFile ¶
func ParseRequests ¶
func (Request) DisplayName ¶
type Response ¶
func (*Response) PrettyString ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.