report

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AxeImpacts = map[string]int{
	"minor":    1,
	"moderate": 2,
	"serious":  3,
	"critical": 4,
}

AxeImpacts lists the violation impact categories in order of severity

Functions

func AddAxeResult added in v1.9.0

func AddAxeResult(result *AxeResults)

AddAxeResult stores an AxeResults entry for output in the final report

func NewAxeReport added in v1.9.0

func NewAxeReport(s *config.Settings)

NewAxeReport creates and stores a new Axe report. This should only be called once per application run, as it creates a global Axe report.

Types

type AxeNodeCheck added in v1.9.0

type AxeNodeCheck struct {
	ID           string                `json:"id"`
	Impact       string                `json:"impact"`
	Message      string                `json:"message"`
	Data         interface{}           `json:"data"`
	RelatedNodes []AxeNodeRelatedNodes `json:"relatedNodes"`
}

AxeNodeCheck stores finding details for a specific DOM node.

type AxeNodeRelatedNodes added in v1.9.0

type AxeNodeRelatedNodes struct {
	Target []string `json:"target"`
	HTML   string   `json:"html"`
}

AxeNodeRelatedNodes relates a node's finding to other nodes involved in that finding (e.g. nodes that share a duplicate ID).

type AxeNodes added in v1.9.0

type AxeNodes struct {
	HTML           string         `json:"html"`
	Impact         string         `json:"impact"`
	Target         []interface{}  `json:"target"`
	FailureSummary string         `json:"failureSummary"`
	Any            []AxeNodeCheck `json:"any"`
	All            []AxeNodeCheck `json:"all"`
	None           []AxeNodeCheck `json:"none"`
}

AxeNodes stores the findings of a rule and relates these findings to DOM nodes on a page.

func (*AxeNodes) GetPrettyFailureSummary added in v1.9.0

func (a *AxeNodes) GetPrettyFailureSummary() template.HTML

GetPrettyFailureSummary returns a "prettified" version of the failure summary

type AxeReport added in v1.9.0

type AxeReport struct {
	ProjectName     string        `json:"projectName"`
	OS              string        `json:"os"`
	AppVersion      string        `json:"appVersion"`
	Timestamp       string        `json:"timestamp"`
	Environment     string        `json:"environment"`
	Browser         string        `json:"browser"`
	RuleSets        []string      `json:"ruleSets"`
	ImpactThreshold string        `json:"impactThreshold"`
	AxeVersion      string        `json:"axeVersion"`
	AxeScans        []*AxeResults `json:"scans"`
	ViolationsCount int           `json:"violationsCount"`
	IncompleteCount int           `json:"incompleteCount"`
	MinorCount      int           `json:"minorCount"`
	ModerateCount   int           `json:"moderateCount"`
	SeriousCount    int           `json:"seriousCount"`
	CriticalCount   int           `json:"criticalCount"`
}

AxeReport encapsulates details of all Axe scans for a Kosher session

var Axe *AxeReport

Axe is the report structure that contains the summary and results of all Axe scans from the current session

func (*AxeReport) Process added in v1.9.0

func (a *AxeReport) Process(s *config.Settings) error

Process generates the Axe report

type AxeResults added in v1.9.0

type AxeResults struct {
	Title           string              `json:"title"`
	TestEngine      *AxeTestEngine      `json:"testEngine"`
	TestEnvironment *AxeTestEnvironment `json:"testEnvironment"`
	ToolOptions     *AxeToolOptions     `json:"toolOptions"`
	URL             string              `json:"url"`
	Timestamp       string              `json:"timestamp"`
	Violations      []AxeRuleFindings   `json:"violations"`
	Incomplete      []AxeRuleFindings   `json:"incomplete"`
	MinorCount      int                 `json:"minorCount"`
	ModerateCount   int                 `json:"moderateCount"`
	SeriousCount    int                 `json:"seriousCount"`
	CriticalCount   int                 `json:"criticalCount"`
	IncompleteCount int                 `json:"incompleteCount"`
}

AxeResults is the top-level results object returned by a call to axe.run(...)

type AxeRuleFindings added in v1.9.0

type AxeRuleFindings struct {
	Description string     `json:"description"`
	Help        string     `json:"help"`
	HelpURL     string     `json:"helpUrl"`
	ID          string     `json:"id"`
	Impact      string     `json:"impact"`
	Tags        []string   `json:"tags"`
	Nodes       []AxeNodes `json:"nodes"`
}

AxeRuleFindings stores the rule details and findings for each rule executed against the page.

type AxeRunOnly added in v1.9.0

type AxeRunOnly struct {
	Type   string   `json:"runOnly"`
	Values []string `json:"values"`
}

AxeRunOnly stores limits set on the rule sets applied for the test

type AxeTestEngine added in v1.9.0

type AxeTestEngine struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

AxeTestEngine stores metadata about the version of the axe-core API used

type AxeTestEnvironment added in v1.9.0

type AxeTestEnvironment struct {
	OrientationAngle int    `json:"orientationAngle"`
	OrientationType  string `json:"orientationType"`
	UserAgent        string `json:"userAgent"`
	WindowHeight     int    `json:"windowHeight"`
	WindowWidth      int    `json:"windowWidth"`
}

AxeTestEnvironment stores metadata about the browser and screen size used during testing

type AxeToolOptions added in v1.9.0

type AxeToolOptions struct {
	RunOnly *AxeRunOnly `json:"runOnly"`
}

AxeToolOptions stores options and settings passed to Axe for the test run

Jump to

Keyboard shortcuts

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