parser

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT, MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVToMap

func CSVToMap(reader io.Reader) ([]map[string]string, error)

CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys

Types

type AssertionResult added in v1.13.4

type AssertionResult struct {
	XMLName        xml.Name `xml:"assertionResult"`
	Name           string   `xml:"name"`
	Failure        bool     `xml:"failure"`
	Error          bool     `xml:"error"`
	FailureMessage string   `xml:"failureMessage"`
}

AssertionResult contains assertion

type Example added in v1.13.8

type Example struct {
	Time            int              `xml:"t,attr"`
	Success         bool             `xml:"s,attr"`
	Label           string           `xml:"lb,attr"`
	ResponseCode    string           `xml:"rc,attr"`
	AssertionResult *AssertionResult `xml:"assertionResult"`
}

Example is example details

type Result

type Result struct {
	Success      bool
	Error        string
	Label        string
	ResponseCode string
	Duration     time.Duration
}

func MapElementToResult

func MapElementToResult(in map[string]string) Result

type Results

type Results struct {
	HasError         bool
	LastErrorMessage string
	Results          []Result
}

func ParseCSV added in v1.13.4

func ParseCSV(reader io.Reader) (results Results, err error)

type TestResult added in v1.13.4

type TestResult struct {
	Message string `xml:"message,attr"`
	Type    string `xml:"type,attr,omitempty"`
}

TestResult represents the result of a testcase

type TestResults added in v1.13.4

type TestResults struct {
	XMLName     xml.Name  `xml:"testResults"`
	HTTPSamples []Example `xml:"httpSample,omitempty"`
	Samples     []Example `xml:"sample,omitempty"`
}

TestResults is a root element of junit xml report

func ParseXML added in v1.13.4

func ParseXML(data []byte) (results TestResults, err error)

type Testcase added in v1.13.4

type Testcase struct {
	XMLName    xml.Name    `xml:"testcase"`
	Name       string      `xml:"name,attr"`
	ClassName  string      `xml:"classname,attr"`
	Assertions int         `xml:"assertions,attr,omitempty"`
	Time       float32     `xml:"time,attr,omitempty"`
	File       string      `xml:"file,attr,omitempty"`
	Line       int         `xml:"line,attr,omitempty"`
	Skipped    *TestResult `xml:"skipped,omitempty"`
	Failure    *TestResult `xml:"failure,omitempty"`
	Error      *TestResult `xml:"error,omitempty"`
}

Testcase define a testcase

type Testsuite added in v1.13.4

type Testsuite struct {
	XMLName    xml.Name   `xml:"testsuite"`
	Testcases  []Testcase `xml:"testcase"`
	Name       string     `xml:"name,attr"`
	Tests      int        `xml:"tests,attr"`
	Failures   int        `xml:"failures,attr"`
	Errors     int        `xml:"errors,attr"`
	Skipped    int        `xml:"skipped,attr,omitempty"`
	Assertions int        `xml:"assertions,attr,omitempty"`
	Time       float32    `xml:"time,attr"`
	Timestamp  string     `xml:"timestamp,attr,omitempty"`
	File       string     `xml:"file,attr,omitempty"`
}

Testsuite contains testsuite definition

type Testsuites added in v1.13.4

type Testsuites struct {
	XMLName    xml.Name    `xml:"testsuites"`
	Testsuites []Testsuite `xml:"testsuite,omitempty"`
	Name       string      `xml:"name,attr,omitempty"`
	Tests      int         `xml:"tests,attr,omitempty"`
	Failures   int         `xml:"failures,attr,omitempty"`
	Errors     int         `xml:"errors,attr,omitempty"`
	Skipped    int         `xml:"skipped,attr,omitempty"`
	Assertions int         `xml:"assertions,attr,omitempty"`
	Time       float32     `xml:"time,attr,omitempty"`
	Timestamp  string      `xml:"timestamp,attr,omitempty"`
}

Testsuites is a root element of junit report

Jump to

Keyboard shortcuts

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