mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 00:39:34 +08:00
fix: enhance step log retrieval with prefix matching for parameterized steps
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0-beta-2506232134
|
v5.0.0-beta-2506232142
|
||||||
|
|||||||
10
report.go
10
report.go
@@ -221,8 +221,9 @@ func (g *HTMLReportGenerator) getStepLogs(stepName string, startTime int64, elap
|
|||||||
for _, logEntry := range g.LogData {
|
for _, logEntry := range g.LogData {
|
||||||
// Check for step boundaries to control inclusion
|
// Check for step boundaries to control inclusion
|
||||||
if logEntry.Message == RUN_STEP_START {
|
if logEntry.Message == RUN_STEP_START {
|
||||||
if stepFieldValue, exists := logEntry.Fields["step"]; exists {
|
if stepFieldValue, exists := logEntry.Fields["step"].(string); exists {
|
||||||
if stepFieldValue == stepName {
|
// use prefix matching for parameterized steps
|
||||||
|
if strings.HasPrefix(stepName, stepFieldValue) {
|
||||||
inCurrentStep = true
|
inCurrentStep = true
|
||||||
stepLogs = append(stepLogs, logEntry)
|
stepLogs = append(stepLogs, logEntry)
|
||||||
continue
|
continue
|
||||||
@@ -234,8 +235,9 @@ func (g *HTMLReportGenerator) getStepLogs(stepName string, startTime int64, elap
|
|||||||
}
|
}
|
||||||
|
|
||||||
if logEntry.Message == RUN_STEP_END {
|
if logEntry.Message == RUN_STEP_END {
|
||||||
if stepFieldValue, exists := logEntry.Fields["step"]; exists {
|
if stepFieldValue, exists := logEntry.Fields["step"].(string); exists {
|
||||||
if stepFieldValue == stepName {
|
// use prefix matching for parameterized steps
|
||||||
|
if strings.HasPrefix(stepName, stepFieldValue) {
|
||||||
stepLogs = append(stepLogs, logEntry)
|
stepLogs = append(stepLogs, logEntry)
|
||||||
inCurrentStep = false
|
inCurrentStep = false
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user