diff --git a/src/service/testing/check.go b/src/service/testing/check.go index c448c4bebf753dc0c42afb3813c541fbca78019d..3fbf2aab48a0d177f1447f889253c681bb88451b 100644 --- a/src/service/testing/check.go +++ b/src/service/testing/check.go @@ -52,7 +52,7 @@ func ValidateCaseResult(scriptFile string, langType string, stepId, _ := strconv.Atoi(str) stepResult, checkpointLogs := ValidateStepResult(langType, expectLines, actualLines) - stepLog := model.StepLog{Id: stepId, Name: step, Status: stepResult, CheckPoints: checkpointLogs} + stepLog := model.StepLog{Id: stepId, Name: arr[1], Status: stepResult, CheckPoints: checkpointLogs} stepLogs = append(stepLogs, stepLog) if !stepResult { caseResult = constant.FAIL.String() diff --git a/src/service/testing/report.go b/src/service/testing/report.go index c2ccdd2e6bf341f46e84333a76fd733f1cf379fd..4a5ff9391a8a85431788ab105584a78806ea8f2d 100644 --- a/src/service/testing/report.go +++ b/src/service/testing/report.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "github.com/easysoft/zentaoatf/src/model" - "github.com/easysoft/zentaoatf/src/utils/common" constant "github.com/easysoft/zentaoatf/src/utils/const" "github.com/easysoft/zentaoatf/src/utils/file" i118Utils "github.com/easysoft/zentaoatf/src/utils/i118" @@ -29,7 +28,7 @@ func Print(report model.TestReport) { logUtils.PrintAndLogColorLn(fmt.Sprintf(" %s: %d", i118Utils.I118Prt.Sprintf("skip"), report.Skip), color.FgYellow) for _, cs := range report.Cases { - str := "\n %d. %s %s, %s" + str := "\n%d. %s %s, %s" status := cs.Status statusColor := logUtils.ColoredStatus(status) @@ -43,12 +42,12 @@ func Print(report model.TestReport) { logUtils.PrintAndLog("") } - str := " %s: %s" - status := commonUtils.BoolToPass(step.Status) - statusColor := logUtils.ColoredStatus(status) + str := "[Step%d]: %s \n" + //status := commonUtils.BoolToPass(step.Status) + //statusColor := logUtils.ColoredStatus(status) //logs = append(logs, fmt.Sprintf(str, status, step.Name)) - logUtils.PrintTo(fmt.Sprintf(str, statusColor, step.Name+"\n")) + logUtils.PrintTo(fmt.Sprintf(str, step.Id, step.Name)) count1 := 0 for _, cp := range step.CheckPoints { @@ -62,8 +61,8 @@ func Print(report model.TestReport) { // i118Utils.I118Prt.Sprintf("checkpoint"), cp.Numb)) //logUtils.PrintTo(fmt.Sprintf(" %s: %s %d\n", cpStatusColored, i118Utils.I118Prt.Sprintf("checkpoint"), cp.Numb)) - logUtils.PrintAndLog(fmt.Sprintf(" %s %s", i118Utils.I118Prt.Sprintf("expect_result"), cp.Expect)) - logUtils.PrintAndLog(fmt.Sprintf(" %s %s", i118Utils.I118Prt.Sprintf("actual_result"), cp.Actual)) + logUtils.PrintAndLog(fmt.Sprintf("[Expect] %s", cp.Expect)) + logUtils.PrintAndLog(fmt.Sprintf("[Actual] %s", cp.Actual)) count1++ }