model

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 11

Documentation

Index

Constants

View Source
const DateTimeFormat = "2006-01-02T15:04:05.000Z"

DateTimeFormat is the format string for JSON datetime representation.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Name           string         `json:"Name"`
	Url            string         `json:"Url"`
	AttachmentType AttachmentType `json:"AttachmentType"`
}

Attachment represents an attachment in a test case log.

type AttachmentType

type AttachmentType int32

AttachmentType is an enumeration of possible attachment types.

const (
	AttachmentTypeFile AttachmentType = iota
	AttachmentTypeURL
	AttachmentTypeIFrame
)

Enum values for AttachmentType

type EntryParam

type EntryParam struct {
	// TaskId is the unique identifier for the task.
	TaskId string `json:"TaskId"`
	// ProjectPath is the directory where the user code is located.
	ProjectPath string `json:"ProjectPath"`
	// Context contains the test context information.
	Context map[string]string `json:"Context"`
	// TestSelectors is a list of selectors used to choose test cases.
	TestSelectors []string `json:"TestSelectors"`
	// Collectors is a list of collectors used to gather reports.
	Collectors []string `json:"Collectors"`
	// FileReportPath is the path used for file-based reporting.
	FileReportPath string `json:"FileReportPath"`
}

type JUnitFailure added in v0.0.11

type JUnitFailure struct {
	Message string `xml:"message,attr"`
	Type    string `xml:"type,attr"`
	Content string `xml:",chardata"`
}

type JUnitTestCase added in v0.0.11

type JUnitTestCase struct {
	ClassName string        `xml:"classname,attr"`
	Name      string        `xml:"name,attr"`
	Time      string        `xml:"time,attr"`
	Failure   *JUnitFailure `xml:"failure"`
}

type LoadError

type LoadError struct {
	Name    string `json:"Name"`
	Message string `json:"Message"`
}

LoadError represents an error that occurred during the loading process.

type LoadResult

type LoadResult struct {
	Tests      []*TestCase  `json:"Tests"`
	LoadErrors []*LoadError `json:"LoadErrors"`
}

LoadResult represents the result of a loading process, including any errors.

type LogLevel

type LogLevel int32

LogLevel is an enumeration of possible log levels.

const (
	LogLevelTrace LogLevel = iota
	LogLevelDebug
	LogLevelInfo
	LogLevelWarn
	LogLevelError
)

Enum values for LogLevel

type ResultType

type ResultType int32

ResultType is an enumeration of possible test result types.

const (
	ResultTypeUnknown ResultType = iota
	ResultTypeSucceed
	ResultTypeFailed
	ResultTypeLoadFailed
	ResultTypeIgnored
	ResultTypeRunning
	ResultTypeWaiting
	ResultTypeFiltered
)

Enum values for ResultType

type TestCase

type TestCase struct {
	Name       string            `json:"Name"`
	Attributes map[string]string `json:"Attributes"`
}

TestCase represents a test case with a name and a set of attributes.

type TestCaseAssertError

type TestCaseAssertError struct {
	Expect  string `json:"Expect"`
	Actual  string `json:"Actual"`
	Message string `json:"Message"`
}

TestCaseAssertError represents an assertion error in a test case.

type TestCaseLog

type TestCaseLog struct {
	Time         time.Time             `json:"-"`
	Level        LogLevel              `json:"Level"`
	Content      string                `json:"Content"`
	AssertError  *TestCaseAssertError  `json:"AssertError"`
	RuntimeError *TestCaseRuntimeError `json:"RuntimeError"`
	Attachments  []*Attachment         `json:"Attachments"`
}

TestCaseLog represents a log entry for a test case.

func (TestCaseLog) MarshalJSON

func (tcl TestCaseLog) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for TestCaseLog.

type TestCaseRuntimeError

type TestCaseRuntimeError struct {
	Summary string `json:"Summary"`
	Detail  string `json:"Detail"`
}

TestCaseRuntimeError represents a runtime error in a test case.

type TestCaseStep

type TestCaseStep struct {
	StartTime  time.Time      `json:"-"`
	Title      string         `json:"Title"`
	ResultType ResultType     `json:"ResultType"`
	EndTime    time.Time      `json:"-"`
	Logs       []*TestCaseLog `json:"Logs"`
}

TestCaseStep represents a step in a test case.

func (TestCaseStep) MarshalJSON

func (tcs TestCaseStep) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for TestCaseStep.

type TestResult

type TestResult struct {
	Test       *TestCase       `json:"Test"`
	StartTime  time.Time       `json:"-"`
	ResultType ResultType      `json:"ResultType"`
	Message    string          `json:"Message"`
	EndTime    time.Time       `json:"-"`
	Steps      []*TestCaseStep `json:"Steps"`
}

TestResult represents the result of a test case.

func (TestResult) MarshalJSON

func (tr TestResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for TestResult.

func (TestResult) TransferNameToHash added in v0.0.7

func (tr TestResult) TransferNameToHash() string

type TestSuite added in v0.0.11

type TestSuite struct {
	XMLName   xml.Name         `xml:"testsuite"`
	TestCases []*JUnitTestCase `xml:"testcase"`
}

Jump to

Keyboard shortcuts

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