Prove whether focus is visible on one control
qa_focus_proofFocus a control and measure whether its focus ring appears by comparing outline, box-shadow, border, and color changes plus the percentage of differing pixels between unfocused and focused frames.
Instructions
THE ARGUMENT NOBODY WINS WITH A SCREENSHOT, ended with two numbers. Focus the control and measure what actually changed: which of the four properties that can draw a ring moved (outline, box-shadow, border, colours), and what fraction of the PIXELS differ between the two frames. «Nothing in the styles changed and 0.0% of the pixels moved» is a sentence a developer cannot argue with; a screenshot of a missing ring looks exactly like a screenshot of a faint one. It is careful about the three ways this test lies elsewhere: the crop is widened by however far the styles say the ring can reach (an outline is drawn OUTSIDE the box, and a tight crop would swear it was absent), the second frame is taken after any transition has had time to finish, and a ring that is present but faint is reported as present — that is a contrast question, and this verb refuses to collapse the two. Read-only, and it puts focus back where it found it. Returns both frames, so the picture and the number travel together.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"selector": "<selector>"
},
"name": "qa_focus_proof"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Write the two frames here as <name>-unfocused.png and <name>-focused.png instead of returning them inline | |
| tabId | No | Target tab (from qa_tabs); omit for the active tab | |
| selector | Yes | The control to test — a CSS selector. Take it from qa_snapshot or from a focus walk stop. |