You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Text search and click-by-text match loosely with no exact option, causing false passes in UI tests #143
ui observe --find <text> (and, as far as we can tell, ui click --text <text>, ui wait --text, and the expect/until: {text} step of ui act) match the query loosely against the OCR text. A query for a word that is not on screen matches a different word that is. With no way to ask for an exact (substring) match, a test that checks "is X visible?" can pass when X is absent.
Steps to reproduce
In the guest, put a document on screen whose text is:
Installer was closed before it finished.
Open Installer again above
(for example, printf '…' > ~/fz.txt; open -a TextEdit ~/fz.txt).
On the host: VMPalMachine --cli ui <VM> observe --find "Installed." --json
Expected
No matches. "Installed." does not occur on the screen.
Actual
Two matches:
x=160 y=90 "Installer was closed before it finished."
x=190 y=102 "Open Installer again above"
--find "Installed" (no period) returns the same two lines. Exact phrases do work: --find "Installer was closed" returns only the first line.
Why it matters
In our test harness, a check like "the card now says Installed." passed while the card actually said "Installer was closed before it finished." In other words, the opposite state. We only found this because a later check in the same scenario contradicted it.
Request
Any of these would do:
an --exact (case-insensitive substring) flag for observe --find, click --text, wait --text and act's expect/until;
or a match score/kind in the JSON (exact / fuzzy), so a caller can reject fuzzy hits;
or documentation of the matching rule, so callers know to verify.
Workaround
We read all text with observe --text --json and do our own case-insensitive substring match. Before matching, we fold only curly quotes, ellipsis, middle dot/bullet and whitespace. We click at the computed position of the matched substring instead of using click --text.
Activity
sonswift commentedon Nov 25, 2026
Thanks for reporting this! We’ve noted the issue and will look into it.