Found during the follow-up work on #12 (args-array migration).
The visible / not_visible / matches assertions read agent-browser's accessibility snapshot, whose YAML renderer re-escapes quotes inside quoted node labels: an apostrophe is doubled (it's → it''s) and a double quote is backslash-escaped. A visible: assertion on page text containing a quote can therefore never match, regardless of how faithfully the text reached the page.
Demonstrated: after set headers + open /echo-header, the page renders Header: Bearer it's-a-token verbatim (server receives it correctly), but the snapshot line is:
'heading "Header: Bearer it''s-a-token" [level=1]'
The runner's assertion layer should compare against un-escaped snapshot text (or parse the snapshot YAML properly) so quote-bearing page text is assertable. Textbox values are unaffected (value lines aren't YAML-quoted).
Note: two tests in test/runner-headers.test.ts currently work around this with matches patterns that tolerate exactly the doubled-apostrophe escaping (documented with block comments) — those workarounds can be simplified once this is fixed.
Found during the follow-up work on #12 (args-array migration).
The
visible/not_visible/matchesassertions read agent-browser's accessibility snapshot, whose YAML renderer re-escapes quotes inside quoted node labels: an apostrophe is doubled (it's→it''s) and a double quote is backslash-escaped. Avisible:assertion on page text containing a quote can therefore never match, regardless of how faithfully the text reached the page.Demonstrated: after
set headers+open /echo-header, the page rendersHeader: Bearer it's-a-tokenverbatim (server receives it correctly), but the snapshot line is:The runner's assertion layer should compare against un-escaped snapshot text (or parse the snapshot YAML properly) so quote-bearing page text is assertable. Textbox values are unaffected (value lines aren't YAML-quoted).
Note: two tests in
test/runner-headers.test.tscurrently work around this withmatchespatterns that tolerate exactly the doubled-apostrophe escaping (documented with block comments) — those workarounds can be simplified once this is fixed.