Documentation ¶
Index ¶
- Variables
- func ContextValues(ctx context.Context) []context.Context
- func JoinContexts(ctx context.Context, others ...context.Context) context.Context
- func MustRegisterStepHandlers(handlers ...stepHandler)
- func Param[P any](ctx context.Context, name string) (P, bool)
- func RegisterStepHandlers(handlers ...stepHandler) error
- func Run(ctx context.Context, scenarios ...*Scenario) error
- func StepHandler(handler interface{}, matchExpressions ...string) stepHandler
- type AfterScenarioHook
- type AfterStepHook
- type BeforeScenarioHook
- type BeforeStepHook
- type CompoundContext
- type Context
- type Options
- type Params
- type Scenario
- type ScenarioError
- type ScenarioResult
- type Scenarios
- type SimulationContext
- type SimulationInitializer
- type Step
- type StepResult
- type StepStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnmatchedStepArgumentNumber = errors.New("func received more arguments than expected") ErrCannotConvert = errors.New("cannot convert argument") ErrUnsupportedArgumentType = errors.New("unsupported argument type") )
View Source
var ErrUndefined = errors.New("step is undefined")
ErrUndefined is returned in case if step definition was not found
View Source
var TimeNowFunc = time.Now
Functions ¶
func JoinContexts ¶
func MustRegisterStepHandlers ¶
func MustRegisterStepHandlers(handlers ...stepHandler)
func RegisterStepHandlers ¶
func RegisterStepHandlers(handlers ...stepHandler) error
func StepHandler ¶
func StepHandler(handler interface{}, matchExpressions ...string) stepHandler
Types ¶
type AfterScenarioHook ¶
type AfterStepHook ¶
type BeforeScenarioHook ¶
type CompoundContext ¶
func (*CompoundContext) Err ¶
func (join *CompoundContext) Err() error
func (*CompoundContext) Value ¶
func (join *CompoundContext) Value(key interface{}) interface{}
type ScenarioError ¶
type ScenarioError struct { Result ScenarioResult Cause error // contains filtered or unexported fields }
func NewScenarioError ¶
func NewScenarioError(err error, result ScenarioResult, cause error) *ScenarioError
func (*ScenarioError) Error ¶
func (e *ScenarioError) Error() string
func (*ScenarioError) Unwrap ¶
func (e *ScenarioError) Unwrap() error
type ScenarioResult ¶
type ScenarioResult struct { ScenarioId string StartedAt time.Time StepResults []StepResult }
type SimulationContext ¶
type SimulationContext struct {
// contains filtered or unexported fields
}
type SimulationInitializer ¶
type SimulationInitializer func(*SimulationContext)
type StepResult ¶
type StepResult struct { Status StepStatus FinishedAt time.Time Err error Returns []interface{} ScenarioId string Step *Step }
func NewStepResult ¶
func NewStepResult(scenarioId string, step *Step) StepResult
type StepStatus ¶
type StepStatus int
const ( Passed StepStatus = iota Failed Skipped Undefined Pending )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.