Documentation ¶
Index ¶
- Constants
- type Option
- type Service
- func (svc *Service) BatchCleanFromRecycleBin(req apistructs.TestCaseBatchCleanFromRecycleBinRequest) error
- func (svc *Service) BatchClearProcessingRecords() error
- func (svc *Service) BatchCopyTestCases(req apistructs.TestCaseBatchCopyRequest) ([]uint64, error)
- func (svc *Service) BatchCreateTestCases(req apistructs.TestCaseBatchCreateRequest) ([]uint64, error)
- func (svc *Service) BatchListAPIs(projectID uint64, tcIDs []uint64) (map[uint64][]*apistructs.ApiTestInfo, error)
- func (svc *Service) BatchUpdateTestCases(req apistructs.TestCaseBatchUpdateRequest) error
- func (svc *Service) CreateAPI(req apistructs.ApiTestsCreateRequest) (*apistructs.ApiTestInfo, error)
- func (svc *Service) CreateFileRecord(req apistructs.TestFileRecordRequest) (uint64, error)
- func (svc *Service) CreateTestCase(req apistructs.TestCaseCreateRequest) (uint64, error)
- func (svc *Service) DeleteAPI(apiID int64) error
- func (svc *Service) DeleteRecordApiFilesByTime(t time.Time) error
- func (svc *Service) ExecuteAPIs(req apistructs.ApiTestsActionRequest) (uint64, error)
- func (svc *Service) Export(req apistructs.TestCaseExportRequest) (uint64, error)
- func (svc *Service) ExportAIGenerated(req apistructs.TestCaseExportRequest) (uint64, error)
- func (svc *Service) ExportFile(record *dao.TestFileRecord)
- func (svc *Service) ExportTestCases(req *apistructs.TestCaseExportRequest, sheetName string, needQuery bool) (string, error)
- func (svc *Service) GetAPI(apiID int64) (*apistructs.ApiTestInfo, error)
- func (svc *Service) GetFileRecord(id uint64, locale string) (*apistructs.TestFileRecord, error)
- func (svc *Service) GetFirstFileReady(actionType ...apistructs.FileActionType) (bool, *dao.TestFileRecord, error)
- func (svc *Service) GetTestCase(tcID uint64) (*apistructs.TestCase, error)
- func (svc *Service) Import(req apistructs.TestCaseImportRequest, r *http.Request) (*apistructs.TestCaseImportResult, error)
- func (svc *Service) ImportFile(record *dao.TestFileRecord)
- func (svc *Service) ImportTestCases(req *apistructs.TestCaseImportRequest, testFileUUID string) error
- func (svc *Service) ListAPIs(testCaseID int64) ([]*apistructs.ApiTestInfo, error)
- func (svc *Service) ListFileRecords(req apistructs.ListTestFileRecordsRequest) ([]apistructs.TestFileRecord, []string, map[string]int, int, error)
- func (svc *Service) ListTestCases(req apistructs.TestCaseListRequest) ([]apistructs.TestCase, []uint64, error)
- func (svc *Service) ListTestCasesDeep(req apistructs.TestCaseListRequest) ([]uint64, error)
- func (svc *Service) MarkFileRecordAsTimeout(timeout time.Duration) error
- func (svc *Service) PagingTestCases(req apistructs.TestCasePagingRequest) (*apistructs.TestCasePagingResponseData, error)
- func (svc *Service) UpdateAPI(req apistructs.ApiTestsUpdateRequest) (int64, error)
- func (svc *Service) UpdateFileRecord(req apistructs.TestFileRecordRequest) error
- func (svc *Service) UpdateTestCase(req apistructs.TestCaseUpdateRequest) error
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 WithIssueDBClient ¶
func WithPipelineSvc ¶
func WithPipelineSvc(pipelineSvc pipelinepb.PipelineServiceServer) Option
type Service ¶
type Service struct { CreateTestSetFn func(apistructs.TestSetCreateRequest) (*apistructs.TestSet, error) // contains filtered or unexported fields }
Service testCase 实例对象封装
func (*Service) BatchCleanFromRecycleBin ¶
func (svc *Service) BatchCleanFromRecycleBin(req apistructs.TestCaseBatchCleanFromRecycleBinRequest) error
BatchCleanFromRecycleBin 从回收站彻底删除测试用例
func (*Service) BatchClearProcessingRecords ¶
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 (svc *Service) CreateAPI(req apistructs.ApiTestsCreateRequest) (*apistructs.ApiTestInfo, error)
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) DeleteRecordApiFilesByTime ¶
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) ExportAIGenerated ¶
func (svc *Service) ExportAIGenerated(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, needQuery bool) (string, error)
needQuery 参数表示测试用例是否从数据库获取 如果是从测试用例页面导出,这里需要查表, needQuery 设置为 true 如果是从 AI 生成测试用例页面导出,则无需查表,因为生成的结果并没有存储到数据库, needQuery 设置为 false
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 ¶
func (svc *Service) Import(req apistructs.TestCaseImportRequest, r *http.Request) (*apistructs.TestCaseImportResult, error)
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) ListFileRecords ¶
func (svc *Service) ListFileRecords(req apistructs.ListTestFileRecordsRequest) ([]apistructs.TestFileRecord, []string, map[string]int, 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) MarkFileRecordAsTimeout ¶
func (*Service) PagingTestCases ¶
func (svc *Service) PagingTestCases(req apistructs.TestCasePagingRequest) (*apistructs.TestCasePagingResponseData, error)
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 更新测试用例
Click to show internal directories.
Click to hide internal directories.