Documentation
¶
Overview ¶
Package playwright imports Playwright accessibility-snapshot and action-probe fixtures as normalized evidence records.
A legacy Playwright fixture is a JSON object with the following shape:
{
"url": "https://example.test/page",
"observedAt": "2026-01-01T00:00:00Z",
"snapshot": {
"role": "...",
"name": "...",
"children": [...]
},
"actionHint": "optional_action_name"
}
The adapter walks the snapshot tree and collects all interactive nodes (role in the locator enum) as CandidateLocators. No live browser is required; tests operate on saved JSON fixtures.
Index ¶
Constants ¶
const ( // FixtureVersion identifies raw fixtures emitted by Browsertools live // acquisition. Legacy saved-tree fixtures omit this field. FixtureVersion = "browsertools.playwright-capture.v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct{}
Adapter imports Playwright accessibility snapshot fixtures.
type Fixture ¶
type Fixture struct {
Version string `json:"version,omitempty"`
URL string `json:"url"`
ObservedAt string `json:"observedAt"`
ActionHint string `json:"actionHint,omitempty"`
PlaywrightVersion string `json:"playwrightVersion,omitempty"`
Snapshot *SnapshotNode `json:"snapshot,omitempty"`
ARIASnapshot string `json:"ariaSnapshot,omitempty"`
StructuredData []json.RawMessage `json:"structuredData,omitempty"`
Network *NetworkSummary `json:"network,omitempty"`
}
Fixture is the expected shape of a saved Playwright snapshot file.
type NetworkSummary ¶
type NetworkSummary struct {
Requests int `json:"requests"`
Responses int `json:"responses"`
ResponseBytes int64 `json:"responseBytes"`
BlockedRequests int `json:"blockedRequests"`
BlockedWebSockets int `json:"blockedWebSockets"`
BlockedPopups int `json:"blockedPopups"`
BlockedDownloads int `json:"blockedDownloads"`
BlockedDialogs int `json:"blockedDialogs"`
BlockedFileChoosers int `json:"blockedFileChoosers"`
}
NetworkSummary records bounded counts only. It intentionally contains no URLs, headers, cookies, bodies, or timing fingerprints.
type SnapshotNode ¶
type SnapshotNode struct {
Role string `json:"role"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Children []*SnapshotNode `json:"children,omitempty"`
}
SnapshotNode is one node in the Playwright accessibility tree.