merge main

This commit is contained in:
debugtalk
2022-03-04 17:46:04 +08:00
15 changed files with 395 additions and 17 deletions

View File

@@ -145,7 +145,7 @@ func (h *har) prepareTestStep(entry *Entry) (*hrp.TStep, error) {
step := &tStep{
TStep: hrp.TStep{
Request: &hrp.Request{},
Validators: make([]hrp.Validator, 0),
Validators: make([]interface{}, 0),
},
}
if err := step.makeRequestMethod(entry); err != nil {

View File

@@ -4,6 +4,8 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/httprunner/hrp"
)
var (
@@ -98,13 +100,16 @@ func TestMakeTestCase(t *testing.T) {
}
// make validators
if !assert.Equal(t, "status_code", tCase.TestSteps[0].Validators[0].Check) {
validator, ok := tCase.TestSteps[0].Validators[0].(hrp.Validator)
if !ok || !assert.Equal(t, "status_code", validator.Check) {
t.Fail()
}
if !assert.Equal(t, "headers.\"Content-Type\"", tCase.TestSteps[0].Validators[1].Check) {
validator, ok = tCase.TestSteps[0].Validators[1].(hrp.Validator)
if !ok || !assert.Equal(t, "headers.\"Content-Type\"", validator.Check) {
t.Fail()
}
if !assert.Equal(t, "body.url", tCase.TestSteps[0].Validators[2].Check) {
validator, ok = tCase.TestSteps[0].Validators[2].(hrp.Validator)
if !ok || !assert.Equal(t, "body.url", validator.Check) {
t.Fail()
}
}

View File

@@ -1,3 +1,3 @@
package version
const VERSION = "v0.6.2"
const VERSION = "v0.6.3"