mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-31 05:19:38 +08:00
docs: add docs for IStep
This commit is contained in:
@@ -147,7 +147,7 @@ func (b *HRPBoomer) convertBoomerTask(testcase *TestCase, rendezvousList []*Rend
|
||||
if stepResult.StepType == stepTypeTransaction {
|
||||
// transaction
|
||||
// FIXME: support nested transactions
|
||||
if step.ToStruct().Transaction.Type == transactionEnd { // only record when transaction ends
|
||||
if step.Struct().Transaction.Type == transactionEnd { // only record when transaction ends
|
||||
b.RecordTransaction(stepResult.Name, transactionSuccess, stepResult.Elapsed, 0)
|
||||
transactionSuccess = true // reset flag for next transaction
|
||||
}
|
||||
|
||||
@@ -47,6 +47,6 @@ type TStep struct {
|
||||
type IStep interface {
|
||||
Name() string
|
||||
Type() StepType
|
||||
ToStruct() *TStep
|
||||
Struct() *TStep
|
||||
Run(*SessionRunner) (*StepResult, error)
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func (s *StepAPIWithOptionalArgs) Type() StepType {
|
||||
return stepTypeAPI
|
||||
}
|
||||
|
||||
func (s *StepAPIWithOptionalArgs) ToStruct() *TStep {
|
||||
func (s *StepAPIWithOptionalArgs) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ func (s *StepRendezvous) Type() StepType {
|
||||
return stepTypeRendezvous
|
||||
}
|
||||
|
||||
func (s *StepRendezvous) ToStruct() *TStep {
|
||||
func (s *StepRendezvous) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
|
||||
@@ -703,7 +703,7 @@ func (s *StepRequestWithOptionalArgs) Type() StepType {
|
||||
return StepType(fmt.Sprintf("request-%v", s.step.Request.Method))
|
||||
}
|
||||
|
||||
func (s *StepRequestWithOptionalArgs) ToStruct() *TStep {
|
||||
func (s *StepRequestWithOptionalArgs) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
@@ -737,7 +737,7 @@ func (s *StepRequestExtraction) Type() StepType {
|
||||
return StepType(fmt.Sprintf("request-%v", s.step.Request.Method))
|
||||
}
|
||||
|
||||
func (s *StepRequestExtraction) ToStruct() *TStep {
|
||||
func (s *StepRequestExtraction) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
@@ -761,7 +761,7 @@ func (s *StepRequestValidation) Type() StepType {
|
||||
return StepType(fmt.Sprintf("request-%v", s.step.Request.Method))
|
||||
}
|
||||
|
||||
func (s *StepRequestValidation) ToStruct() *TStep {
|
||||
func (s *StepRequestValidation) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ func (s *StepTestCaseWithOptionalArgs) Type() StepType {
|
||||
return stepTypeTestCase
|
||||
}
|
||||
|
||||
func (s *StepTestCaseWithOptionalArgs) ToStruct() *TStep {
|
||||
func (s *StepTestCaseWithOptionalArgs) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ func (s *StepThinkTime) Type() StepType {
|
||||
return stepTypeThinkTime
|
||||
}
|
||||
|
||||
func (s *StepThinkTime) ToStruct() *TStep {
|
||||
func (s *StepThinkTime) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ func (s *StepTransaction) Type() StepType {
|
||||
return stepTypeTransaction
|
||||
}
|
||||
|
||||
func (s *StepTransaction) ToStruct() *TStep {
|
||||
func (s *StepTransaction) Struct() *TStep {
|
||||
return s.step
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ func (tc *TestCase) ToTCase() *TCase {
|
||||
Config: tc.Config,
|
||||
}
|
||||
for _, step := range tc.TestSteps {
|
||||
tCase.TestSteps = append(tCase.TestSteps, step.ToStruct())
|
||||
tCase.TestSteps = append(tCase.TestSteps, step.Struct())
|
||||
}
|
||||
return tCase
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user