model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 2 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 string

AttachmentType is an enumeration of possible attachment types.

const (
	AttachmentTypeFile   AttachmentType = "FILE"
	AttachmentTypeURL    AttachmentType = "URL"
	AttachmentTypeIFrame AttachmentType = "IFRAME"
)

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 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 string

LogLevel is an enumeration of possible log levels.

const (
	LogLevelTrace LogLevel = "VERBOSE"
	LogLevelDebug LogLevel = "DEBUG"
	LogLevelInfo  LogLevel = "INFO"
	LogLevelWarn  LogLevel = "WARNNING"
	LogLevelError LogLevel = "ERROR"
)

Enum values for LogLevel

type ResultType

type ResultType string

ResultType is an enumeration of possible test result types.

const (
	ResultTypeUnknown    ResultType = "UNKNOWN"
	ResultTypeSucceed    ResultType = "SUCCEED"
	ResultTypeFailed     ResultType = "FAILED"
	ResultTypeLoadFailed ResultType = "LOAD_FAILED"
	ResultTypeIgnored    ResultType = "IGNORED"
	ResultTypeRunning    ResultType = "RUNNING"
	ResultTypeWaiting    ResultType = "WAITING"
)

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.

Jump to

Keyboard shortcuts

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