Skip to content

feat: add text locators - #149

Draft
cpendery (cpendery) wants to merge 11 commits into
mainfrom
feat/text-locators-core
Draft

feat: add text locators#149
cpendery (cpendery) wants to merge 11 commits into
mainfrom
feat/text-locators-core

Conversation

@cpendery

@cpendery cpendery (cpendery) commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

  • add lazy, reusable text locators across Rust, Python, and JavaScript
  • support literal/regex matching, viewport or full scrollback, whitespace normalization, anchors, match locations, and any / unique / first / last / nth selection
  • re-resolve locators for waits and actions; click the middle matched cell and highlight selected matches in the live monitor and SVG screenshots
  • allow Playwright-style stacked searches with parent.locator(child), constrained to the dynamically resolved parent region
  • add a single CLI flow: tui-test locator "T" --action locations|wait|click|highlight
  • keep findText / find_text / find text compatibility helpers and make waitText / wait_text return the locator they waited on
  • version the daemon protocol independently so same-package-version older daemons restart before receiving new locator requests

Examples

const settings = terminal.locator("Settings Save", { whitespace: "normalize" });
await settings.locator("Save").click();

const items = terminal.locator(String.raw`item \d+`, { regex: true });
await items.highlight();
await items.nth(1).expect({ style: { bold: true } });
tui-test locator "Save" --match last --action click
tui-test locator 'item\s+\d+' --regex --action highlight

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo clippy -p tui-test-rs --all-targets --no-default-features -- -D warnings
  • cargo build
  • cargo test --workspace -- --test-threads=1
  • python -m unittest discover -s bindings/python/tests
  • python bindings/python/scripts/generate_stubs.py --check
  • npm run test:node --prefix bindings/js

This draft consolidates and supersedes #150, #151, #152, and #154.

Signed-off-by: cpendery <cpendery@vt.edu>
Signed-off-by: cpendery <cpendery@vt.edu>
Signed-off-by: cpendery <cpendery@vt.edu>
Signed-off-by: cpendery <cpendery@vt.edu>
Signed-off-by: cpendery <cpendery@vt.edu>
Signed-off-by: cpendery <cpendery@vt.edu>
Signed-off-by: cpendery <cpendery@vt.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant