mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-13 00:11:28 +08:00
change: ensure step name not empty
This commit is contained in:
10
step.go
10
step.go
@@ -172,7 +172,10 @@ func (s *requestWithOptionalArgs) Extract() *stepRequestExtraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *requestWithOptionalArgs) Name() string {
|
func (s *requestWithOptionalArgs) Name() string {
|
||||||
return s.step.Name
|
if s.step.Name != "" {
|
||||||
|
return s.step.Name
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%s %s", s.step.Request.Method, s.step.Request.URL)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *requestWithOptionalArgs) Type() string {
|
func (s *requestWithOptionalArgs) Type() string {
|
||||||
@@ -199,7 +202,10 @@ func (s *testcaseWithOptionalArgs) Export(names ...string) *testcaseWithOptional
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *testcaseWithOptionalArgs) Name() string {
|
func (s *testcaseWithOptionalArgs) Name() string {
|
||||||
return s.step.Name
|
if s.step.Name != "" {
|
||||||
|
return s.step.Name
|
||||||
|
}
|
||||||
|
return s.step.TestCase.Config.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *testcaseWithOptionalArgs) Type() string {
|
func (s *testcaseWithOptionalArgs) Type() string {
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ type stepRequestValidation struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *stepRequestValidation) Name() string {
|
func (s *stepRequestValidation) Name() string {
|
||||||
return s.step.Name
|
if s.step.Name != "" {
|
||||||
|
return s.step.Name
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%s %s", s.step.Request.Method, s.step.Request.URL)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *stepRequestValidation) Type() string {
|
func (s *stepRequestValidation) Type() string {
|
||||||
|
|||||||
Reference in New Issue
Block a user