testcase

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PipelineYmlVersion = "1.1"
	ApiTestType        = "api-test"
	ApiTestIDs         = "api_ids"
	UsecaseID          = "usecase_id"
	PipelineStageLen   = 10
)

API 返回对应的错误类型

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Service)

Option testCase 实例对象配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 db client

type Service

type Service struct {
	CreateTestSetFn func(apistructs.TestSetCreateRequest) (*apistructs.TestSet, error)
	// contains filtered or unexported fields
}

Service testCase 实例对象封装

func New

func New(options ...Option) *Service

New 新建 testcase service

func (*Service) BatchCleanFromRecycleBin

func (svc *Service) BatchCleanFromRecycleBin(req apistructs.TestCaseBatchCleanFromRecycleBinRequest) error

BatchCleanFromRecycleBin 从回收站彻底删除测试用例

func (*Service) BatchClearProcessingRecords

func (svc *Service) BatchClearProcessingRecords() error

func (*Service) BatchCopyTestCases

func (svc *Service) BatchCopyTestCases(req apistructs.TestCaseBatchCopyRequest) ([]uint64, error)

func (*Service) BatchCreateTestCases

func (svc *Service) BatchCreateTestCases(req apistructs.TestCaseBatchCreateRequest) ([]uint64, error)

BatchCreateTestCases 批量创建测试用例

func (*Service) BatchListAPIs

func (svc *Service) BatchListAPIs(projectID uint64, tcIDs []uint64) (map[uint64][]*apistructs.ApiTestInfo, error)

func (*Service) BatchUpdateTestCases

func (svc *Service) BatchUpdateTestCases(req apistructs.TestCaseBatchUpdateRequest) error

func (*Service) CreateAPI

func (*Service) CreateFileRecord

func (svc *Service) CreateFileRecord(req apistructs.TestFileRecordRequest) (uint64, error)

func (*Service) CreateTestCase

func (svc *Service) CreateTestCase(req apistructs.TestCaseCreateRequest) (uint64, error)

CreateTestCase 创建测试用例

func (*Service) DeleteAPI

func (svc *Service) DeleteAPI(apiID int64) error

func (*Service) DeleteRecordApiFilesByTime

func (svc *Service) DeleteRecordApiFilesByTime(t time.Time) error

func (*Service) ExecuteAPIs

func (svc *Service) ExecuteAPIs(req apistructs.ApiTestsActionRequest) (uint64, error)

ExecuteAPIs return created pipelien id

func (*Service) Export

func (svc *Service) Export(req apistructs.TestCaseExportRequest) (uint64, error)

func (*Service) ExportFile

func (svc *Service) ExportFile(record *dao.TestFileRecord)

func (*Service) ExportTestCases

func (svc *Service) ExportTestCases(req *apistructs.TestCaseExportRequest, sheetName string) (string, error)

func (*Service) GetAPI

func (svc *Service) GetAPI(apiID int64) (*apistructs.ApiTestInfo, error)

func (*Service) GetFileRecord

func (svc *Service) GetFileRecord(id uint64, locale string) (*apistructs.TestFileRecord, error)

func (*Service) GetFirstFileReady

func (svc *Service) GetFirstFileReady(actionType ...apistructs.FileActionType) (bool, *dao.TestFileRecord, error)

func (*Service) GetTestCase

func (svc *Service) GetTestCase(tcID uint64) (*apistructs.TestCase, error)

GetTestCase 获取测试用例详情

func (*Service) Import

Import 导入测试用例

func (*Service) ImportFile

func (svc *Service) ImportFile(record *dao.TestFileRecord)

func (*Service) ImportTestCases

func (svc *Service) ImportTestCases(req *apistructs.TestCaseImportRequest, testFileUUID string) error

func (*Service) ListAPIs

func (svc *Service) ListAPIs(testCaseID int64) ([]*apistructs.ApiTestInfo, error)

func (*Service) ListFileRecordsByProject

func (svc *Service) ListFileRecordsByProject(req apistructs.ListTestFileRecordsRequest) ([]apistructs.TestFileRecord, []string, map[string]int, error)

func (*Service) ListTestCases

func (svc *Service) ListTestCases(req apistructs.TestCaseListRequest) ([]apistructs.TestCase, []uint64, error)

ListTestCases return result TestCases, TestCaseIDs and error if have.

func (*Service) ListTestCasesDeep

func (svc *Service) ListTestCasesDeep(req apistructs.TestCaseListRequest) ([]uint64, error)

func (*Service) PagingTestCases

PagingTestCases 测试用例分页查询

func (*Service) UpdateAPI

func (svc *Service) UpdateAPI(req apistructs.ApiTestsUpdateRequest) (int64, error)

func (*Service) UpdateFileRecord

func (svc *Service) UpdateFileRecord(req apistructs.TestFileRecordRequest) error

func (*Service) UpdateTestCase

func (svc *Service) UpdateTestCase(req apistructs.TestCaseUpdateRequest) error

UpdateTestCase 更新测试用例

Jump to

Keyboard shortcuts

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