feat: data-driven.

This commit is contained in:
徐聪
2022-01-04 20:34:43 +08:00
parent 42b2e7d91e
commit 380f70bb1a
6 changed files with 98 additions and 67 deletions

View File

@@ -143,8 +143,12 @@ func (r *caseRunner) run() error {
}
cfg := config.ToStruct()
log.Info().Str("testcase", config.Name()).Msg("run testcase start")
for it := cfg.ParametersSetting.Iterator; it.HasNext(); {
cfg.Variables = mergeVariables(it.Next(), cfg.Variables)
for it := cfg.ParametersSetting.Iterator[0]; it.HasNext(); {
for _, it = range cfg.ParametersSetting.Iterator {
if it.HasNext() {
cfg.Variables = mergeVariables(it.Next(), cfg.Variables)
}
}
r.startTime = time.Now()
for index := range r.TestCase.TestSteps {
_, err := r.runStep(index, cfg)