allure

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 15 Imported by: 4

Documentation

Overview

Package allure provides allure formatter for godog.

Index

Constants

View Source
const (
	Broken  = Status("broken")
	Passed  = Status("passed")
	Failed  = Status("failed")
	Skipped = Status("skipped")
	Unknown = Status("unknown")
)

Available statuses.

Variables

This section is empty.

Functions

func RegisterFormatter

func RegisterFormatter()

RegisterFormatter adds allure to available formatters.

Types

type Attachment

type Attachment struct {
	Name   string `json:"name"`
	Source string `json:"source"`
	Type   string `json:"type"`
}

Attachment can be attached.

func NewAttachment

func NewAttachment(name string, mimeType string, resultsPath string, content []byte) (*Attachment, error)

NewAttachment creates and stores attachment.

type Container

type Container struct {
	UUID     string      `json:"uuid,omitempty"`
	Name     string      `json:"name"`
	Children []string    `json:"children"`
	Start    TimestampMs `json:"start,omitempty"`
	Stop     TimestampMs `json:"stop,omitempty"`
}

Container lists all results.

type Executor

type Executor struct {
	Name string `json:"name,omitempty" example:"Jenkins"`
	// Type may be one of [github, gitlab, teamcity, bamboo, jenkins] or a custom one.
	Type       string `json:"type,omitempty" example:"jenkins"`
	URL        string `json:"url,omitempty" example:"url"`
	BuildOrder int    `json:"buildOrder,omitempty" example:"13"`
	BuildName  string `json:"buildName,omitempty" example:"allure-report_deploy#13"`
	BuildURL   string `json:"buildUrl,omitempty" example:"http://example.org/build#13"`
	ReportURL  string `json:"reportUrl,omitempty" example:"http://example.org/build#13/AllureReport"`
	ReportName string `json:"reportName,omitempty" example:"Demo allure report"`
}

Executor describes execution context.

var (
	// Exec allows configuring execution context information.
	Exec Executor

	// ResultsPath controls report destination.
	ResultsPath = os.Getenv("ALLURE_RESULTS_PATH")
)

type Label

type Label struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

Label is a named value.

type Link struct {
	Name string   `json:"name,omitempty"`
	Type LinkType `json:"type,omitempty"`
	URL  string   `json:"url,omitempty"`
}

Link references additional resources.

type LinkType

type LinkType string

LinkType is a type of link.

const (
	Issue  LinkType = "issue"
	TMS    LinkType = "tms"
	Custom LinkType = "custom"
)

Types of links.

type Parameter

type Parameter struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

Parameter is a named value.

type Result

type Result struct {
	UUID          string         `json:"uuid,omitempty"`
	HistoryID     string         `json:"historyId,omitempty"`
	Name          string         `json:"name,omitempty"`
	Description   string         `json:"description,omitempty"`
	Status        Status         `json:"status,omitempty"`
	StatusDetails *StatusDetails `json:"statusDetails,omitempty"`
	Stage         string         `json:"stage,omitempty"` // "finished"
	Steps         []Step         `json:"steps,omitempty"`
	Attachments   []Attachment   `json:"attachments,omitempty"`
	Parameters    []Parameter    `json:"parameters,omitempty"`
	Start         TimestampMs    `json:"start,omitempty"`
	Stop          TimestampMs    `json:"stop,omitempty"`
	Children      []string       `json:"children,omitempty"`
	FullName      string         `json:"fullName,omitempty"`
	Labels        []Label        `json:"labels,omitempty"`
	Links         []Link         `json:"links,omitempty"`
}

Result is the top level report object for a test.

18 known properties: "start", "descriptionHtml", "parameters", "name", "historyId", "statusDetails", "status", "links", "fullName", "uuid", "description", "testCaseId", "stage", "labels", "stop", "steps", "rerunOf", "attachments".

type Status

type Status string

Status describes test result.

type StatusDetails

type StatusDetails struct {
	Known   bool   `json:"known,omitempty"`
	Muted   bool   `json:"muted,omitempty"`
	Flaky   bool   `json:"flaky,omitempty"`
	Message string `json:"message,omitempty"`
	Trace   string `json:"trace,omitempty"`
}

StatusDetails provides additional information on status.

type Step

type Step struct {
	Name          string         `json:"name,omitempty"`
	Status        Status         `json:"status,omitempty"`
	StatusDetails *StatusDetails `json:"statusDetails,omitempty"`
	Stage         string         `json:"stage"`
	ChildrenSteps []Step         `json:"steps"`
	Attachments   []Attachment   `json:"attachments"`
	Parameters    []Parameter    `json:"parameters"`
	Start         TimestampMs    `json:"start"`
	Stop          TimestampMs    `json:"stop"`
}

Step is a part of scenario result.

type TimestampMs

type TimestampMs int64

TimestampMs is a timestamp in milliseconds.

Jump to

Keyboard shortcuts

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