refactor: update config variables by parameters

This commit is contained in:
debugtalk
2022-04-13 16:15:07 +08:00
parent 8fc1fad395
commit 6b5a210814
4 changed files with 29 additions and 24 deletions
+2 -3
View File
@@ -69,8 +69,6 @@ func (s *StepTestCaseWithOptionalArgs) Run(r *SessionRunner) (*StepResult, error
if s.step.Name != "" {
copiedTestCase.Config.Name = s.step.Name
}
// merge & override variables
copiedTestCase.Config.Variables = mergeVariables(stepVariables, copiedTestCase.Config.Variables)
// merge & override extractors
copiedTestCase.Config.Export = mergeSlices(s.step.Export, copiedTestCase.Config.Export)
@@ -81,7 +79,8 @@ func (s *StepTestCaseWithOptionalArgs) Run(r *SessionRunner) (*StepResult, error
}
start := time.Now()
err = sessionRunner.Start()
// run referenced testcase with step variables
err = sessionRunner.Start(stepVariables)
stepResult.Elapsed = time.Since(start).Milliseconds()
if err != nil {
stepResult.Attachment = err.Error()