pkg

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright 2023-2024 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023-2024 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertHistoryToRemoteTestCase added in v0.0.11

func ConvertHistoryToRemoteTestCase(historyTestcase *HistoryTestResult) (result *server.TestCase)

func ConvertToGRPCHistoryTestCase added in v0.0.11

func ConvertToGRPCHistoryTestCase(historyTestResult *HistoryTestResult) (result *server.HistoryTestCase)

func ConvertToGRPCHistoryTestSuite added in v0.0.11

func ConvertToGRPCHistoryTestSuite(historyTestResult *HistoryTestResult) (result *remote.HistoryTestSuite)

func ConvertToGRPCTestSuite

func ConvertToGRPCTestSuite(suite *TestSuite) (result *remote.TestSuite)

func ConvertToRemoteHistoryTestResult added in v0.0.11

func ConvertToRemoteHistoryTestResult(historyTestResult *HistoryTestResult) (result *server.HistoryTestResult)

func ConvertToRemoteTestCase

func ConvertToRemoteTestCase(testcase *TestCase) (result *server.TestCase)

func NewRemoteServer

func NewRemoteServer(defaultHistoryLimit int) (s remote.LoaderServer)

NewRemoteServer creates a remote server instance

func SliceToJSON

func SliceToJSON(slice []string) (result string)

Types

type HistoryTestResult added in v0.0.11

type HistoryTestResult struct {
	ID               string `gorm:"primaryKey"`
	HistorySuiteName string
	CreateTime       string

	//suite information
	SuiteName string `json:"suiteName"`
	SuiteAPI  string
	SpecKind  string
	SpecURL   string
	Param     string

	//case information
	CaseName      string `json:"caseName"`
	CaseAPI       string
	Method        string
	Body          string
	Header        string
	HistoryHeader string
	Cookie        string
	Query         string
	Form          string

	ExpectStatusCode int
	ExpectBody       string
	ExpectSchema     string
	ExpectHeader     string
	ExpectBodyFields string
	ExpectVerify     string

	//result information
	Message    string `json:"message"`
	Error      string `json:"error"`
	StatusCode int32  `json:"statusCode"`
	Output     string `json:"output"`
}

func ConvertToDBHistoryTestResult added in v0.0.11

func ConvertToDBHistoryTestResult(historyTestResult *server.HistoryTestResult) (result *HistoryTestResult)

type TestCase

type TestCase struct {
	SuiteName string `json:"suiteName" gorm:"type:varchar(200);uniqueIndex:idx_name_and_suite_name"`
	Name      string `gorm:"type:varchar(200);uniqueIndex:idx_name_and_suite_name"`
	API       string
	Method    string
	Body      string
	Header    string
	Cookie    string
	Query     string
	Form      string

	ExpectStatusCode int
	ExpectBody       string
	ExpectSchema     string
	ExpectHeader     string
	ExpectBodyFields string
	ExpectVerify     string
}

func ConverToDBTestCase

func ConverToDBTestCase(testcase *server.TestCase) (result *TestCase)

type TestSuite

type TestSuite struct {
	Name     string `gorm:"primaryKey"`
	API      string
	SpecKind string
	SpecURL  string
	Param    string
}

func ConvertToDBTestSuite

func ConvertToDBTestSuite(suite *remote.TestSuite) (result *TestSuite)

Jump to

Keyboard shortcuts

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