fix: step name with parameterize mechanism

This commit is contained in:
xucong053
2022-06-30 21:00:38 +08:00
parent 189a53fca1
commit 4666d14aa5
4 changed files with 19 additions and 5 deletions

View File

@@ -64,10 +64,17 @@ func (r *SessionRunner) Start(givenVars map[string]interface{}) error {
// run step in sequential order
for _, step := range r.testCase.TestSteps {
log.Info().Str("step", step.Name()).
// parse step name
parsedName, err := r.parser.ParseString(step.Name(), r.sessionVariables)
if err != nil {
parsedName = step.Name()
}
stepName := convertString(parsedName)
log.Info().Str("step", stepName).
Str("type", string(step.Type())).Msg("run step start")
stepResult, err := step.Run(r)
stepResult.Name = stepName
if err != nil {
log.Error().
Str("step", stepResult.Name).