Documentation
¶
Index ¶
Constants ¶
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 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 LoadResult ¶
type LoadResult struct {
Tests []*TestCase `json:"Tests"`
LoadErrors []*LoadError `json:"LoadErrors"`
}
LoadResult represents the result of a loading process, including any errors.
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 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 ¶
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"`
}