Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assertion ¶
type Assertion struct { Comparison Comparison `json:"comparison"` Value string `json:"value"` Source Source `json:"Source"` Property string `json:"property,omitempty"` }
An Assertions defines one expected result
type Comparison ¶
type Comparison int
const ( EqualNumber Comparison = iota //equal_number Equal //equal NotEqual //not_equal IsANumber //is_a_number IsLessThan //is_less_than IsLessThanOrEqual //is_less_than_or_equals IsGreaterThan //is_greater_than IsGreaterThanOrEqual //is_greater_than_or_equal Contains //contains DoesNotContain //does_not_contain NotEmpty //not_empty Empty //empty IsNull //is_null HasValue //has_value HasKey //has_key )
func (Comparison) GetMessage ¶
func (i Comparison) GetMessage() comparisonMessage
type Response ¶
type ResultAssertion ¶
type ResultAssertion struct { Success bool `json:"success"` Source Source `json:"source,omitempty"` Property string `json:"property,omitempty"` Err error `json:"error,omitempty"` Message string `json:"message,omitempty"` }
func NewResultAssertion ¶
func NewResultAssertion(comparison Comparison, success bool, v ...interface{}) ResultAssertion
func (*ResultAssertion) Print ¶
func (ar *ResultAssertion) Print()
type ResultStep ¶
type ResultStep struct { // Common result for every step types StepType StepType `json:"step_type"` StepTime time.Duration `json:"step_time,omitempty"` // Specific for type request Request rest.Request `json:"request,omitempty"` Response Response `json:"response,omitempty"` Assertions []ResultAssertion `json:"assertions,omitempty"` VariablesApplied []ResultVariable `json:"variables_applied,omitempty"` VariablesCreated []ResultVariable `json:"variables_created,omitempty"` }
func (*ResultStep) IsSuccess ¶
func (step *ResultStep) IsSuccess() bool
IsSuccess check if the step was a success or not.
type ResultVariable ¶
type ResultVariable struct { Key string `json:"name,omitempty"` NewValue string `json:"value,omitempty"` Err error `json:"error,omitempty"` Type ResultVariableType `json:"-"` }
func (*ResultVariable) Print ¶
func (rv *ResultVariable) Print()
type ResultVariableType ¶
type ResultVariableType int
const ( Created ResultVariableType = iota //Variable Used //Set )
type Scenario ¶
type Scenario struct { Name string `json:"name"` Version string `json:"version"` ExportedAt int `json:"exported_at"` Steps []Step `json:"steps"` Description string `json:"description"` }
func InitScenarioFromFile ¶
InitScenarioFromFile creates a scenario from the input file.
type ScenarioResult ¶
type ScenarioResult struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` StepResults []ResultStep `json:"step_results,omitempty"` }
func (*ScenarioResult) IsSuccess ¶
func (scenario *ScenarioResult) IsSuccess() bool
IsSuccess check if the scenario was success.
type Step ¶
type Step struct { StepType StepType `json:"step_type"` URL string `json:"Url,omitempty"` Variables []Variable `json:"variables,omitempty"` Headers map[string][]string `json:"headers,omitempty"` Assertions []Assertion `json:"assertions,omitempty"` Method string `json:"method,omitempty"` Duration int `json:"duration,omitempty"` Body string `json:"body,omitempty"` Skipped bool `json:"skipped,omitempty"` }
Click to show internal directories.
Click to hide internal directories.