mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
change: ensure step name not empty
This commit is contained in:
@@ -172,8 +172,11 @@ func (s *requestWithOptionalArgs) Extract() *stepRequestExtraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *requestWithOptionalArgs) Name() string {
|
func (s *requestWithOptionalArgs) Name() string {
|
||||||
|
if s.step.Name != "" {
|
||||||
return 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 {
|
||||||
return fmt.Sprintf("request-%v", s.step.Request.Method)
|
return fmt.Sprintf("request-%v", s.step.Request.Method)
|
||||||
@@ -199,8 +202,11 @@ func (s *testcaseWithOptionalArgs) Export(names ...string) *testcaseWithOptional
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *testcaseWithOptionalArgs) Name() string {
|
func (s *testcaseWithOptionalArgs) Name() string {
|
||||||
|
if s.step.Name != "" {
|
||||||
return s.step.Name
|
return s.step.Name
|
||||||
}
|
}
|
||||||
|
return s.step.TestCase.Config.Name
|
||||||
|
}
|
||||||
|
|
||||||
func (s *testcaseWithOptionalArgs) Type() string {
|
func (s *testcaseWithOptionalArgs) Type() string {
|
||||||
return "testcase"
|
return "testcase"
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ type stepRequestValidation struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *stepRequestValidation) Name() string {
|
func (s *stepRequestValidation) Name() string {
|
||||||
|
if s.step.Name != "" {
|
||||||
return 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 {
|
||||||
return fmt.Sprintf("request-%v", s.step.Request.Method)
|
return fmt.Sprintf("request-%v", s.step.Request.Method)
|
||||||
|
|||||||
Reference in New Issue
Block a user