testcase

package
v0.0.0-...-f1fbba8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status int64
const (
	INIT    Status = 0 // 初始状态,还没执行过测试
	SUCCESS Status = 1 // 测试成功
	FAIL    Status = 2 // 测试失败
)

结果状态

type Summary

type Summary struct {
	Success  bool               `json:"success" yaml:"success"`
	Stat     *stat              `json:"stat" yaml:"stat"`
	Time     *testCaseTime      `json:"time" yaml:"time"`
	Platform *platform          `json:"platform" yaml:"platform"`
	Details  []*testCaseSummary `json:"details" yaml:"details"`
}

Summary stores tests summary for current task execution, maybe include one or multiple testcases

type TestCase

type TestCase struct {
	global.GVA_MODEL
	Name      string     `json:"name" form:"name" gorm:"column:name;comment:接口名称;type:varchar(120);"`
	Project   string     `json:"project" form:"project" gorm:"column:project;comment:接口所属项目;type:varchar(120);"`
	Server    string     `json:"server" form:"server" gorm:"column:server;comment:接口所属服务;type:varchar(220);"`
	ConfigId  int64      `json:"configId" form:"configId" gorm:"column:config_id;comment:配置ID;type:int"`
	TestSteps []TestStep `json:"teststeps" gorm:"many2many:test_case_step"`
	Result    Status     `json:"result" form:"result" gorm:"column:result;comment:接口测试结果;"`
	Creator   string     `json:"creator" form:"creator" gorm:"column:creator;comment:接口创建人;type:varchar(60);"`
}

TestCase implements ITestCase interface.

type TestStep

type TestStep struct {
	StepId    uint           `json:"stepId" gorm:"not null;unique;primary_key;comment:测试步骤ID"`
	Index     uint           `json:"index" gorm:"column:index;comment:步骤索引;comment:步骤索引"`
	Name      string         `json:"name" gorm:"column:name;comment:名称;type:varchar(120);"`
	Request   datatypes.JSON `json:"request" gorm:"column:request;comment:请求结构;type:json;"`
	Variables datatypes.JSON `json:"variables" gorm:"column:variables;comment:局部变量;type:json;"`
	Extract   datatypes.JSON `json:"extract" gorm:"column:extract;comment:响应解析;type:json;"`
	Validate  datatypes.JSON `json:"validate" gorm:"column:validate;comment:结果断言;type:json;"`
	Response  datatypes.JSON `json:"response" gorm:"column:response;comment:接口响应结果;type:json"`
	//Response  string `json:"response" gorm:"column:response;comment:接口响应结果;type:longtext"`
	Result bool `json:"result" gorm:"column:result;comment:接口测试结果;type:bool"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL