refactor: change TStep API/TestCase type

This commit is contained in:
debugtalk
2022-03-28 16:47:15 +08:00
parent d5cd830279
commit 205657588e
4 changed files with 60 additions and 38 deletions
+2 -2
View File
@@ -345,7 +345,7 @@ func (r *caseRunner) runStep(index int, caseConfig *TConfig) (stepResult *stepDa
if _, ok := step.(*StepAPIWithOptionalArgs); ok {
// run referenced API
log.Info().Str("api", copiedStep.Name).Msg("run referenced api")
api, _ := copiedStep.APIContent.ToAPI()
api, _ := copiedStep.API.(*API)
extendWithAPI(copiedStep, api)
}
// override headers
@@ -967,7 +967,7 @@ func (r *caseRunner) runStepTestCase(step *TStep) (stepResult *stepData, err err
StepType: stepTypeTestCase,
Success: false,
}
testcase := step.TestCaseContent
testcase := step.TestCase.(*TestCase)
// copy testcase to avoid data racing
copiedTestCase := &TestCase{}