fix(browser): tell unlabeled table inputs apart by column header
Fixes #3293
A replayed act matched an unlabeled input by role, name and the text of its row. When two columns of a line-item grid swap places and the row text stays the same, the input at the recorded XPath is the other column's input but still matches, so the act replays as cache-hit and fills the wrong field.
An input in a table cell is now also recorded with the header of its column, and a replay only matches when that header is the same. A swapped column no longer matches, so the act heals. Recordings made before this have no column and replay as before.
I added TestReplayTargetColumn, which swaps "item code" and "quantity" with the row text unchanged. The browser package tests and go vet pass.
This does not read headers or aria-describedby, and it does not handle header cells that span columns.
Summary by cubic
Fixes #3293 — a replayed act for an unlabeled input in a table cell now records its column header, so swapped columns no longer fill the wrong field.
- A table-cell input is recorded with the header of its column, looked up only in the nearest table.
- A replay only matches when that header matches; a swapped column no longer matches, so the act heals instead of replaying as a cache-hit.
- A header row may start with a row-header cell, such as a corner cell, as long as it has at least one column header. A row of row headers alone is still a data row.
- A table with no header row gives no column, and recordings made before this change replay as before.
- A variable that only a column header holds still counts as used by the recording.
- Column tests now fail when their fixture page drifts, so the cases cannot silently go untested.
- Does not read
headersoraria-describedby, and does not handle header cells that span columns.
Summary by CodeRabbit
- Bug Fixes
- Browser replay now uses a form control’s table-column header when matching it to a recorded target. This helps distinguish controls in tables and prevents a target from matching a control under a different header.
- Targets outside table cells, or in columns without a matching header, continue to match without a recorded column header.