Documentation
¶
Overview ¶
Package conformance compares deterministic browser snapshots without retaining document, network body, image, or credential payloads.
Index ¶
Constants ¶
View Source
const ( DefaultGeometryPixels = 2.0 DefaultGeometryPercent = 0.01 )
View Source
const ( DefaultPerceptualPixelDelta = 0.05 DefaultPerceptualDiffLimit = 0.02 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Difference ¶
type PerformanceGate ¶
type PerformanceGate struct {
Runner string `json:"runner"`
Baseline PerformanceMetrics `json:"baseline"`
Budget PerformanceMetrics `json:"budget"`
Current PerformanceMetrics `json:"current"`
}
type PerformanceMetrics ¶
type PerformanceReport ¶
type PerformanceReport struct {
Runner string `json:"runner"`
Differences []Difference `json:"differences,omitempty"`
}
func ComparePerformance ¶
func ComparePerformance(gate PerformanceGate) PerformanceReport
ComparePerformance rejects both absolute budget violations and regressions from the checked-in v0.16.0 result on the same fixed runner.
func (PerformanceReport) Passed ¶
func (report PerformanceReport) Passed() bool
type Report ¶
type Report struct {
Scenario string `json:"scenario"`
Differences []Difference `json:"differences,omitempty"`
}
type Snapshot ¶
type Snapshot struct {
Scenario string `json:"scenario"`
Viewport Extent `json:"viewport"`
DOMLandmarks []string `json:"domLandmarks"`
Computed map[string]map[string]string `json:"computed"`
Geometry map[string]Rect `json:"geometry"`
ScrollExtent Extent `json:"scrollExtent"`
Focus string `json:"focus"`
Resources map[string]string `json:"resources"`
}
Snapshot is the body-free state captured from Chromium or Growse at one corpus checkpoint.
type VisualRegion ¶
type VisualRegionResult ¶
type VisualReport ¶
type VisualReport struct {
DimensionMatch bool `json:"dimensionMatch"`
Regions []VisualRegionResult `json:"regions"`
}
func CompareVisual ¶
func CompareVisual(reference, actual image.Image, regions []VisualRegion, masks []image.Rectangle) VisualReport
CompareVisual reports the ratio of perceptually changed pixels after excluding explicit dynamic/font masks. Every named region is gated independently so a small but important panel cannot disappear unnoticed.
func (VisualReport) Passed ¶
func (report VisualReport) Passed() bool
Click to show internal directories.
Click to hide internal directories.