MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / line

Function line

javascript/atoms/typescript/testing/accessibility-text.ts:57–70  ·  view source on GitHub ↗
(node: AccessibilityNode)

Source from the content-addressed store, hash-verified

55}
56
57function line(node: AccessibilityNode): string {
58 if (node.role === 'text') {
59 return `- text: ${node.name}`
60 }
61 let out = `- ${node.role}`
62 if (node.name !== '') {
63 out += ` ${quote(node.name)}`
64 }
65 out += states(node.states)
66 if (node.value !== undefined && node.value !== '') {
67 out += `: ${oneLine(node.value)}`
68 }
69 return out
70}
71
72export function toText(node: AccessibilityNode, indent = ''): string {
73 const lines = [indent + line(node)]

Callers 1

toTextFunction · 0.85

Calls 3

statesFunction · 0.85
quoteFunction · 0.70
oneLineFunction · 0.70

Tested by

no test coverage detected