feat: add parameterization support for test cases and steps with configuration options

This commit is contained in:
lilong.129
2025-06-23 21:14:29 +08:00
parent 93007d5eb7
commit b320bbda31
8 changed files with 772 additions and 46 deletions

View File

@@ -88,6 +88,20 @@ func (c *TConfig) WithParameters(parameters map[string]interface{}) *TConfig {
return c
}
// WithParametersSetting sets parameters setting for current testcase.
func (c *TConfig) WithParametersSetting(options ...ParametersOption) *TConfig {
if c.ParametersSetting == nil {
c.ParametersSetting = &TParamsConfig{}
}
// apply all options
for _, option := range options {
option(c.ParametersSetting)
}
return c
}
// SetThinkTime sets think time config for current testcase.
func (c *TConfig) SetThinkTime(strategy ThinkTimeStrategy, cfg interface{}, limit float64) *TConfig {
c.ThinkTimeSetting = &ThinkTimeConfig{strategy, cfg, limit}